| /optee_os/lib/libmbedtls/mbedtls/library/ |
| H A D | md.c | 263 if (ctx == NULL || ctx->md_info == NULL) { in mbedtls_md_free() 273 switch (ctx->md_info->type) { in mbedtls_md_free() 327 2 * ctx->md_info->block_size); in mbedtls_md_free() 337 if (dst == NULL || dst->md_info == NULL || in mbedtls_md_clone() 338 src == NULL || src->md_info == NULL || in mbedtls_md_clone() 339 dst->md_info != src->md_info) { in mbedtls_md_clone() 358 switch (src->md_info->type) { in mbedtls_md_clone() 407 memcpy(dst->hmac_ctx, src->hmac_ctx, 2 * src->md_info->block_size); in mbedtls_md_clone() 421 int mbedtls_md_setup(mbedtls_md_context_t *ctx, const mbedtls_md_info_t *md_info, int hmac) in mbedtls_md_setup() argument 428 if (md_info == NULL) { in mbedtls_md_setup() [all …]
|
| H A D | hmac_drbg.c | 47 size_t md_len = mbedtls_md_get_size(ctx->md_ctx.md_info); in mbedtls_hmac_drbg_update() 98 const mbedtls_md_info_t *md_info, in mbedtls_hmac_drbg_seed_buf() argument 103 if ((ret = mbedtls_md_setup(&ctx->md_ctx, md_info, 1)) != 0) { in mbedtls_hmac_drbg_seed_buf() 117 mbedtls_md_get_size(md_info))) != 0) { in mbedtls_hmac_drbg_seed_buf() 120 memset(ctx->V, 0x01, mbedtls_md_get_size(md_info)); in mbedtls_hmac_drbg_seed_buf() 223 const mbedtls_md_info_t *md_info, in mbedtls_hmac_drbg_seed() argument 232 if ((ret = mbedtls_md_setup(&ctx->md_ctx, md_info, 1)) != 0) { in mbedtls_hmac_drbg_seed() 241 md_size = mbedtls_md_get_size(md_info); in mbedtls_hmac_drbg_seed() 312 size_t md_len = mbedtls_md_get_size(ctx->md_ctx.md_info); in mbedtls_hmac_drbg_random_with_add() 416 if (ctx->md_ctx.md_info != NULL) { in mbedtls_hmac_drbg_free() [all …]
|
| H A D | psa_crypto_random_impl.h | 119 const mbedtls_md_info_t *md_info = mbedtls_md_info_from_type(MBEDTLS_PSA_HMAC_DRBG_MD_TYPE); in mbedtls_psa_drbg_seed() 120 return mbedtls_hmac_drbg_seed(drbg_ctx, md_info, mbedtls_entropy_func, entropy, custom, len); in mbedtls_psa_drbg_seed()
|
| H A D | pkcs5.c | 278 unsigned char md_size = mbedtls_md_get_size(ctx->md_info); in pkcs5_pbkdf2_hmac() 376 const mbedtls_md_info_t *md_info = NULL; in mbedtls_pkcs5_pbkdf2_hmac_ext() local 379 md_info = mbedtls_md_info_from_type(md_alg); in mbedtls_pkcs5_pbkdf2_hmac_ext() 380 if (md_info == NULL) { in mbedtls_pkcs5_pbkdf2_hmac_ext() 386 if ((ret = mbedtls_md_setup(&md_ctx, md_info, 1)) != 0) { in mbedtls_pkcs5_pbkdf2_hmac_ext()
|
| H A D | pkcs12.c | 275 const mbedtls_md_info_t *md_info; in calculate_hashes() local 277 md_info = mbedtls_md_info_from_type(md_type); in calculate_hashes() 278 if (md_info == NULL) { in calculate_hashes() 284 if ((ret = mbedtls_md_setup(&md_ctx, md_info, 0)) != 0) { in calculate_hashes() 314 if ((ret = mbedtls_md(md_info, hash_output, hlen, hash_output)) in calculate_hashes()
|
| H A D | pkcs7.c | 651 const mbedtls_md_info_t *md_info; in mbedtls_pkcs7_data_or_hash_verify() local 669 md_info = mbedtls_md_info_from_type(md_alg); in mbedtls_pkcs7_data_or_hash_verify() 670 if (md_info == NULL) { in mbedtls_pkcs7_data_or_hash_verify() 674 hash = mbedtls_calloc(mbedtls_md_get_size(md_info), 1); in mbedtls_pkcs7_data_or_hash_verify() 681 if (datalen != mbedtls_md_get_size(md_info)) { in mbedtls_pkcs7_data_or_hash_verify() 687 ret = mbedtls_md(md_info, data, datalen, hash); in mbedtls_pkcs7_data_or_hash_verify() 709 mbedtls_md_get_size(md_info), in mbedtls_pkcs7_data_or_hash_verify()
|
| H A D | rsa.c | 1629 const mbedtls_md_info_t *md_info; in mgf_mask() local 1633 md_info = mbedtls_md_info_from_type(md_alg); in mgf_mask() 1634 if (md_info == NULL) { in mgf_mask() 1639 if ((ret = mbedtls_md_setup(&md_ctx, md_info, 0)) != 0) { in mgf_mask() 1643 hlen = mbedtls_md_get_size(md_info); in mgf_mask() 1705 const mbedtls_md_info_t *md_info = mbedtls_md_info_from_type(md_alg); in hash_mprime() local 1706 if (md_info == NULL) { in hash_mprime() 1711 if ((ret = mbedtls_md_setup(&md_ctx, md_info, 0)) != 0) { in hash_mprime() 1748 const mbedtls_md_info_t *md_info; in compute_hash() local 1750 md_info = mbedtls_md_info_from_type(md_alg); in compute_hash() [all …]
|
| H A D | ecdsa.c | 410 const mbedtls_md_info_t *md_info; in mbedtls_ecdsa_sign_det_restartable() local 413 if ((md_info = mbedtls_md_info_from_type(md_alg)) == NULL) { in mbedtls_ecdsa_sign_det_restartable() 438 MBEDTLS_MPI_CHK(mbedtls_hmac_drbg_seed_buf(p_rng, md_info, data, 2 * grp_len)); in mbedtls_ecdsa_sign_det_restartable()
|
| H A D | x509_crt.c | 2020 const mbedtls_md_info_t *md_info; in x509_crt_verifycrl() local 2068 md_info = mbedtls_md_info_from_type(crl_list->sig_md); in x509_crt_verifycrl() 2069 hash_length = mbedtls_md_get_size(md_info); in x509_crt_verifycrl() 2070 if (mbedtls_md(md_info, in x509_crt_verifycrl() 2131 const mbedtls_md_info_t *md_info; in x509_crt_check_signature() local 2132 md_info = mbedtls_md_info_from_type(child->sig_md); in x509_crt_check_signature() 2133 hash_len = mbedtls_md_get_size(md_info); in x509_crt_check_signature() 2136 if (mbedtls_md(md_info, child->tbs.p, child->tbs.len, hash) != 0) { in x509_crt_check_signature()
|
| H A D | ssl_tls.c | 3711 const mbedtls_md_info_t *md_info = in ssl_tls12_session_load() local 3713 if (md_info == NULL) { in ssl_tls12_session_load() 3716 if (session->peer_cert_digest_len != mbedtls_md_get_size(md_info)) { in ssl_tls12_session_load() 6861 const mbedtls_md_info_t *md_info; in tls_prf_generic() local 6867 if ((md_info = mbedtls_md_info_from_type(md_type)) == NULL) { in tls_prf_generic() 6871 md_len = mbedtls_md_get_size(md_info); in tls_prf_generic() 6888 if ((ret = mbedtls_md_setup(&md_ctx, md_info, 1)) != 0) { in tls_prf_generic() 8652 const mbedtls_md_info_t *md_info; in ssl_tls12_populate_transform() local 8732 md_info = mbedtls_md_info_from_type((mbedtls_md_type_t) ciphersuite_info->mac); in ssl_tls12_populate_transform() 8733 if (md_info == NULL) { in ssl_tls12_populate_transform() [all …]
|
| H A D | ssl_msg.c | 209 const mbedtls_md_type_t md_alg = mbedtls_md_get_type(ctx->md_info); in mbedtls_ct_hmac() 215 const size_t hash_size = mbedtls_md_get_size(ctx->md_info); in mbedtls_ct_hmac() 231 MD_CHK(mbedtls_md_setup(&aux, ctx->md_info, 0)); in mbedtls_ct_hmac()
|
| /optee_os/lib/libmbedtls/mbedtls/include/mbedtls/ |
| H A D | md.h | 124 const mbedtls_md_info_t *MBEDTLS_PRIVATE(md_info); 197 int mbedtls_md_setup(mbedtls_md_context_t *ctx, const mbedtls_md_info_t *md_info, int hmac); 235 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); 337 int mbedtls_md(const mbedtls_md_info_t *md_info, const unsigned char *input, size_t ilen, 373 const char *mbedtls_md_get_name(const mbedtls_md_info_t *md_info); 407 int mbedtls_md_file(const mbedtls_md_info_t *md_info, const char *path, 518 int mbedtls_md_hmac(const mbedtls_md_info_t *md_info, const unsigned char *key, size_t keylen,
|
| H A D | hmac_drbg.h | 187 const mbedtls_md_info_t *md_info, 222 const mbedtls_md_info_t *md_info,
|
| /optee_os/lib/libmbedtls/core/ |
| H A D | hmac.c | 111 const mbedtls_md_info_t *md_info = mbedtls_md_info_from_type(md_type); in mbed_hmac_alloc_ctx() local 113 if (!md_info) in mbed_hmac_alloc_ctx() 121 mbed_res = mbedtls_md_setup(&c->md_ctx, md_info, 1); in mbed_hmac_alloc_ctx()
|
| H A D | hash.c | 116 const mbedtls_md_info_t *md_info = mbedtls_md_info_from_type(md_type); in mbed_hash_alloc_ctx() local 118 if (!md_info) in mbed_hash_alloc_ctx() 126 mbed_res = mbedtls_md_setup(&hc->md_ctx, md_info, 0); in mbed_hash_alloc_ctx()
|