Home
last modified time | relevance | path

Searched refs:md_alg (Results 1 – 25 of 41) sorted by relevance

12

/mbedtls-3.5.0/library/
Dpk.c375 static inline int pk_hashlen_helper(mbedtls_md_type_t md_alg, size_t *hash_len) in pk_hashlen_helper() argument
381 *hash_len = mbedtls_hash_info_get_size(md_alg); in pk_hashlen_helper()
421 mbedtls_md_type_t md_alg, in mbedtls_pk_verify_restartable() argument
426 if ((md_alg != MBEDTLS_MD_NONE || hash_len != 0) && hash == NULL) { in mbedtls_pk_verify_restartable()
431 pk_hashlen_helper(md_alg, &hash_len) != 0) { in mbedtls_pk_verify_restartable()
447 md_alg, hash, hash_len, sig, sig_len, rs_ctx->rs_ctx); in mbedtls_pk_verify_restartable()
463 return ctx->pk_info->verify_func(ctx->pk_ctx, md_alg, hash, hash_len, in mbedtls_pk_verify_restartable()
470 int mbedtls_pk_verify(mbedtls_pk_context *ctx, mbedtls_md_type_t md_alg, in mbedtls_pk_verify() argument
474 return mbedtls_pk_verify_restartable(ctx, md_alg, hash, hash_len, in mbedtls_pk_verify()
482 mbedtls_pk_context *ctx, mbedtls_md_type_t md_alg, in mbedtls_pk_verify_ext() argument
[all …]
Dpk_wrap.c201 static int rsa_verify_wrap(void *ctx, mbedtls_md_type_t md_alg, in rsa_verify_wrap() argument
214 PSA_ALG_RSA_PKCS1V15_SIGN(mbedtls_hash_info_psa_from_md(md_alg)); in rsa_verify_wrap()
217 if (md_alg == MBEDTLS_MD_NONE && UINT_MAX < hash_len) { in rsa_verify_wrap()
263 static int rsa_verify_wrap(void *ctx, mbedtls_md_type_t md_alg, in rsa_verify_wrap() argument
271 if (md_alg == MBEDTLS_MD_NONE && UINT_MAX < hash_len) { in rsa_verify_wrap()
279 if ((ret = mbedtls_rsa_pkcs1_verify(rsa, md_alg, in rsa_verify_wrap()
357 static int rsa_sign_wrap(void *ctx, mbedtls_md_type_t md_alg, in rsa_sign_wrap() argument
366 psa_md_alg = mbedtls_hash_info_psa_from_md(md_alg); in rsa_sign_wrap()
377 static int rsa_sign_wrap(void *ctx, mbedtls_md_type_t md_alg, in rsa_sign_wrap() argument
384 if (md_alg == MBEDTLS_MD_NONE && UINT_MAX < hash_len) { in rsa_sign_wrap()
[all …]
Dpsa_crypto_rsa.c318 mbedtls_md_type_t *md_alg) in psa_rsa_decode_md_type() argument
321 *md_alg = mbedtls_hash_info_md_from_psa(hash_alg); in psa_rsa_decode_md_type()
332 if (*md_alg == MBEDTLS_MD_NONE) { in psa_rsa_decode_md_type()
335 if (mbedtls_hash_info_get_size(*md_alg) != hash_length) { in psa_rsa_decode_md_type()
352 mbedtls_md_type_t md_alg; in mbedtls_psa_rsa_sign_hash() local
362 status = psa_rsa_decode_md_type(alg, hash_length, &md_alg); in mbedtls_psa_rsa_sign_hash()
380 md_alg, in mbedtls_psa_rsa_sign_hash()
389 ret = mbedtls_rsa_set_padding(rsa, MBEDTLS_RSA_PKCS_V21, md_alg); in mbedtls_psa_rsa_sign_hash()
451 mbedtls_md_type_t md_alg; in mbedtls_psa_rsa_verify_hash() local
461 status = psa_rsa_decode_md_type(alg, hash_length, &md_alg); in mbedtls_psa_rsa_verify_hash()
[all …]
Drsa.c1085 size_t slen, mbedtls_md_type_t md_alg) in mgf_mask() argument
1098 md_info = mbedtls_md_info_from_type(md_alg); in mgf_mask()
1111 psa_algorithm_t alg = mbedtls_psa_translate_md(md_alg); in mgf_mask()
1193 unsigned char *out, mbedtls_md_type_t md_alg) in hash_mprime() argument
1201 const mbedtls_md_info_t *md_info = mbedtls_md_info_from_type(md_alg); in hash_mprime()
1232 psa_algorithm_t alg = mbedtls_psa_translate_md(md_alg); in hash_mprime()
1269 static int compute_hash(mbedtls_md_type_t md_alg, in compute_hash() argument
1276 md_info = mbedtls_md_info_from_type(md_alg); in compute_hash()
1283 psa_algorithm_t alg = mbedtls_psa_translate_md(md_alg); in compute_hash()
1654 mbedtls_md_type_t md_alg, in rsa_rsassa_pss_sign() argument
[all …]
Doid.c377 mbedtls_md_type_t md_alg; member
489 md_alg,
498 md_alg)
666 mbedtls_md_type_t md_alg; member
719 FN_OID_TYPED_FROM_ASN1(oid_md_alg_t, md_alg, oid_md_alg)
720 FN_OID_GET_ATTR1(mbedtls_oid_get_md_alg, oid_md_alg_t, md_alg, mbedtls_md_type_t, md_alg)
725 md_alg)
782 mbedtls_md_type_t md_alg; member
811 md_alg, in FN_OID_TYPED_FROM_ASN1()
Dpk_wrap.h48 int (*verify_func)(void *ctx, mbedtls_md_type_t md_alg,
53 int (*sign_func)(void *ctx, mbedtls_md_type_t md_alg,
61 int (*verify_rs_func)(void *ctx, mbedtls_md_type_t md_alg,
67 int (*sign_rs_func)(void *ctx, mbedtls_md_type_t md_alg,
Dx509write_csr.c64 void mbedtls_x509write_csr_set_md_alg(mbedtls_x509write_csr *ctx, mbedtls_md_type_t md_alg) in mbedtls_x509write_csr_set_md_alg() argument
66 ctx->md_alg = md_alg; in mbedtls_x509write_csr_set_md_alg()
252 psa_algorithm_t hash_alg = mbedtls_hash_info_psa_from_md(ctx->md_alg); in x509write_csr_der_internal()
328 ret = mbedtls_md(mbedtls_md_info_from_type(ctx->md_alg), c, len, hash); in x509write_csr_der_internal()
333 if ((ret = mbedtls_pk_sign(ctx->key, ctx->md_alg, hash, 0, in x509write_csr_der_internal()
347 if ((ret = mbedtls_oid_get_oid_by_sig_alg(pk_alg, ctx->md_alg, in x509write_csr_der_internal()
Decdsa.c412 mbedtls_md_type_t md_alg, in mbedtls_ecdsa_sign_det_restartable() argument
425 if ((md_info = mbedtls_md_info_from_type(md_alg)) == NULL) { in mbedtls_ecdsa_sign_det_restartable()
485 mbedtls_md_type_t md_alg, in mbedtls_ecdsa_sign_det_ext() argument
490 return mbedtls_ecdsa_sign_det_restartable(grp, r, s, d, buf, blen, md_alg, in mbedtls_ecdsa_sign_det_ext()
652 mbedtls_md_type_t md_alg, in mbedtls_ecdsa_write_signature_restartable() argument
670 hash, hlen, md_alg, f_rng, in mbedtls_ecdsa_write_signature_restartable()
673 (void) md_alg; in mbedtls_ecdsa_write_signature_restartable()
701 mbedtls_md_type_t md_alg, in mbedtls_ecdsa_write_signature() argument
708 ctx, md_alg, hash, hlen, sig, sig_size, slen, in mbedtls_ecdsa_write_signature()
Dx509write_crt.c74 mbedtls_md_type_t md_alg) in mbedtls_x509write_crt_set_md_alg() argument
76 ctx->md_alg = md_alg; in mbedtls_x509write_crt_set_md_alg()
457 if ((ret = mbedtls_oid_get_oid_by_sig_alg(pk_alg, ctx->md_alg, in mbedtls_x509write_crt_der()
589 psa_algorithm = mbedtls_hash_info_psa_from_md(ctx->md_alg); in mbedtls_x509write_crt_der()
601 if ((ret = mbedtls_md(mbedtls_md_info_from_type(ctx->md_alg), c, in mbedtls_x509write_crt_der()
608 if ((ret = mbedtls_pk_sign(ctx->issuer_key, ctx->md_alg, in mbedtls_x509write_crt_der()
Dx509.c135 static inline const char *md_type_to_string(mbedtls_md_type_t md_alg) in md_type_to_string() argument
137 switch (md_alg) { in md_type_to_string()
183 static int x509_get_hash_alg(const mbedtls_x509_buf *alg, mbedtls_md_type_t *md_alg) in x509_get_hash_alg() argument
216 if ((ret = mbedtls_oid_get_md_alg(&md_oid, md_alg)) != 0) { in x509_get_hash_alg()
250 mbedtls_md_type_t *md_alg, mbedtls_md_type_t *mgf_md, in mbedtls_x509_get_rsassa_pss_params() argument
260 *md_alg = MBEDTLS_MD_SHA1; in mbedtls_x509_get_rsassa_pss_params()
290 if ((ret = mbedtls_oid_get_md_alg(&alg_id, md_alg)) != 0) { in mbedtls_x509_get_rsassa_pss_params()
751 mbedtls_md_type_t *md_alg, mbedtls_pk_type_t *pk_alg, in mbedtls_x509_get_sig_alg() argument
760 if ((ret = mbedtls_oid_get_sig_alg(sig_oid, md_alg, pk_alg)) != 0) { in mbedtls_x509_get_sig_alg()
774 md_alg, in mbedtls_x509_get_sig_alg()
[all …]
Dpkcs7.c471 mbedtls_md_type_t md_alg; in pkcs7_get_signed_data() local
497 ret = mbedtls_oid_get_md_alg(&signed_data->digest_alg_identifiers, &md_alg); in pkcs7_get_signed_data()
664 mbedtls_md_type_t md_alg; in mbedtls_pkcs7_data_or_hash_verify() local
676 ret = mbedtls_oid_get_md_alg(&pkcs7->signed_data.digest_alg_identifiers, &md_alg); in mbedtls_pkcs7_data_or_hash_verify()
681 md_info = mbedtls_md_info_from_type(md_alg); in mbedtls_pkcs7_data_or_hash_verify()
720 ret = mbedtls_pk_verify(&pk_cxt, md_alg, hash, in mbedtls_pkcs7_data_or_hash_verify()
Dssl_tls13_generic.c173 mbedtls_md_type_t md_alg; in ssl_tls13_parse_certificate_verify() local
216 algorithm, &sig_alg, &md_alg) != 0) { in ssl_tls13_parse_certificate_verify()
220 hash_alg = mbedtls_hash_info_psa_from_md(md_alg); in ssl_tls13_parse_certificate_verify()
255 rsassa_pss_options.mgf1_hash_id = md_alg; in ssl_tls13_parse_certificate_verify()
264 md_alg, verify_hash, verify_hash_len, in ssl_tls13_parse_certificate_verify()
996 mbedtls_md_type_t md_alg = MBEDTLS_MD_NONE; in ssl_tls13_write_certificate_verify_body() local
1014 *sig_alg, &pk_type, &md_alg) != 0) { in ssl_tls13_write_certificate_verify_body()
1019 psa_algorithm = mbedtls_hash_info_psa_from_md(md_alg); in ssl_tls13_write_certificate_verify_body()
1032 md_alg, verify_hash, verify_hash_len, in ssl_tls13_write_certificate_verify_body()
Dpkcs5.c327 int mbedtls_pkcs5_pbkdf2_hmac_ext(mbedtls_md_type_t md_alg, in mbedtls_pkcs5_pbkdf2_hmac_ext() argument
338 md_info = mbedtls_md_info_from_type(md_alg); in mbedtls_pkcs5_pbkdf2_hmac_ext()
357 const unsigned char md_size = mbedtls_hash_info_get_size(md_alg); in mbedtls_pkcs5_pbkdf2_hmac_ext()
367 const psa_algorithm_t alg = PSA_ALG_HMAC(mbedtls_hash_info_psa_from_md(md_alg)); in mbedtls_pkcs5_pbkdf2_hmac_ext()
Dssl_misc.h1739 mbedtls_md_type_t md_alg);
2370 uint16_t sig_alg, mbedtls_pk_type_t *pk_type, mbedtls_md_type_t *md_alg) in mbedtls_ssl_get_pk_type_and_md_alg_from_sig_alg() argument
2373 *md_alg = mbedtls_ssl_md_alg_from_hash((sig_alg >> 8) & 0xff); in mbedtls_ssl_get_pk_type_and_md_alg_from_sig_alg()
2375 if (*pk_type != MBEDTLS_PK_NONE && *md_alg != MBEDTLS_MD_NONE) { in mbedtls_ssl_get_pk_type_and_md_alg_from_sig_alg()
2383 *md_alg = MBEDTLS_MD_SHA256; in mbedtls_ssl_get_pk_type_and_md_alg_from_sig_alg()
2389 *md_alg = MBEDTLS_MD_SHA384; in mbedtls_ssl_get_pk_type_and_md_alg_from_sig_alg()
2395 *md_alg = MBEDTLS_MD_SHA512; in mbedtls_ssl_get_pk_type_and_md_alg_from_sig_alg()
/mbedtls-3.5.0/include/mbedtls/
Drsa.h841 mbedtls_md_type_t md_alg,
873 mbedtls_md_type_t md_alg,
924 mbedtls_md_type_t md_alg,
974 mbedtls_md_type_t md_alg,
1006 mbedtls_md_type_t md_alg,
1031 mbedtls_md_type_t md_alg,
1066 mbedtls_md_type_t md_alg,
1106 mbedtls_md_type_t md_alg,
Dpk.h261 mbedtls_md_type_t md_alg, unsigned int hashlen,
480 int mbedtls_pk_verify(mbedtls_pk_context *ctx, mbedtls_md_type_t md_alg,
505 mbedtls_md_type_t md_alg,
542 mbedtls_pk_context *ctx, mbedtls_md_type_t md_alg,
574 int mbedtls_pk_sign(mbedtls_pk_context *ctx, mbedtls_md_type_t md_alg,
611 mbedtls_md_type_t md_alg,
648 mbedtls_md_type_t md_alg,
Decdsa.h220 mbedtls_md_type_t md_alg,
344 mbedtls_md_type_t md_alg,
483 mbedtls_md_type_t md_alg,
530 mbedtls_md_type_t md_alg,
Doid.h546 mbedtls_md_type_t *md_alg, mbedtls_pk_type_t *pk_alg);
568 int mbedtls_oid_get_oid_by_sig_alg(mbedtls_pk_type_t pk_alg, mbedtls_md_type_t md_alg,
589 int mbedtls_oid_get_md_alg(const mbedtls_asn1_buf *oid, mbedtls_md_type_t *md_alg);
622 int mbedtls_oid_get_oid_by_md(mbedtls_md_type_t md_alg, const char **oid, size_t *olen);
647 int mbedtls_oid_get_pkcs12_pbe_alg(const mbedtls_asn1_buf *oid, mbedtls_md_type_t *md_alg,
Dx509.h424 mbedtls_md_type_t *md_alg, mbedtls_md_type_t *mgf_md,
429 mbedtls_md_type_t *md_alg, mbedtls_pk_type_t *pk_alg,
439 mbedtls_pk_type_t pk_alg, mbedtls_md_type_t md_alg,
Dx509_csr.h81 mbedtls_md_type_t MBEDTLS_PRIVATE(md_alg);
216 void mbedtls_x509write_csr_set_md_alg(mbedtls_x509write_csr *ctx, mbedtls_md_type_t md_alg);
Dpsa_util.h128 static inline psa_algorithm_t mbedtls_psa_translate_md(mbedtls_md_type_t md_alg) in mbedtls_psa_translate_md() argument
130 switch (md_alg) { in mbedtls_psa_translate_md()
/mbedtls-3.5.0/tests/suites/
Dtest_suite_hmac_drbg.function33 void hmac_drbg_entropy_usage(int md_alg)
51 md_info = mbedtls_md_info_from_type(md_alg);
125 void hmac_drbg_seed_file(int md_alg, char *path, int ret)
132 md_info = mbedtls_md_info_from_type(md_alg);
148 void hmac_drbg_buf(int md_alg)
160 md_info = mbedtls_md_info_from_type(md_alg);
178 void hmac_drbg_no_reseed(int md_alg, data_t *entropy,
193 md_info = mbedtls_md_info_from_type(md_alg);
226 void hmac_drbg_nopr(int md_alg, data_t *entropy, data_t *custom,
240 md_info = mbedtls_md_info_from_type(md_alg);
[all …]
Dtest_suite_hkdf.function12 void test_hkdf(int md_alg, data_t *ikm, data_t *salt, data_t *info,
18 const mbedtls_md_info_t *md = mbedtls_md_info_from_type(md_alg);
33 void test_hkdf_extract(int md_alg,
42 const mbedtls_md_info_t *md = mbedtls_md_info_from_type(md_alg);
60 void test_hkdf_expand(int md_alg,
69 const mbedtls_md_info_t *md = mbedtls_md_info_from_type(md_alg);
Dtest_suite_pk.function77 mbedtls_md_type_t md_alg, unsigned int hashlen,
84 md_alg, hashlen, hash, sig);
155 mbedtls_md_type_t md_alg = MBEDTLS_MD_NONE;
203 TEST_ASSERT(mbedtls_pk_verify(&pk, md_alg,
659 int md_alg, data_t *hash, data_t *sig_check,
688 ret = mbedtls_pk_sign_restartable(&prv, md_alg, hash->x, hash->len,
703 ret = mbedtls_pk_verify_restartable(&pub, md_alg,
713 ret = mbedtls_pk_verify_restartable(&pub, md_alg,
722 ret = mbedtls_pk_verify_restartable(&pub, md_alg,
728 ret = mbedtls_pk_sign_restartable(&prv, md_alg, hash->x, hash->len,
[all …]
/mbedtls-3.5.0/programs/x509/
Dcert_req.c114 mbedtls_md_type_t md_alg; /* Hash algorithm used for signature. */ member
196 opt.md_alg = DFL_MD_ALG; in main()
278 opt.md_alg = mbedtls_md_get_type(md_info); in main()
349 mbedtls_x509write_csr_set_md_alg(&req, opt.md_alg); in main()

12