Lines Matching refs:md_info
237 if( ctx == NULL || ctx->md_info == NULL ) in mbedtls_md_free()
242 switch( ctx->md_info->type ) in mbedtls_md_free()
289 2 * ctx->md_info->block_size ); in mbedtls_md_free()
299 if( dst == NULL || dst->md_info == NULL || in mbedtls_md_clone()
300 src == NULL || src->md_info == NULL || in mbedtls_md_clone()
301 dst->md_info != src->md_info ) in mbedtls_md_clone()
306 switch( src->md_info->type ) in mbedtls_md_clone()
359 int mbedtls_md_setup( mbedtls_md_context_t *ctx, const mbedtls_md_info_t *md_info, int hmac ) in mbedtls_md_setup() argument
361 if( md_info == NULL || ctx == NULL ) in mbedtls_md_setup()
364 ctx->md_info = md_info; in mbedtls_md_setup()
368 switch( md_info->type ) in mbedtls_md_setup()
411 ctx->hmac_ctx = mbedtls_calloc( 2, md_info->block_size ); in mbedtls_md_setup()
425 if( ctx == NULL || ctx->md_info == NULL ) in mbedtls_md_starts()
428 switch( ctx->md_info->type ) in mbedtls_md_starts()
465 if( ctx == NULL || ctx->md_info == NULL ) in mbedtls_md_update()
468 switch( ctx->md_info->type ) in mbedtls_md_update()
505 if( ctx == NULL || ctx->md_info == NULL ) in mbedtls_md_finish()
508 switch( ctx->md_info->type ) in mbedtls_md_finish()
543 int mbedtls_md( const mbedtls_md_info_t *md_info, const unsigned char *input, size_t ilen, in mbedtls_md() argument
546 if( md_info == NULL ) in mbedtls_md()
549 switch( md_info->type ) in mbedtls_md()
585 int mbedtls_md_file( const mbedtls_md_info_t *md_info, const char *path, unsigned char *output ) in mbedtls_md_file() argument
593 if( md_info == NULL ) in mbedtls_md_file()
601 if( ( ret = mbedtls_md_setup( &ctx, md_info, 0 ) ) != 0 ) in mbedtls_md_file()
632 if( ctx == NULL || ctx->md_info == NULL || ctx->hmac_ctx == NULL ) in mbedtls_md_hmac_starts()
635 if( keylen > (size_t) ctx->md_info->block_size ) in mbedtls_md_hmac_starts()
644 keylen = ctx->md_info->size; in mbedtls_md_hmac_starts()
649 opad = (unsigned char *) ctx->hmac_ctx + ctx->md_info->block_size; in mbedtls_md_hmac_starts()
651 memset( ipad, 0x36, ctx->md_info->block_size ); in mbedtls_md_hmac_starts()
652 memset( opad, 0x5C, ctx->md_info->block_size ); in mbedtls_md_hmac_starts()
663 ctx->md_info->block_size ) ) != 0 ) in mbedtls_md_hmac_starts()
674 if( ctx == NULL || ctx->md_info == NULL || ctx->hmac_ctx == NULL ) in mbedtls_md_hmac_update()
686 if( ctx == NULL || ctx->md_info == NULL || ctx->hmac_ctx == NULL ) in mbedtls_md_hmac_finish()
689 opad = (unsigned char *) ctx->hmac_ctx + ctx->md_info->block_size; in mbedtls_md_hmac_finish()
696 ctx->md_info->block_size ) ) != 0 ) in mbedtls_md_hmac_finish()
699 ctx->md_info->size ) ) != 0 ) in mbedtls_md_hmac_finish()
709 if( ctx == NULL || ctx->md_info == NULL || ctx->hmac_ctx == NULL ) in mbedtls_md_hmac_reset()
716 return( mbedtls_md_update( ctx, ipad, ctx->md_info->block_size ) ); in mbedtls_md_hmac_reset()
719 int mbedtls_md_hmac( const mbedtls_md_info_t *md_info, in mbedtls_md_hmac() argument
727 if( md_info == NULL ) in mbedtls_md_hmac()
732 if( ( ret = mbedtls_md_setup( &ctx, md_info, 1 ) ) != 0 ) in mbedtls_md_hmac()
750 if( ctx == NULL || ctx->md_info == NULL ) in mbedtls_md_process()
753 switch( ctx->md_info->type ) in mbedtls_md_process()
788 unsigned char mbedtls_md_get_size( const mbedtls_md_info_t *md_info ) in mbedtls_md_get_size() argument
790 if( md_info == NULL ) in mbedtls_md_get_size()
793 return md_info->size; in mbedtls_md_get_size()
796 mbedtls_md_type_t mbedtls_md_get_type( const mbedtls_md_info_t *md_info ) in mbedtls_md_get_type() argument
798 if( md_info == NULL ) in mbedtls_md_get_type()
801 return md_info->type; in mbedtls_md_get_type()
804 const char *mbedtls_md_get_name( const mbedtls_md_info_t *md_info ) in mbedtls_md_get_name() argument
806 if( md_info == NULL ) in mbedtls_md_get_name()
809 return md_info->name; in mbedtls_md_get_name()