Home
last modified time | relevance | path

Searched refs:hash_size (Results 1 – 25 of 30) sorted by relevance

12

/optee_os/core/crypto/
H A Dsigned_hdr.c77 size_t hash_size = 0; in shdr_verify_signature() local
93 res = tee_alg_get_digest_size(hash_algo, &hash_size); in shdr_verify_signature()
96 if (hash_size != shdr->hash_size) in shdr_verify_signature()
114 shdr->hash_size, SHDR_GET_HASH(shdr), shdr->hash_size, in shdr_verify_signature()
282 img = mempool_alloc(mempool_default, shdr->img_size + shdr->hash_size); in shdr_load_pub_key()
285 memcpy(img + shdr->hash_size, ns_img + offs, shdr->img_size); in shdr_load_pub_key()
286 subkey = (void *)(img + shdr->hash_size); in shdr_load_pub_key()
297 crypto_hash_final(ctx, digest, shdr->hash_size) || in shdr_load_pub_key()
298 memcmp(digest, SHDR_GET_HASH(shdr), shdr->hash_size)) { in shdr_load_pub_key()
366 size_t hash_size = 0; in shdr_verify_signature2() local
[all …]
H A Dsm3-hash.c55 size_t hash_size = TEE_SM3_HASH_SIZE; in op_sm3_hash_final() local
62 if (hash_size > len) in op_sm3_hash_final()
69 if (hash_size > len) in op_sm3_hash_final()
/optee_os/lib/libmbedtls/mbedtls/library/
H A Dpsa_crypto_hash.c343 size_t hash_size, in mbedtls_psa_hash_finish() argument
353 *hash_length = hash_size; in mbedtls_psa_hash_finish()
356 if (hash_size != 0) { in mbedtls_psa_hash_finish()
357 memset(hash, '!', hash_size); in mbedtls_psa_hash_finish()
360 if (hash_size < actual_hash_length) { in mbedtls_psa_hash_finish()
417 ret = mbedtls_sha3_finish(&operation->ctx.sha3, hash, hash_size); in mbedtls_psa_hash_finish()
438 size_t hash_size, in mbedtls_psa_hash_compute() argument
445 *hash_length = hash_size; in mbedtls_psa_hash_compute()
454 status = mbedtls_psa_hash_finish(&operation, hash, hash_size, hash_length); in mbedtls_psa_hash_compute()
H A Dpsa_crypto_hash.h45 size_t hash_size,
181 size_t hash_size,
H A Dpsa_crypto_mac.c39 size_t hash_size = PSA_HASH_LENGTH(hash_alg); in psa_hmac_setup_internal() local
57 if (block_size < hash_size) { in psa_hmac_setup_internal()
118 size_t hash_size = 0; in psa_hmac_finish_internal() local
122 status = psa_hash_finish(&hmac->hash_ctx, tmp, sizeof(tmp), &hash_size); in psa_hmac_finish_internal()
138 status = psa_hash_update(&hmac->hash_ctx, tmp, hash_size); in psa_hmac_finish_internal()
143 status = psa_hash_finish(&hmac->hash_ctx, tmp, sizeof(tmp), &hash_size); in psa_hmac_finish_internal()
151 mbedtls_platform_zeroize(tmp, hash_size); in psa_hmac_finish_internal()
H A Dpsa_crypto_driver_wrappers.h1552 size_t hash_size, in psa_driver_wrapper_hash_compute() argument
1560 alg, input, input_length, hash, hash_size, hash_length ); in psa_driver_wrapper_hash_compute()
1568 hash, hash_size, hash_length ); in psa_driver_wrapper_hash_compute()
1577 (void) hash_size; in psa_driver_wrapper_hash_compute()
1669 size_t hash_size, in psa_driver_wrapper_hash_finish() argument
1677 hash, hash_size, hash_length ) ); in psa_driver_wrapper_hash_finish()
1683 hash, hash_size, hash_length ) ); in psa_driver_wrapper_hash_finish()
1687 (void) hash_size; in psa_driver_wrapper_hash_finish()
/optee_os/lib/libmbedtls/core/
H A Dhash.c62 size_t hash_size = 0; in mbed_hash_final() local
67 hash_size = mbedtls_md_get_size(mbedtls_md_info_from_ctx(&hc->md_ctx)); in mbed_hash_final()
68 if (hash_size > len) { in mbed_hash_final()
69 if (hash_size > sizeof(block_digest)) in mbed_hash_final()
79 if (hash_size > len) in mbed_hash_final()
H A Drsa.c667 size_t hash_size = 0; in sw_crypto_acipher_rsassa_sign() local
714 &hash_size); in sw_crypto_acipher_rsassa_sign()
718 if (msg_len != hash_size) { in sw_crypto_acipher_rsassa_sign()
771 size_t hash_size = 0; in sw_crypto_acipher_rsassa_verify() local
805 &hash_size); in sw_crypto_acipher_rsassa_verify()
809 if (msg_len != hash_size) { in sw_crypto_acipher_rsassa_verify()
/optee_os/core/lib/libtomcrypt/
H A Ddsa.c100 size_t hash_size; in crypto_acipher_dsa_sign() local
121 &hash_size); in crypto_acipher_dsa_sign()
124 if (mp_unsigned_bin_size(ltc_key.q) < hash_size) in crypto_acipher_dsa_sign()
125 hash_size = mp_unsigned_bin_size(ltc_key.q); in crypto_acipher_dsa_sign()
126 if (msg_len != hash_size) { in crypto_acipher_dsa_sign()
H A Dhash.c61 size_t hash_size = hc->descr->hashsize; in ltc_hash_final() local
68 if (hash_size > len) { in ltc_hash_final()
69 if (hash_size > sizeof(block_digest)) in ltc_hash_final()
77 if (hash_size > len) in ltc_hash_final()
H A Drsa.c535 size_t hash_size, mod_size; in sw_crypto_acipher_rsassa_sign() local
585 &hash_size); in sw_crypto_acipher_rsassa_sign()
589 if (msg_len != hash_size) { in sw_crypto_acipher_rsassa_sign()
636 size_t hash_size; in sw_crypto_acipher_rsassa_verify() local
653 &hash_size); in sw_crypto_acipher_rsassa_verify()
657 if (msg_len != hash_size) { in sw_crypto_acipher_rsassa_verify()
/optee_os/core/include/
H A Dsigned_hdr.h39 uint16_t hash_size; member
57 if (ADD_OVERFLOW(s, shdr->hash_size, &s) || in shdr_get_size()
66 #define SHDR_GET_SIG(x) (SHDR_GET_HASH(x) + (x)->hash_size)
/optee_os/core/drivers/crypto/stm32/
H A Dstm32_pka.h61 TEE_Result stm32_pka_ecdsa_sign(const void *hash, unsigned int hash_size,
67 TEE_Result stm32_pka_ecdsa_verif(const void *hash, unsigned int hash_size,
H A Dstm32_pka.c1252 TEE_Result stm32_pka_ecdsa_verif(const void *hash, unsigned int hash_size, in stm32_pka_ecdsa_verif() argument
1297 if (n_len_bytes < hash_size) { in stm32_pka_ecdsa_verif()
1303 hash_size = n_len_bytes; in stm32_pka_ecdsa_verif()
1305 res = write_eo_data(base + _PKA_RAM_VERIF_HASH_Z, hash, hash_size, in stm32_pka_ecdsa_verif()
1409 TEE_Result stm32_pka_ecdsa_sign(const void *hash, unsigned int hash_size, in stm32_pka_ecdsa_sign() argument
1455 if (n_len_bytes < hash_size) { in stm32_pka_ecdsa_sign()
1461 hash_size = n_len_bytes; in stm32_pka_ecdsa_sign()
1463 res = write_eo_data(base + _PKA_RAM_SIGN_HASH_Z, hash, hash_size, in stm32_pka_ecdsa_sign()
/optee_os/core/pta/
H A Dsecstor_ta_mgmt.c58 if (shdr->hash_size > buf_size) in install_ta()
118 res = crypto_hash_final(hash_ctx, buf, shdr->hash_size); in install_ta()
121 if (consttime_memcmp(buf, SHDR_GET_HASH(shdr), shdr->hash_size)) { in install_ta()
/optee_os/scripts/
H A Dsign_encrypt.py363 self.hash_size = self.chosen_hash.digest_size
371 sig_tee_alg[sign_algo], self.hash_size,
479 [magic, img_type, img_size, algo_value, hash_size,
491 if hash_size != self.hash_size:
492 raise Exception("Unexpected digest len: {}".format(hash_size))
494 self.img_digest = self.inf[offs:offs + hash_size]
495 offs += hash_size
657 [magic, img_type, img_size, algo_value, hash_size,
684 print(' hash_size: {} bytes'.format(hash_size))
691 if hash_size != self.hash_size:
[all …]
/optee_os/ta/pkcs11/src/
H A Dprocessing_rsa.c64 size_t hash_size = 0; in pkcs2tee_validate_rsa_pss() local
72 hash_size = TEE_ALG_GET_DIGEST_SIZE(TEE_ALG_SHA1); in pkcs2tee_validate_rsa_pss()
75 hash_size = TEE_ALG_GET_DIGEST_SIZE(TEE_ALG_SHA224); in pkcs2tee_validate_rsa_pss()
78 hash_size = TEE_ALG_GET_DIGEST_SIZE(TEE_ALG_SHA256); in pkcs2tee_validate_rsa_pss()
81 hash_size = TEE_ALG_GET_DIGEST_SIZE(TEE_ALG_SHA384); in pkcs2tee_validate_rsa_pss()
84 hash_size = TEE_ALG_GET_DIGEST_SIZE(TEE_ALG_SHA512); in pkcs2tee_validate_rsa_pss()
106 if (rsa_pss_ctx->salt_len > (k - 2 - hash_size)) in pkcs2tee_validate_rsa_pss()
H A Dpkcs11_helpers.h75 uint32_t *hash_size);
H A Dprocessing_asymm.c491 size_t hash_size = 0; in step_asymm_operation() local
682 hash_size = TEE_ALG_GET_DIGEST_SIZE(proc->tee_hash_algo); in step_asymm_operation()
683 hash_buf = TEE_Malloc(hash_size, 0); in step_asymm_operation()
688 hash_buf, &hash_size); in step_asymm_operation()
979 hash_buf, hash_size, in step_asymm_operation()
989 hash_buf, hash_size, in step_asymm_operation()
H A Dpkcs11_helpers.c668 uint32_t *hash_size) in pkcs2tee_load_hashed_attr() argument
687 tmp_sz = *hash_size; in pkcs2tee_load_hashed_attr()
689 *hash_size = tmp_sz; in pkcs2tee_load_hashed_attr()
696 TEE_InitRefAttribute(tee_ref, tee_id, hash_ptr, *hash_size); in pkcs2tee_load_hashed_attr()
H A Dprocessing_symm.c294 uint32_t hash_size = 0; in hash_secret_helper() local
301 hash_size = TEE_ALG_GET_DIGEST_SIZE(algo); in hash_secret_helper()
302 hash_ptr = TEE_Malloc(hash_size, 0); in hash_secret_helper()
308 &hash_size); in hash_secret_helper()
317 *object_size_bits = hash_size * 8; in hash_secret_helper()
/optee_os/core/kernel/
H A Dree_fs_ta.c520 if (!tag || *tag_len < handle->shdr->hash_size) { in ree_fs_ta_get_tag()
521 *tag_len = handle->shdr->hash_size; in ree_fs_ta_get_tag()
524 *tag_len = handle->shdr->hash_size; in ree_fs_ta_get_tag()
526 memcpy(tag, SHDR_GET_HASH(handle->shdr), handle->shdr->hash_size); in ree_fs_ta_get_tag()
536 digest = malloc(h->shdr->hash_size); in check_digest()
539 res = crypto_hash_final(h->hash_ctx, digest, h->shdr->hash_size); in check_digest()
545 h->shdr->hash_size)) in check_digest()
/optee_os/core/pta/stm32mp/
H A Dremoteproc_pta.c239 size_t hash_size = (size_t)hash->memref.size; in rproc_pta_verify_rsa_signature() local
255 res = crypto_acipher_rsassa_verify(algo, &key, hash_size, in rproc_pta_verify_rsa_signature()
256 hash->memref.buffer, hash_size, in rproc_pta_verify_rsa_signature()
/optee_os/core/arch/arm/kernel/
H A Dboot.c484 size_t hash_size = (pageable_size / SMALL_PAGE_SIZE) * in init_pager_runtime() local
496 assert(hash_size == embdata->hashes_len); in init_pager_runtime()
506 hashes = malloc(hash_size); in init_pager_runtime()
508 IMSG("Pager is enabled. Hashes: %zu bytes", hash_size); in init_pager_runtime()
510 asan_memcpy_unchecked(hashes, tmp_hashes, hash_size); in init_pager_runtime()
/optee_os/lib/libmbedtls/mbedtls/include/psa/
H A Dcrypto.h879 size_t hash_size,
1078 size_t hash_size,

12