Home
last modified time | relevance | path

Searched refs:hash_len (Results 1 – 19 of 19) sorted by relevance

/mbedtls-3.5.0/library/
Dhkdf.c56 size_t hash_len; in mbedtls_hkdf_extract() local
62 hash_len = mbedtls_md_get_size(md); in mbedtls_hkdf_extract()
64 if (hash_len == 0) { in mbedtls_hkdf_extract()
69 salt_len = hash_len; in mbedtls_hkdf_extract()
79 size_t hash_len; in mbedtls_hkdf_expand() local
92 hash_len = mbedtls_md_get_size(md); in mbedtls_hkdf_expand()
94 if (prk_len < hash_len || hash_len == 0) { in mbedtls_hkdf_expand()
103 n = okm_len / hash_len; in mbedtls_hkdf_expand()
105 if (okm_len % hash_len != 0) { in mbedtls_hkdf_expand()
123 memset(t, 0, hash_len); in mbedtls_hkdf_expand()
[all …]
Dssl_tls13_keys.c435 size_t const hash_len = PSA_HASH_LENGTH(hash_alg); in mbedtls_ssl_tls13_derive_early_secrets() local
459 early_secret, hash_len, in mbedtls_ssl_tls13_derive_early_secrets()
464 hash_len); in mbedtls_ssl_tls13_derive_early_secrets()
471 early_secret, hash_len, in mbedtls_ssl_tls13_derive_early_secrets()
476 hash_len); in mbedtls_ssl_tls13_derive_early_secrets()
491 size_t const hash_len = PSA_HASH_LENGTH(hash_alg); in mbedtls_ssl_tls13_derive_handshake_secrets() local
519 handshake_secret, hash_len, in mbedtls_ssl_tls13_derive_handshake_secrets()
524 hash_len); in mbedtls_ssl_tls13_derive_handshake_secrets()
535 handshake_secret, hash_len, in mbedtls_ssl_tls13_derive_handshake_secrets()
540 hash_len); in mbedtls_ssl_tls13_derive_handshake_secrets()
[all …]
Dpk.c375 static inline int pk_hashlen_helper(mbedtls_md_type_t md_alg, size_t *hash_len) in pk_hashlen_helper() argument
377 if (*hash_len != 0) { in pk_hashlen_helper()
381 *hash_len = mbedtls_hash_info_get_size(md_alg); in pk_hashlen_helper()
383 if (*hash_len == 0) { in pk_hashlen_helper()
422 const unsigned char *hash, size_t hash_len, 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()
471 const unsigned char *hash, size_t hash_len, in mbedtls_pk_verify() argument
[all …]
Dpk_wrap.c202 const unsigned char *hash, size_t hash_len, in rsa_verify_wrap() argument
217 if (md_alg == MBEDTLS_MD_NONE && UINT_MAX < hash_len) { in rsa_verify_wrap()
246 status = psa_verify_hash(key_id, psa_alg_md, hash, hash_len, in rsa_verify_wrap()
264 const unsigned char *hash, size_t hash_len, in rsa_verify_wrap() argument
271 if (md_alg == MBEDTLS_MD_NONE && UINT_MAX < hash_len) { in rsa_verify_wrap()
280 (unsigned int) hash_len, in rsa_verify_wrap()
301 const unsigned char *hash, size_t hash_len, in mbedtls_pk_psa_rsa_sign_ext() argument
338 status = psa_sign_hash(key_id, alg, hash, hash_len, in mbedtls_pk_psa_rsa_sign_ext()
358 const unsigned char *hash, size_t hash_len, in rsa_sign_wrap() argument
373 ctx, hash, hash_len, in rsa_sign_wrap()
[all …]
Dpk_wrap.h49 const unsigned char *hash, size_t hash_len,
54 const unsigned char *hash, size_t hash_len,
62 const unsigned char *hash, size_t hash_len,
68 const unsigned char *hash, size_t hash_len,
161 const unsigned char *hash, size_t hash_len,
Dssl_tls13_generic.c1391 size_t hash_len; in mbedtls_ssl_reset_transcript_for_hrr() local
1400 &hash_len); in mbedtls_ssl_reset_transcript_for_hrr()
1409 hash_transcript[3] = (unsigned char) hash_len; in mbedtls_ssl_reset_transcript_for_hrr()
1411 hash_len += 4; in mbedtls_ssl_reset_transcript_for_hrr()
1414 hash_transcript, hash_len); in mbedtls_ssl_reset_transcript_for_hrr()
1422 ret = ssl->handshake->update_checksum(ssl, hash_transcript, hash_len); in mbedtls_ssl_reset_transcript_for_hrr()
Dx509write_csr.c251 size_t hash_len; in x509write_csr_der_internal() local
324 &hash_len) != PSA_SUCCESS) { in x509write_csr_der_internal()
Dx509_crt.c1983 size_t hash_len; in x509_crt_check_signature() local
1988 hash_len = mbedtls_md_get_size(md_info); in x509_crt_check_signature()
2003 &hash_len); in x509_crt_check_signature()
2017 child->sig_md, hash, hash_len, in x509_crt_check_signature()
2025 child->sig_md, hash, hash_len, in x509_crt_check_signature()
Dssl_tls.c7961 int ret, hash_len; in mbedtls_ssl_write_finished() local
7978 hash_len = 12; in mbedtls_ssl_write_finished()
7981 ssl->verify_data_len = hash_len; in mbedtls_ssl_write_finished()
7982 memcpy(ssl->own_verify_data, ssl->out_msg + 4, hash_len); in mbedtls_ssl_write_finished()
7985 ssl->out_msglen = 4 + hash_len; in mbedtls_ssl_write_finished()
8075 unsigned int hash_len = 12; in mbedtls_ssl_parse_finished() local
8105 if (ssl->in_hslen != mbedtls_ssl_hs_hdr_len(ssl) + hash_len) { in mbedtls_ssl_parse_finished()
8114 buf, hash_len) != 0) { in mbedtls_ssl_parse_finished()
8123 ssl->verify_data_len = hash_len; in mbedtls_ssl_parse_finished()
8124 memcpy(ssl->peer_verify_data, buf, hash_len); in mbedtls_ssl_parse_finished()
[all …]
/mbedtls-3.5.0/include/mbedtls/
Dpk.h481 const unsigned char *hash, size_t hash_len,
506 const unsigned char *hash, size_t hash_len,
543 const unsigned char *hash, size_t hash_len,
575 const unsigned char *hash, size_t hash_len,
612 const unsigned char *hash, size_t hash_len,
649 const unsigned char *hash, size_t hash_len,
Dssl.h971 size_t hash_len);
/mbedtls-3.5.0/tests/suites/
Dtest_suite_hkdf.data1 HKDF extract fails with hash_len of 0
7 HKDF expand fails with hash_len of 0
10 HKDF expand fails with prk_len < hash_len
13 HKDF expand fails with okm_len / hash_len > 255
Dtest_suite_hkdf.function89 void test_hkdf_extract_ret(int hash_len, int ret)
100 fake_md_info.size = hash_len;
116 void test_hkdf_expand_ret(int hash_len, int prk_len, int okm_len, int ret)
127 fake_md_info.size = hash_len;
Dtest_suite_pk.function749 size_t hash_len = sizeof(hash);
773 hash, hash_len,
784 hash, hash_len, sig, sig_len) == verify_ret);
789 hash, hash_len, sig, sig_len) != 0);
794 hash, hash_len, sig, sig_len) != 0);
798 TEST_ASSERT(mbedtls_pk_sign(&pk, MBEDTLS_MD_SHA256, hash, hash_len,
809 hash, hash_len, sig, sig_len, rs_ctx) == verify_ret);
1064 size_t hash_len = SIZE_MAX, sig_len = SIZE_MAX;
1077 MBEDTLS_MD_NONE, hash, hash_len, sig, sig_len) ==
1081 TEST_ASSERT(mbedtls_pk_verify(&pk, MBEDTLS_MD_NONE, hash, hash_len,
[all …]
Dtest_suite_ssl.function1797 size_t const hash_len = PSA_HASH_LENGTH(alg);
1799 secret->len == hash_len &&
1800 transcript->len == hash_len &&
1801 traffic_expected->len == hash_len &&
1802 exporter_expected->len == hash_len);
1810 ASSERT_COMPARE(secrets.client_early_traffic_secret, hash_len,
1812 ASSERT_COMPARE(secrets.early_exporter_master_secret, hash_len,
1830 size_t const hash_len = PSA_HASH_LENGTH(alg);
1832 secret->len == hash_len &&
1833 transcript->len == hash_len &&
[all …]
Dtest_suite_psa_crypto.function2842 size_t hash_len;
2874 hash, sizeof(hash), &hash_len));
2888 hash, sizeof(hash), &hash_len));
2908 hash, sizeof(hash), &hash_len),
2915 hash, sizeof(hash), &hash_len));
2917 hash, sizeof(hash), &hash_len),
2926 hash, sizeof(hash), &hash_len),
2982 size_t hash_len;
2989 hash, expected_size - 1, &hash_len),
3007 size_t hash_len;
[all …]
Dtest_suite_pk.data547 RSA hash_len overflow (size_t vs unsigned int)
/mbedtls-3.5.0/programs/ssl/
Dssl_server2.c1226 size_t hash_len) in ssl_async_sign() argument
1230 hash, hash_len); in ssl_async_sign()
/mbedtls-3.5.0/docs/
D3.0-migration-guide.md460 …ture functions in the PK module no longer accept 0 as the `hash_len` parameter. The `hash_len` par…