Home
last modified time | relevance | path

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

/net-tools-3.6.0/mbedtls-2.4.0/library/
Dmd.c188 if( ctx == NULL || ctx->md_info == NULL ) in mbedtls_md_free()
192 ctx->md_info->ctx_free_func( ctx->md_ctx ); in mbedtls_md_free()
196 mbedtls_zeroize( ctx->hmac_ctx, 2 * ctx->md_info->block_size ); in mbedtls_md_free()
206 if( dst == NULL || dst->md_info == NULL || in mbedtls_md_clone()
207 src == NULL || src->md_info == NULL || in mbedtls_md_clone()
208 dst->md_info != src->md_info ) in mbedtls_md_clone()
213 dst->md_info->clone_func( dst->md_ctx, src->md_ctx ); in mbedtls_md_clone()
219 int mbedtls_md_init_ctx( mbedtls_md_context_t *ctx, const mbedtls_md_info_t *md_info ) in mbedtls_md_init_ctx() argument
221 return mbedtls_md_setup( ctx, md_info, 1 ); in mbedtls_md_init_ctx()
225 int mbedtls_md_setup( mbedtls_md_context_t *ctx, const mbedtls_md_info_t *md_info, int hmac ) in mbedtls_md_setup() argument
[all …]
Dhmac_drbg.c76 size_t md_len = mbedtls_md_get_size( ctx->md_ctx.md_info ); in mbedtls_hmac_drbg_update()
102 const mbedtls_md_info_t * md_info, in mbedtls_hmac_drbg_seed_buf() argument
107 if( ( ret = mbedtls_md_setup( &ctx->md_ctx, md_info, 1 ) ) != 0 ) in mbedtls_hmac_drbg_seed_buf()
115 mbedtls_md_hmac_starts( &ctx->md_ctx, ctx->V, mbedtls_md_get_size( md_info ) ); in mbedtls_hmac_drbg_seed_buf()
116 memset( ctx->V, 0x01, mbedtls_md_get_size( md_info ) ); in mbedtls_hmac_drbg_seed_buf()
168 const mbedtls_md_info_t * md_info, in mbedtls_hmac_drbg_seed() argument
177 if( ( ret = mbedtls_md_setup( &ctx->md_ctx, md_info, 1 ) ) != 0 ) in mbedtls_hmac_drbg_seed()
180 md_size = mbedtls_md_get_size( md_info ); in mbedtls_hmac_drbg_seed()
255 size_t md_len = mbedtls_md_get_size( ctx->md_ctx.md_info ); in mbedtls_hmac_drbg_random_with_add()
473 const mbedtls_md_info_t *md_info = mbedtls_md_info_from_type( MBEDTLS_MD_SHA1 ); in mbedtls_hmac_drbg_self_test() local
[all …]
Decjpake.c58 ctx->md_info = NULL; in mbedtls_ecjpake_init()
81 ctx->md_info = NULL; in mbedtls_ecjpake_free()
109 if( ( ctx->md_info = mbedtls_md_info_from_type( hash ) ) == NULL ) in mbedtls_ecjpake_setup()
128 if( ctx->md_info == NULL || in mbedtls_ecjpake_check()
178 static int ecjpake_hash( const mbedtls_md_info_t *md_info, in ecjpake_hash() argument
214 mbedtls_md( md_info, buf, p - buf, hash ); in ecjpake_hash()
218 mbedtls_md_get_size( md_info ) ) ); in ecjpake_hash()
228 static int ecjpake_zkp_read( const mbedtls_md_info_t *md_info, in ecjpake_zkp_read() argument
278 MBEDTLS_MPI_CHK( ecjpake_hash( md_info, grp, pf, G, &V, X, id, &h ) ); in ecjpake_zkp_read()
300 static int ecjpake_zkp_write( const mbedtls_md_info_t *md_info, in ecjpake_zkp_write() argument
[all …]
Drsa.c476 hlen = mbedtls_md_get_size( md_ctx->md_info ); in mgf_mask()
519 const mbedtls_md_info_t *md_info; in mbedtls_rsa_rsaes_oaep_encrypt() local
528 md_info = mbedtls_md_info_from_type( (mbedtls_md_type_t) ctx->hash_id ); in mbedtls_rsa_rsaes_oaep_encrypt()
529 if( md_info == NULL ) in mbedtls_rsa_rsaes_oaep_encrypt()
533 hlen = mbedtls_md_get_size( md_info ); in mbedtls_rsa_rsaes_oaep_encrypt()
550 mbedtls_md( md_info, label, label_len, p ); in mbedtls_rsa_rsaes_oaep_encrypt()
557 if( ( ret = mbedtls_md_setup( &md_ctx, md_info, 0 ) ) != 0 ) in mbedtls_rsa_rsaes_oaep_encrypt()
695 const mbedtls_md_info_t *md_info; in mbedtls_rsa_rsaes_oaep_decrypt() local
709 md_info = mbedtls_md_info_from_type( (mbedtls_md_type_t) ctx->hash_id ); in mbedtls_rsa_rsaes_oaep_decrypt()
710 if( md_info == NULL ) in mbedtls_rsa_rsaes_oaep_decrypt()
[all …]
Dpkcs12.c264 const mbedtls_md_info_t *md_info; in mbedtls_pkcs12_derivation() local
271 md_info = mbedtls_md_info_from_type( md_type ); in mbedtls_pkcs12_derivation()
272 if( md_info == NULL ) in mbedtls_pkcs12_derivation()
277 if( ( ret = mbedtls_md_setup( &md_ctx, md_info, 0 ) ) != 0 ) in mbedtls_pkcs12_derivation()
279 hlen = mbedtls_md_get_size( md_info ); in mbedtls_pkcs12_derivation()
313 if( ( ret = mbedtls_md( md_info, hash_output, hlen, hash_output ) ) != 0 ) in mbedtls_pkcs12_derivation()
Dpkcs5.c123 const mbedtls_md_info_t *md_info; in mbedtls_pkcs5_pbes2() local
157 md_info = mbedtls_md_info_from_type( md_type ); in mbedtls_pkcs5_pbes2()
158 if( md_info == NULL ) in mbedtls_pkcs5_pbes2()
191 if( ( ret = mbedtls_md_setup( &md_ctx, md_info, 1 ) ) != 0 ) in mbedtls_pkcs5_pbes2()
226 unsigned char md_size = mbedtls_md_get_size( ctx->md_info ); in mbedtls_pkcs5_pbkdf2_hmac()
Dpkcs11.c186 const mbedtls_md_info_t *md_info = mbedtls_md_info_from_type( md_alg ); in mbedtls_pkcs11_sign() local
187 if( md_info == NULL ) in mbedtls_pkcs11_sign()
193 hashlen = mbedtls_md_get_size( md_info ); in mbedtls_pkcs11_sign()
Dx509_crt.c1635 const mbedtls_md_info_t *md_info; in x509_crt_verifycrl() local
1671 md_info = mbedtls_md_info_from_type( crl_list->sig_md ); in x509_crt_verifycrl()
1672 if( md_info == NULL ) in x509_crt_verifycrl()
1681 mbedtls_md( md_info, crl_list->tbs.p, crl_list->tbs.len, hash ); in x509_crt_verifycrl()
1687 crl_list->sig_md, hash, mbedtls_md_get_size( md_info ), in x509_crt_verifycrl()
1906 const mbedtls_md_info_t *md_info; in x509_crt_verify_top() local
1925 md_info = mbedtls_md_info_from_type( child->sig_md ); in x509_crt_verify_top()
1926 if( md_info == NULL ) in x509_crt_verify_top()
1934 mbedtls_md( md_info, child->tbs.p, child->tbs.len, hash ); in x509_crt_verify_top()
1972 child->sig_md, hash, mbedtls_md_get_size( md_info ), in x509_crt_verify_top()
[all …]
Dpk.c162 const mbedtls_md_info_t *md_info; in pk_hashlen_helper() local
167 if( ( md_info = mbedtls_md_info_from_type( md_alg ) ) == NULL ) in pk_hashlen_helper()
170 *hash_len = mbedtls_md_get_size( md_info ); in pk_hashlen_helper()
Decdsa.c169 const mbedtls_md_info_t *md_info; in mbedtls_ecdsa_sign_det() local
172 if( ( md_info = mbedtls_md_info_from_type( md_alg ) ) == NULL ) in mbedtls_ecdsa_sign_det()
182 mbedtls_hmac_drbg_seed_buf( &rng_ctx, md_info, data, 2 * grp_len ); in mbedtls_ecdsa_sign_det()
Dx509.c823 const mbedtls_md_info_t *md_info, *mgf_md_info; in mbedtls_x509_sig_alg_gets() local
827 md_info = mbedtls_md_info_from_type( md_alg ); in mbedtls_x509_sig_alg_gets()
831 md_info ? mbedtls_md_get_name( md_info ) : "???", in mbedtls_x509_sig_alg_gets()
Dssl_tls.c279 const mbedtls_md_info_t *md_info; in tls1_prf() local
300 if( ( md_info = mbedtls_md_info_from_type( MBEDTLS_MD_MD5 ) ) == NULL ) in tls1_prf()
303 if( ( ret = mbedtls_md_setup( &md_ctx, md_info, 1 ) ) != 0 ) in tls1_prf()
331 if( ( md_info = mbedtls_md_info_from_type( MBEDTLS_MD_SHA1 ) ) == NULL ) in tls1_prf()
334 if( ( ret = mbedtls_md_setup( &md_ctx, md_info, 1 ) ) != 0 ) in tls1_prf()
377 const mbedtls_md_info_t *md_info; in tls_prf_generic() local
383 if( ( md_info = mbedtls_md_info_from_type( md_type ) ) == NULL ) in tls_prf_generic()
386 md_len = mbedtls_md_get_size( md_info ); in tls_prf_generic()
399 if ( ( ret = mbedtls_md_setup( &md_ctx, md_info, 1 ) ) != 0 ) in tls_prf_generic()
495 const mbedtls_md_info_t *md_info; in mbedtls_ssl_derive_keys() local
[all …]
Dssl_srv.c2944 const mbedtls_md_info_t *md_info = mbedtls_md_info_from_type( md_alg ); local
2958 if( ( ret = mbedtls_md_setup( &ctx, md_info, 0 ) ) != 0 )
/net-tools-3.6.0/mbedtls-2.4.0/programs/hash/
Dgeneric_sum.c50 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 …]
/net-tools-3.6.0/mbedtls-2.4.0/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;
144 md_info = mbedtls_md_info_from_string(md_name);
[all …]
Dtest_suite_hmac_drbg.function36 const mbedtls_md_info_t *md_info;
48 md_info = mbedtls_md_info_from_type( md_alg );
49 TEST_ASSERT( md_info != NULL );
53 TEST_ASSERT( mbedtls_hmac_drbg_seed( &ctx, md_info, mbedtls_entropy_func, &entropy,
114 const mbedtls_md_info_t *md_info;
119 md_info = mbedtls_md_info_from_type( md_alg );
120 TEST_ASSERT( md_info != NULL );
122 TEST_ASSERT( mbedtls_hmac_drbg_seed( &ctx, md_info, rnd_std_rand, NULL,
138 const mbedtls_md_info_t *md_info;
146 md_info = mbedtls_md_info_from_type( md_alg );
[all …]
Dtest_suite_ecdsa.function106 const mbedtls_md_info_t *md_info;
118 md_info = mbedtls_md_info_from_type( md_alg );
119 TEST_ASSERT( md_info != NULL );
120 hlen = mbedtls_md_get_size( md_info );
121 mbedtls_md( md_info, (const unsigned char *) msg, strlen( msg ), hash );
Dtest_suite_md.data9 md_info:MBEDTLS_MD_MD2:"MD2":16
13 md_info:MBEDTLS_MD_MD4:"MD4":16
17 md_info:MBEDTLS_MD_MD5:"MD5":16
21 md_info:MBEDTLS_MD_RIPEMD160:"RIPEMD160":20
25 md_info:MBEDTLS_MD_SHA1:"SHA1":20
29 md_info:MBEDTLS_MD_SHA224:"SHA224":28
33 md_info:MBEDTLS_MD_SHA256:"SHA256":32
37 md_info:MBEDTLS_MD_SHA384:"SHA384":48
41 md_info:MBEDTLS_MD_SHA512:"SHA512":64
/net-tools-3.6.0/mbedtls-2.4.0/include/mbedtls/
Dmd.h68 const mbedtls_md_info_t *md_info; member
141 int mbedtls_md_init_ctx( mbedtls_md_context_t *ctx, const mbedtls_md_info_t *md_info ) MBEDTLS_DEPR…
159 int mbedtls_md_setup( mbedtls_md_context_t *ctx, const mbedtls_md_info_t *md_info, int hmac );
185 unsigned char mbedtls_md_get_size( const mbedtls_md_info_t *md_info );
194 mbedtls_md_type_t mbedtls_md_get_type( const mbedtls_md_info_t *md_info );
203 const char *mbedtls_md_get_name( const mbedtls_md_info_t *md_info );
255 int mbedtls_md( const mbedtls_md_info_t *md_info, const unsigned char *input, size_t ilen,
270 int mbedtls_md_file( const mbedtls_md_info_t *md_info, const char *path,
343 int mbedtls_md_hmac( const mbedtls_md_info_t *md_info, const unsigned char *key, size_t keylen,
Dhmac_drbg.h134 const mbedtls_md_info_t * md_info,
154 const mbedtls_md_info_t * md_info,
Decjpake.h71 const mbedtls_md_info_t *md_info; /**< Hash to use */ member
/net-tools-3.6.0/mbedtls-2.4.0/programs/aes/
Dcrypt_and_hash.c90 const mbedtls_md_info_t *md_info; in main() local
127 md_info = mbedtls_md_info_from_type( *list ); in main()
128 mbedtls_printf( " %s\n", mbedtls_md_get_name( md_info ) ); in main()
181 md_info = mbedtls_md_info_from_string( argv[5] ); in main()
182 if( md_info == NULL ) in main()
188 if( mbedtls_md_setup( &md_ctx, md_info, 1 ) != 0 ) in main()
374 … if( fwrite( digest, 1, mbedtls_md_get_size( md_info ), fout ) != mbedtls_md_get_size( md_info ) ) in main()
376 mbedtls_fprintf( stderr, "fwrite(%d bytes) failed\n", mbedtls_md_get_size( md_info ) ); in main()
392 if( filesize < 16 + mbedtls_md_get_size( md_info ) ) in main()
408 ( ( filesize - mbedtls_md_get_size( md_info ) ) % in main()
[all …]
/net-tools-3.6.0/mbedtls-2.4.0/programs/test/
Dbenchmark.c593 const mbedtls_md_info_t *md_info; in main() local
598 if( ( md_info = mbedtls_md_info_from_type( MBEDTLS_MD_SHA1 ) ) == NULL ) in main()
601 if( mbedtls_hmac_drbg_seed( &hmac_drbg, md_info, myrand, NULL, NULL, 0 ) != 0 ) in main()
608 if( mbedtls_hmac_drbg_seed( &hmac_drbg, md_info, myrand, NULL, NULL, 0 ) != 0 ) in main()
619 if( ( md_info = mbedtls_md_info_from_type( MBEDTLS_MD_SHA256 ) ) == NULL ) in main()
622 if( mbedtls_hmac_drbg_seed( &hmac_drbg, md_info, myrand, NULL, NULL, 0 ) != 0 ) in main()
629 if( mbedtls_hmac_drbg_seed( &hmac_drbg, md_info, myrand, NULL, NULL, 0 ) != 0 ) in main()
/net-tools-3.6.0/mbedtls-2.4.0/yotta/data/example-benchmark/
Dmain.cpp639 const mbedtls_md_info_t *md_info; in benchmark() local
644 if( ( md_info = mbedtls_md_info_from_type( MBEDTLS_MD_SHA1 ) ) == NULL ) in benchmark()
647 if( mbedtls_hmac_drbg_seed( &hmac_drbg, md_info, myrand, NULL, NULL, 0 ) != 0 ) in benchmark()
654 if( mbedtls_hmac_drbg_seed( &hmac_drbg, md_info, myrand, NULL, NULL, 0 ) != 0 ) in benchmark()
665 if( ( md_info = mbedtls_md_info_from_type( MBEDTLS_MD_SHA256 ) ) == NULL ) in benchmark()
668 if( mbedtls_hmac_drbg_seed( &hmac_drbg, md_info, myrand, NULL, NULL, 0 ) != 0 ) in benchmark()
675 if( mbedtls_hmac_drbg_seed( &hmac_drbg, md_info, myrand, NULL, NULL, 0 ) != 0 ) in benchmark()