Home
last modified time | relevance | path

Searched refs:md_info (Results 1 – 25 of 67) sorted by relevance

123

/external/mbedtls/library/
Dmd.c230 return( ctx->MBEDTLS_PRIVATE(md_info) ); in mbedtls_md_info_from_ctx()
240 if( ctx == NULL || ctx->md_info == NULL ) in mbedtls_md_free()
245 switch( ctx->md_info->type ) in mbedtls_md_free()
292 2 * ctx->md_info->block_size ); in mbedtls_md_free()
302 if( dst == NULL || dst->md_info == NULL || in mbedtls_md_clone()
303 src == NULL || src->md_info == NULL || in mbedtls_md_clone()
304 dst->md_info != src->md_info ) in mbedtls_md_clone()
309 switch( src->md_info->type ) in mbedtls_md_clone()
362 int mbedtls_md_setup( mbedtls_md_context_t *ctx, const mbedtls_md_info_t *md_info, int hmac ) in mbedtls_md_setup() argument
364 if( md_info == NULL || ctx == NULL ) in mbedtls_md_setup()
[all …]
Dhmac_drbg.c59 size_t md_len = mbedtls_md_get_size( ctx->md_ctx.md_info ); in mbedtls_hmac_drbg_update()
104 const mbedtls_md_info_t * md_info, in mbedtls_hmac_drbg_seed_buf() argument
109 if( ( ret = mbedtls_md_setup( &ctx->md_ctx, md_info, 1 ) ) != 0 ) in mbedtls_hmac_drbg_seed_buf()
122 mbedtls_md_get_size( md_info ) ) ) != 0 ) in mbedtls_hmac_drbg_seed_buf()
124 memset( ctx->V, 0x01, mbedtls_md_get_size( md_info ) ); in mbedtls_hmac_drbg_seed_buf()
229 const mbedtls_md_info_t * md_info, in mbedtls_hmac_drbg_seed() argument
238 if( ( ret = mbedtls_md_setup( &ctx->md_ctx, md_info, 1 ) ) != 0 ) in mbedtls_hmac_drbg_seed()
246 md_size = mbedtls_md_get_size( md_info ); in mbedtls_hmac_drbg_seed()
318 size_t md_len = mbedtls_md_get_size( ctx->md_ctx.md_info ); in mbedtls_hmac_drbg_random_with_add()
414 if( ctx->md_ctx.md_info != NULL ) in mbedtls_hmac_drbg_free()
[all …]
Dpkcs12.c224 const mbedtls_md_info_t *md_info; in calculate_hashes() local
226 md_info = mbedtls_md_info_from_type( md_type ); in calculate_hashes()
227 if( md_info == NULL ) in calculate_hashes()
232 if( ( ret = mbedtls_md_setup( &md_ctx, md_info, 0 ) ) != 0 ) in calculate_hashes()
259 if( ( ret = mbedtls_md( md_info, hash_output, hlen, hash_output ) ) in calculate_hashes()
Dpkcs7.c604 const mbedtls_md_info_t *md_info; in mbedtls_pkcs7_data_or_hash_verify() local
641 md_info = mbedtls_md_info_from_type( md_alg ); in mbedtls_pkcs7_data_or_hash_verify()
642 if( md_info == NULL ) in mbedtls_pkcs7_data_or_hash_verify()
648 hash = mbedtls_calloc( mbedtls_md_get_size( md_info ), 1 ); in mbedtls_pkcs7_data_or_hash_verify()
655 if( datalen != mbedtls_md_get_size( md_info )) in mbedtls_pkcs7_data_or_hash_verify()
662 ret = mbedtls_md( md_info, data, datalen, hash ); in mbedtls_pkcs7_data_or_hash_verify()
672 mbedtls_md_get_size( md_info ), in mbedtls_pkcs7_data_or_hash_verify()
/external/mbedtls/programs/hash/
Dgeneric_sum.c40 static int generic_wrapper( const mbedtls_md_info_t *md_info, char *filename, unsigned char *sum ) in generic_wrapper() argument
42 int ret = mbedtls_md_file( md_info, filename, sum ); in generic_wrapper()
53 static int generic_print( const mbedtls_md_info_t *md_info, char *filename ) in generic_print() argument
58 if( generic_wrapper( md_info, filename, sum ) != 0 ) in generic_print()
61 for( i = 0; i < mbedtls_md_get_size( md_info ); i++ ) in generic_print()
68 static int generic_check( const mbedtls_md_info_t *md_info, char *filename ) in generic_check() argument
101 if( n < (size_t) 2 * mbedtls_md_get_size( md_info ) + 4 ) in generic_check()
103 mbedtls_printf("No '%s' hash found on line.\n", mbedtls_md_get_name( md_info )); in generic_check()
107 …if( line[2 * mbedtls_md_get_size( md_info )] != ' ' || line[2 * mbedtls_md_get_size( md_info ) + 1… in generic_check()
109 mbedtls_printf("No '%s' hash found on line.\n", mbedtls_md_get_name( md_info )); in generic_check()
[all …]
/external/openthread/third_party/mbedtls/repo/programs/hash/
Dgeneric_sum.c54 static int generic_wrapper( const mbedtls_md_info_t *md_info, char *filename, unsigned char *sum ) in generic_wrapper() argument
56 int ret = mbedtls_md_file( md_info, filename, sum ); in generic_wrapper()
67 static int generic_print( const mbedtls_md_info_t *md_info, char *filename ) in generic_print() argument
72 if( generic_wrapper( md_info, filename, sum ) != 0 ) in generic_print()
75 for( i = 0; i < mbedtls_md_get_size( md_info ); i++ ) in generic_print()
82 static int generic_check( const mbedtls_md_info_t *md_info, char *filename ) in generic_check() argument
115 if( n < (size_t) 2 * mbedtls_md_get_size( md_info ) + 4 ) in generic_check()
117 mbedtls_printf("No '%s' hash found on line.\n", mbedtls_md_get_name( md_info )); in generic_check()
121 …if( line[2 * mbedtls_md_get_size( md_info )] != ' ' || line[2 * mbedtls_md_get_size( md_info ) + 1… in generic_check()
123 mbedtls_printf("No '%s' hash found on line.\n", mbedtls_md_get_name( md_info )); in generic_check()
[all …]
/external/openthread/third_party/mbedtls/repo/library/
Dmd.c272 if( ctx == NULL || ctx->md_info == NULL ) in mbedtls_md_free()
277 switch( ctx->md_info->type ) in mbedtls_md_free()
328 2 * ctx->md_info->block_size ); in mbedtls_md_free()
338 if( dst == NULL || dst->md_info == NULL || in mbedtls_md_clone()
339 src == NULL || src->md_info == NULL || in mbedtls_md_clone()
340 dst->md_info != src->md_info ) in mbedtls_md_clone()
345 switch( src->md_info->type ) in mbedtls_md_clone()
394 int mbedtls_md_init_ctx( mbedtls_md_context_t *ctx, const mbedtls_md_info_t *md_info ) in mbedtls_md_init_ctx() argument
396 return mbedtls_md_setup( ctx, md_info, 1 ); in mbedtls_md_init_ctx()
409 int mbedtls_md_setup( mbedtls_md_context_t *ctx, const mbedtls_md_info_t *md_info, int hmac ) in mbedtls_md_setup() argument
[all …]
Decjpake.c61 ctx->md_info = NULL; in mbedtls_ecjpake_init()
84 ctx->md_info = NULL; in mbedtls_ecjpake_free()
117 if( ( ctx->md_info = mbedtls_md_info_from_type( hash ) ) == NULL ) in mbedtls_ecjpake_setup()
138 if( ctx->md_info == NULL || in mbedtls_ecjpake_check()
185 static int ecjpake_hash( const mbedtls_md_info_t *md_info, in ecjpake_hash() argument
219 MBEDTLS_MPI_CHK( mbedtls_md( md_info, buf, p - buf, hash ) ); in ecjpake_hash()
223 mbedtls_md_get_size( md_info ) ) ); in ecjpake_hash()
233 static int ecjpake_zkp_read( const mbedtls_md_info_t *md_info, in ecjpake_zkp_read() argument
283 MBEDTLS_MPI_CHK( ecjpake_hash( md_info, grp, pf, G, &V, X, id, &h ) ); in ecjpake_zkp_read()
305 static int ecjpake_zkp_write( const mbedtls_md_info_t *md_info, in ecjpake_zkp_write() argument
[all …]
Dhmac_drbg.c66 size_t md_len = mbedtls_md_get_size( ctx->md_ctx.md_info ); in mbedtls_hmac_drbg_update_ret()
120 const mbedtls_md_info_t * md_info, in mbedtls_hmac_drbg_seed_buf() argument
125 if( ( ret = mbedtls_md_setup( &ctx->md_ctx, md_info, 1 ) ) != 0 ) in mbedtls_hmac_drbg_seed_buf()
138 mbedtls_md_get_size( md_info ) ) ) != 0 ) in mbedtls_hmac_drbg_seed_buf()
140 memset( ctx->V, 0x01, mbedtls_md_get_size( md_info ) ); in mbedtls_hmac_drbg_seed_buf()
245 const mbedtls_md_info_t * md_info, in mbedtls_hmac_drbg_seed() argument
254 if( ( ret = mbedtls_md_setup( &ctx->md_ctx, md_info, 1 ) ) != 0 ) in mbedtls_hmac_drbg_seed()
262 md_size = mbedtls_md_get_size( md_info ); in mbedtls_hmac_drbg_seed()
334 size_t md_len = mbedtls_md_get_size( ctx->md_ctx.md_info ); in mbedtls_hmac_drbg_random_with_add()
430 if( ctx->md_ctx.md_info != NULL ) in mbedtls_hmac_drbg_free()
[all …]
Drsa.c1103 hlen = mbedtls_md_get_size( md_ctx->md_info ); in mgf_mask()
1155 const mbedtls_md_info_t *md_info; in mbedtls_rsa_rsaes_oaep_encrypt() local
1171 md_info = mbedtls_md_info_from_type( (mbedtls_md_type_t) ctx->hash_id ); in mbedtls_rsa_rsaes_oaep_encrypt()
1172 if( md_info == NULL ) in mbedtls_rsa_rsaes_oaep_encrypt()
1176 hlen = mbedtls_md_get_size( md_info ); in mbedtls_rsa_rsaes_oaep_encrypt()
1193 if( ( ret = mbedtls_md( md_info, label, label_len, p ) ) != 0 ) in mbedtls_rsa_rsaes_oaep_encrypt()
1202 if( ( ret = mbedtls_md_setup( &md_ctx, md_info, 0 ) ) != 0 ) in mbedtls_rsa_rsaes_oaep_encrypt()
1355 const mbedtls_md_info_t *md_info; in mbedtls_rsa_rsaes_oaep_decrypt() local
1377 md_info = mbedtls_md_info_from_type( (mbedtls_md_type_t) ctx->hash_id ); in mbedtls_rsa_rsaes_oaep_decrypt()
1378 if( md_info == NULL ) in mbedtls_rsa_rsaes_oaep_decrypt()
[all …]
Dpkcs12.c275 const mbedtls_md_info_t *md_info; in mbedtls_pkcs12_derivation() local
291 md_info = mbedtls_md_info_from_type( md_type ); in mbedtls_pkcs12_derivation()
292 if( md_info == NULL ) in mbedtls_pkcs12_derivation()
297 if( ( ret = mbedtls_md_setup( &md_ctx, md_info, 0 ) ) != 0 ) in mbedtls_pkcs12_derivation()
299 hlen = mbedtls_md_get_size( md_info ); in mbedtls_pkcs12_derivation()
346 if( ( ret = mbedtls_md( md_info, hash_output, hlen, hash_output ) ) != 0 ) in mbedtls_pkcs12_derivation()
Dpkcs5.c121 const mbedtls_md_info_t *md_info; in mbedtls_pkcs5_pbes2() local
156 md_info = mbedtls_md_info_from_type( md_type ); in mbedtls_pkcs5_pbes2()
157 if( md_info == NULL ) in mbedtls_pkcs5_pbes2()
190 if( ( ret = mbedtls_md_setup( &md_ctx, md_info, 1 ) ) != 0 ) in mbedtls_pkcs5_pbes2()
229 unsigned char md_size = mbedtls_md_get_size( ctx->md_info ); in mbedtls_pkcs5_pbkdf2_hmac()
Dpkcs11.c184 const mbedtls_md_info_t *md_info = mbedtls_md_info_from_type( md_alg ); in mbedtls_pkcs11_sign() local
185 if( md_info == NULL ) in mbedtls_pkcs11_sign()
191 hashlen = mbedtls_md_get_size( md_info ); in mbedtls_pkcs11_sign()
/external/mbedtls/tests/suites/
Dtest_suite_md.function110 void md_info( int md_type, char * md_name, int md_size )
112 const mbedtls_md_info_t *md_info;
116 md_info = mbedtls_md_info_from_type( md_type );
117 TEST_ASSERT( md_info != NULL );
118 TEST_ASSERT( md_info == mbedtls_md_info_from_string( md_name ) );
120 TEST_ASSERT( mbedtls_md_get_type( md_info ) == (mbedtls_md_type_t) md_type );
121 TEST_ASSERT( mbedtls_md_get_size( md_info ) == (unsigned char) md_size );
122 TEST_ASSERT( strcmp( mbedtls_md_get_name( md_info ), md_name ) == 0 );
139 const mbedtls_md_info_t *md_info = NULL;
147 md_info = mbedtls_md_info_from_string(md_name);
[all …]
Dtest_suite_hmac_drbg.function37 const mbedtls_md_info_t *md_info;
51 md_info = mbedtls_md_info_from_type( md_alg );
52 TEST_ASSERT( md_info != NULL );
53 if( mbedtls_md_get_size( md_info ) <= 20 )
55 else if( mbedtls_md_get_size( md_info ) <= 28 )
64 TEST_ASSERT( mbedtls_hmac_drbg_seed( &ctx, md_info, mbedtls_test_entropy_func, &entropy,
128 const mbedtls_md_info_t *md_info;
133 md_info = mbedtls_md_info_from_type( md_alg );
134 TEST_ASSERT( md_info != NULL );
136 TEST_ASSERT( mbedtls_hmac_drbg_seed( &ctx, md_info,
[all …]
Dtest_suite_constant_time_hmac.function26 const mbedtls_md_info_t *md_info;
54 md_info = mbedtls_md_info_from_type( hash );
55 TEST_ASSERT( md_info != NULL );
56 out_len = mbedtls_md_get_size( md_info );
72 TEST_EQUAL( 0, mbedtls_md_setup( &ctx, md_info, 1 ) );
73 TEST_EQUAL( 0, mbedtls_md_setup( &ref_ctx, md_info, 1 ) );
Dtest_suite_pkcs7.function51 const mbedtls_md_info_t *md_info;
90 md_info = mbedtls_md_info_from_type( md_alg );
92 res = mbedtls_md( md_info, data, datalen, hash );
123 const mbedtls_md_info_t *md_info;
169 md_info = mbedtls_md_info_from_type( md_alg );
171 res = mbedtls_md( md_info, data, datalen, hash );
/external/openthread/third_party/mbedtls/repo/tests/suites/
Dtest_suite_md.function106 void md_info( int md_type, char * md_name, int md_size )
108 const mbedtls_md_info_t *md_info;
112 md_info = mbedtls_md_info_from_type( md_type );
113 TEST_ASSERT( md_info != NULL );
114 TEST_ASSERT( md_info == mbedtls_md_info_from_string( md_name ) );
116 TEST_ASSERT( mbedtls_md_get_type( md_info ) == (mbedtls_md_type_t) md_type );
117 TEST_ASSERT( mbedtls_md_get_size( md_info ) == (unsigned char) md_size );
118 TEST_ASSERT( strcmp( mbedtls_md_get_name( md_info ), md_name ) == 0 );
135 const mbedtls_md_info_t *md_info = NULL;
143 md_info = mbedtls_md_info_from_string(md_name);
[all …]
Dtest_suite_hmac_drbg.function37 const mbedtls_md_info_t *md_info;
51 md_info = mbedtls_md_info_from_type( md_alg );
52 TEST_ASSERT( md_info != NULL );
53 if( mbedtls_md_get_size( md_info ) <= 20 )
55 else if( mbedtls_md_get_size( md_info ) <= 28 )
64 TEST_ASSERT( mbedtls_hmac_drbg_seed( &ctx, md_info, mbedtls_test_entropy_func, &entropy,
128 const mbedtls_md_info_t *md_info;
133 md_info = mbedtls_md_info_from_type( md_alg );
134 TEST_ASSERT( md_info != NULL );
136 TEST_ASSERT( mbedtls_hmac_drbg_seed( &ctx, md_info,
[all …]
Dtest_suite_ecdsa.function349 const mbedtls_md_info_t *md_info;
361 md_info = mbedtls_md_info_from_type( md_alg );
362 TEST_ASSERT( md_info != NULL );
363 hlen = mbedtls_md_get_size( md_info );
364 TEST_ASSERT( mbedtls_md( md_info, (const unsigned char *) msg,
580 const mbedtls_md_info_t *md_info;
590 md_info = mbedtls_md_info_from_type( md_alg );
591 TEST_ASSERT( md_info != NULL );
593 hlen = mbedtls_md_get_size( md_info );
594 TEST_ASSERT( mbedtls_md( md_info,
/external/arm-trusted-firmware/drivers/auth/mbedtls/
Dmbedtls_crypto.c71 const mbedtls_md_info_t *md_info; in verify_signature() local
111 md_info = mbedtls_md_info_from_type(md_alg); in verify_signature()
112 if (md_info == NULL) { in verify_signature()
117 rc = mbedtls_md(md_info, p, data_len, hash); in verify_signature()
125 mbedtls_md_get_size(md_info), in verify_signature()
153 const mbedtls_md_info_t *md_info; in verify_hash() local
179 md_info = mbedtls_md_info_from_type(md_alg); in verify_hash()
180 if (md_info == NULL) { in verify_hash()
191 if (len != mbedtls_md_get_size(md_info)) { in verify_hash()
198 rc = mbedtls_md(md_info, p, data_len, data_hash); in verify_hash()
[all …]
/external/openthread/third_party/mbedtls/repo/include/mbedtls/
Dmd.h98 const mbedtls_md_info_t *md_info; member
191 int mbedtls_md_init_ctx( mbedtls_md_context_t *ctx, const mbedtls_md_info_t *md_info ) MBEDTLS_DEPR…
215 int mbedtls_md_setup( mbedtls_md_context_t *ctx, const mbedtls_md_info_t *md_info, int hmac );
249 unsigned char mbedtls_md_get_size( const mbedtls_md_info_t *md_info );
260 mbedtls_md_type_t mbedtls_md_get_type( const mbedtls_md_info_t *md_info );
271 const char *mbedtls_md_get_name( const mbedtls_md_info_t *md_info );
348 int mbedtls_md( const mbedtls_md_info_t *md_info, const unsigned char *input, size_t ilen,
370 int mbedtls_md_file( const mbedtls_md_info_t *md_info, const char *path,
481 int mbedtls_md_hmac( const mbedtls_md_info_t *md_info, const unsigned char *key, size_t keylen,
/external/mbedtls/include/mbedtls/
Dmd.h96 const mbedtls_md_info_t *MBEDTLS_PRIVATE(md_info);
199 int mbedtls_md_setup( mbedtls_md_context_t *ctx, const mbedtls_md_info_t *md_info, int hmac );
233 unsigned char mbedtls_md_get_size( const mbedtls_md_info_t *md_info );
244 mbedtls_md_type_t mbedtls_md_get_type( const mbedtls_md_info_t *md_info );
255 const char *mbedtls_md_get_name( const mbedtls_md_info_t *md_info );
332 int mbedtls_md( const mbedtls_md_info_t *md_info, const unsigned char *input, size_t ilen,
354 int mbedtls_md_file( const mbedtls_md_info_t *md_info, const char *path,
465 int mbedtls_md_hmac( const mbedtls_md_info_t *md_info, const unsigned char *key, size_t keylen,
/external/openthread/third_party/mbedtls/repo/programs/aes/
Dcrypt_and_hash.c102 const mbedtls_md_info_t *md_info; in main() local
139 md_info = mbedtls_md_info_from_type( *list ); in main()
140 mbedtls_printf( " %s\n", mbedtls_md_get_name( md_info ) ); in main()
193 md_info = mbedtls_md_info_from_string( argv[5] ); in main()
194 if( md_info == NULL ) in main()
200 if( mbedtls_md_setup( &md_ctx, md_info, 1 ) != 0 ) in main()
435 … if( fwrite( digest, 1, mbedtls_md_get_size( md_info ), fout ) != mbedtls_md_get_size( md_info ) ) in main()
437 mbedtls_fprintf( stderr, "fwrite(%d bytes) failed\n", mbedtls_md_get_size( md_info ) ); in main()
453 if( filesize < 16 + mbedtls_md_get_size( md_info ) ) in main()
469 ( ( filesize - mbedtls_md_get_size( md_info ) ) % in main()
[all …]
/external/mbedtls/programs/aes/
Dcrypt_and_hash.c88 const mbedtls_md_info_t *md_info; in main() local
125 md_info = mbedtls_md_info_from_type( *list ); in main()
126 mbedtls_printf( " %s\n", mbedtls_md_get_name( md_info ) ); in main()
178 md_info = mbedtls_md_info_from_string( argv[5] ); in main()
179 if( md_info == NULL ) in main()
185 if( mbedtls_md_setup( &md_ctx, md_info, 1 ) != 0 ) in main()
422 … if( fwrite( digest, 1, mbedtls_md_get_size( md_info ), fout ) != mbedtls_md_get_size( md_info ) ) in main()
424 mbedtls_fprintf( stderr, "fwrite(%d bytes) failed\n", mbedtls_md_get_size( md_info ) ); in main()
440 if( filesize < 16 + mbedtls_md_get_size( md_info ) ) in main()
456 ( ( filesize - mbedtls_md_get_size( md_info ) ) % in main()
[all …]

123