/third_party/mbedtls/programs/hash/ |
D | generic_sum.c | 50 static int generic_wrapper( const mbedtls_md_info_t *md_info, char *filename, unsigned char *sum ) in generic_wrapper() argument 52 int ret = mbedtls_md_file( md_info, filename, sum ); in generic_wrapper() 63 static int generic_print( const mbedtls_md_info_t *md_info, char *filename ) in generic_print() argument 68 if( generic_wrapper( md_info, filename, sum ) != 0 ) in generic_print() 71 for( i = 0; i < mbedtls_md_get_size( md_info ); i++ ) in generic_print() 78 static int generic_check( const mbedtls_md_info_t *md_info, char *filename ) in generic_check() argument 111 if( n < (size_t) 2 * mbedtls_md_get_size( md_info ) + 4 ) in generic_check() 113 mbedtls_printf("No '%s' hash found on line.\n", mbedtls_md_get_name( md_info )); in generic_check() 117 …if( line[2 * mbedtls_md_get_size( md_info )] != ' ' || line[2 * mbedtls_md_get_size( md_info ) + 1… in generic_check() 119 mbedtls_printf("No '%s' hash found on line.\n", mbedtls_md_get_name( md_info )); in generic_check() [all …]
|
/third_party/mbedtls/library/ |
D | md.c | 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() [all …]
|
D | ssl_tls13_keys.c | 143 const mbedtls_md_info_t *md_info; in mbedtls_ssl_tls13_hkdf_expand_label() local 167 md_info = mbedtls_md_info_from_type( hash_alg ); in mbedtls_ssl_tls13_hkdf_expand_label() 168 if( md_info == NULL ) in mbedtls_ssl_tls13_hkdf_expand_label() 177 return( mbedtls_hkdf_expand( md_info, in mbedtls_ssl_tls13_hkdf_expand_label() 257 const mbedtls_md_info_t *md_info; in mbedtls_ssl_tls13_derive_secret() local 258 md_info = mbedtls_md_info_from_type( hash_alg ); in mbedtls_ssl_tls13_derive_secret() 259 if( md_info == NULL ) in mbedtls_ssl_tls13_derive_secret() 264 ret = mbedtls_md( md_info, ctx, ctx_len, hashed_context ); in mbedtls_ssl_tls13_derive_secret() 267 ctx_len = mbedtls_md_get_size( md_info ); in mbedtls_ssl_tls13_derive_secret() 301 const mbedtls_md_info_t *md_info; in mbedtls_ssl_tls13_evolve_secret() local [all …]
|
D | ecjpake.c | 61 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() 152 if( ctx->md_info == NULL || in mbedtls_ecjpake_check() 199 static int ecjpake_hash( const mbedtls_md_info_t *md_info, in ecjpake_hash() argument 233 MBEDTLS_MPI_CHK( mbedtls_md( md_info, buf, p - buf, hash ) ); in ecjpake_hash() 237 mbedtls_md_get_size( md_info ) ) ); in ecjpake_hash() 247 static int ecjpake_zkp_read( const mbedtls_md_info_t *md_info, in ecjpake_zkp_read() argument 297 MBEDTLS_MPI_CHK( ecjpake_hash( md_info, grp, pf, G, &V, X, id, &h ) ); in ecjpake_zkp_read() 319 static int ecjpake_zkp_write( const mbedtls_md_info_t *md_info, in ecjpake_zkp_write() argument [all …]
|
D | hmac_drbg.c | 66 size_t md_len = mbedtls_md_get_size( ctx->md_ctx.md_info ); in mbedtls_hmac_drbg_update() 111 const mbedtls_md_info_t * md_info, in mbedtls_hmac_drbg_seed_buf() argument 116 if( ( ret = mbedtls_md_setup( &ctx->md_ctx, md_info, 1 ) ) != 0 ) in mbedtls_hmac_drbg_seed_buf() 129 mbedtls_md_get_size( md_info ) ) ) != 0 ) in mbedtls_hmac_drbg_seed_buf() 131 memset( ctx->V, 0x01, mbedtls_md_get_size( md_info ) ); in mbedtls_hmac_drbg_seed_buf() 236 const mbedtls_md_info_t * md_info, in mbedtls_hmac_drbg_seed() argument 245 if( ( ret = mbedtls_md_setup( &ctx->md_ctx, md_info, 1 ) ) != 0 ) in mbedtls_hmac_drbg_seed() 253 md_size = mbedtls_md_get_size( md_info ); in mbedtls_hmac_drbg_seed() 325 size_t md_len = mbedtls_md_get_size( ctx->md_ctx.md_info ); in mbedtls_hmac_drbg_random_with_add() 421 if( ctx->md_ctx.md_info != NULL ) in mbedtls_hmac_drbg_free() [all …]
|
D | rsa.c | 507 const mbedtls_md_info_t *md_info; in mbedtls_rsa_set_padding() local 509 md_info = mbedtls_md_info_from_type( hash_id ); in mbedtls_rsa_set_padding() 510 if( md_info == NULL ) in mbedtls_rsa_set_padding() 1114 hlen = mbedtls_md_get_size( md_ctx->md_info ); in mgf_mask() 1165 const mbedtls_md_info_t *md_info; in mbedtls_rsa_rsaes_oaep_encrypt() local 1176 md_info = mbedtls_md_info_from_type( (mbedtls_md_type_t) ctx->hash_id ); in mbedtls_rsa_rsaes_oaep_encrypt() 1177 if( md_info == NULL ) in mbedtls_rsa_rsaes_oaep_encrypt() 1181 hlen = mbedtls_md_get_size( md_info ); in mbedtls_rsa_rsaes_oaep_encrypt() 1198 if( ( ret = mbedtls_md( md_info, label, label_len, p ) ) != 0 ) in mbedtls_rsa_rsaes_oaep_encrypt() 1207 if( ( ret = mbedtls_md_setup( &md_ctx, md_info, 0 ) ) != 0 ) in mbedtls_rsa_rsaes_oaep_encrypt() [all …]
|
D | pkcs12.c | 230 const mbedtls_md_info_t *md_info; in mbedtls_pkcs12_derivation() local 246 md_info = mbedtls_md_info_from_type( md_type ); in mbedtls_pkcs12_derivation() 247 if( md_info == NULL ) in mbedtls_pkcs12_derivation() 252 if( ( ret = mbedtls_md_setup( &md_ctx, md_info, 0 ) ) != 0 ) in mbedtls_pkcs12_derivation() 254 hlen = mbedtls_md_get_size( md_info ); in mbedtls_pkcs12_derivation() 301 if( ( ret = mbedtls_md( md_info, hash_output, hlen, hash_output ) ) != 0 ) in mbedtls_pkcs12_derivation()
|
D | pkcs5.c | 121 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()
|
D | psa_crypto_random_impl.h | 193 const mbedtls_md_info_t *md_info = in mbedtls_psa_drbg_seed() 196 md_info, in mbedtls_psa_drbg_seed()
|
D | psa_crypto_rsa.c | 328 const mbedtls_md_info_t *md_info = mbedtls_md_info_from_psa( hash_alg ); in psa_rsa_decode_md_type() local 329 *md_alg = mbedtls_md_get_type( md_info ); in psa_rsa_decode_md_type() 342 if( md_info == NULL ) in psa_rsa_decode_md_type() 344 if( mbedtls_md_get_size( md_info ) != hash_length ) in psa_rsa_decode_md_type()
|
/third_party/mbedtls/tests/suites/ |
D | test_suite_md.function | 106 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 …]
|
D | test_suite_hmac_drbg.function | 37 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 …]
|
D | test_suite_pkcs1_v21.function | 126 const mbedtls_md_info_t *md_info = mbedtls_md_info_from_type( digest ); 156 if( md_info != NULL ) 157 TEST_ASSERT( mbedtls_md( md_info, message_str->x, message_str->len, hash_result ) == 0 ); 163 digest, mbedtls_md_get_size( md_info ), hash_result, 176 digest, mbedtls_md_get_size( md_info ), hash_result, 196 const mbedtls_md_info_t *md_info = mbedtls_md_info_from_type( digest ); 215 if( md_info != NULL ) 216 TEST_ASSERT( mbedtls_md( md_info, message_str->x, message_str->len, hash_result ) == 0 ); 218 …TEST_ASSERT( mbedtls_rsa_pkcs1_verify( &ctx, digest, mbedtls_md_get_size( md_info ), hash_result, … 255 const mbedtls_md_info_t *md_info = [all …]
|
D | test_suite_ecdsa.function | 152 const mbedtls_md_info_t *md_info; 164 md_info = mbedtls_md_info_from_type( md_alg ); 165 TEST_ASSERT( md_info != NULL ); 166 hlen = mbedtls_md_get_size( md_info ); 167 TEST_ASSERT( mbedtls_md( md_info, (const unsigned char *) msg, 383 const mbedtls_md_info_t *md_info; 393 md_info = mbedtls_md_info_from_type( md_alg ); 394 TEST_ASSERT( md_info != NULL ); 396 hlen = mbedtls_md_get_size( md_info ); 397 TEST_ASSERT( mbedtls_md( md_info,
|
D | test_suite_pkcs1_v15.function | 272 const mbedtls_md_info_t *md_info = mbedtls_md_info_from_type( digest ); 302 if( md_info != NULL ) 303 TEST_ASSERT( mbedtls_md( md_info, message_str->x, message_str->len, hash_result ) == 0 ); 307 digest, mbedtls_md_get_size( md_info ), hash_result, 330 const mbedtls_md_info_t *md_info = mbedtls_md_info_from_type( digest ); 348 if( md_info != NULL ) 349 TEST_ASSERT( mbedtls_md( md_info, message_str->x, message_str->len, hash_result ) == 0 ); 351 …TEST_ASSERT( mbedtls_rsa_pkcs1_verify( &ctx, digest, mbedtls_md_get_size( md_info ), hash_result, …
|
D | test_suite_random.function | 67 const mbedtls_md_info_t *md_info = mbedtls_md_info_from_type( md_type ); 72 TEST_EQUAL( 0, mbedtls_hmac_drbg_seed( &drbg, md_info, 83 TEST_EQUAL( 0, mbedtls_hmac_drbg_seed( &drbg, md_info,
|
D | test_suite_x509write.function | 36 const mbedtls_md_info_t *md_info; 48 md_info = mbedtls_md_info_from_type( csr.sig_md ); 49 if( mbedtls_md( md_info, csr.cri.p, csr.cri.len, hash ) != 0 ) 57 csr.sig_md, hash, mbedtls_md_get_size( md_info ),
|
D | test_suite_entropy.function | 432 const mbedtls_md_info_t *md_info = 435 const mbedtls_md_info_t *md_info = 481 TEST_ASSERT( mbedtls_md_setup( &accumulator, md_info, 0 ) == 0 ); 495 TEST_ASSERT( mbedtls_md( md_info, buf, MBEDTLS_ENTROPY_BLOCK_SIZE, 510 TEST_ASSERT( mbedtls_md( md_info, buf, MBEDTLS_ENTROPY_BLOCK_SIZE,
|
/third_party/mbedtls/include/mbedtls/ |
D | md.h | 100 const mbedtls_md_info_t *MBEDTLS_PRIVATE(md_info); 190 int mbedtls_md_setup( mbedtls_md_context_t *ctx, const mbedtls_md_info_t *md_info, int hmac ); 224 unsigned char mbedtls_md_get_size( const mbedtls_md_info_t *md_info ); 235 mbedtls_md_type_t mbedtls_md_get_type( const mbedtls_md_info_t *md_info ); 246 const char *mbedtls_md_get_name( const mbedtls_md_info_t *md_info ); 323 int mbedtls_md( const mbedtls_md_info_t *md_info, const unsigned char *input, size_t ilen, 345 int mbedtls_md_file( const mbedtls_md_info_t *md_info, const char *path, 456 int mbedtls_md_hmac( const mbedtls_md_info_t *md_info, const unsigned char *key, size_t keylen,
|
D | hmac_drbg.h | 200 const mbedtls_md_info_t * md_info, 235 const mbedtls_md_info_t * md_info,
|
/third_party/mbedtls/programs/aes/ |
D | crypt_and_hash.c | 98 const mbedtls_md_info_t *md_info; in main() local 135 md_info = mbedtls_md_info_from_type( *list ); in main() 136 mbedtls_printf( " %s\n", mbedtls_md_get_name( md_info ) ); in main() 189 md_info = mbedtls_md_info_from_string( argv[5] ); in main() 190 if( md_info == NULL ) in main() 196 if( mbedtls_md_setup( &md_ctx, md_info, 1 ) != 0 ) in main() 433 … if( fwrite( digest, 1, mbedtls_md_get_size( md_info ), fout ) != mbedtls_md_get_size( md_info ) ) in main() 435 mbedtls_fprintf( stderr, "fwrite(%d bytes) failed\n", mbedtls_md_get_size( md_info ) ); in main() 451 if( filesize < 16 + mbedtls_md_get_size( md_info ) ) in main() 467 ( ( filesize - mbedtls_md_get_size( md_info ) ) % in main() [all …]
|
/third_party/lwip/src/apps/snmp/ |
D | snmpv3_mbedtls.c | 57 const mbedtls_md_info_t *md_info; in snmpv3_auth() local 63 md_info = mbedtls_md_info_from_type(MBEDTLS_MD_MD5); in snmpv3_auth() 66 md_info = mbedtls_md_info_from_type(MBEDTLS_MD_SHA1); in snmpv3_auth() 73 if (mbedtls_md_setup(&ctx, md_info, 1) != 0) { in snmpv3_auth()
|
/third_party/mbedtls/programs/x509/ |
D | cert_req.c | 215 const mbedtls_md_info_t *md_info = in main() local 217 if( md_info == NULL ) in main() 222 opt.md_alg = mbedtls_md_get_type( md_info ); in main()
|
/third_party/mbedtls/programs/test/ |
D | benchmark.c | 941 const mbedtls_md_info_t *md_info; in main() local 946 if( ( md_info = mbedtls_md_info_from_type( MBEDTLS_MD_SHA1 ) ) == NULL ) in main() 949 if( mbedtls_hmac_drbg_seed( &hmac_drbg, md_info, myrand, NULL, NULL, 0 ) != 0 ) in main() 954 if( mbedtls_hmac_drbg_seed( &hmac_drbg, md_info, myrand, NULL, NULL, 0 ) != 0 ) in main() 963 if( ( md_info = mbedtls_md_info_from_type( MBEDTLS_MD_SHA256 ) ) == NULL ) in main() 966 if( mbedtls_hmac_drbg_seed( &hmac_drbg, md_info, myrand, NULL, NULL, 0 ) != 0 ) in main() 971 if( mbedtls_hmac_drbg_seed( &hmac_drbg, md_info, myrand, NULL, NULL, 0 ) != 0 ) in main()
|
/third_party/mbedtls/programs/ssl/ |
D | ssl_context_info.c | 627 const mbedtls_md_info_t *md_info; in print_deserialized_ssl_session() local 642 md_info = mbedtls_md_info_from_type( ciphersuite_info->mac ); in print_deserialized_ssl_session() 643 if( md_info == NULL ) in print_deserialized_ssl_session() 649 printf( "\tMessage-Digest : %s\n", mbedtls_md_get_name( md_info ) ); in print_deserialized_ssl_session()
|