| /optee_os/core/lib/libtomcrypt/src/hashes/ |
| H A D | sha3_test.c | 15 unsigned char buf[200], hash[224 / 8]; in sha3_224_test() 38 sha3_done(&c, hash); in sha3_224_test() 39 …if (compare_testvector(hash, sizeof(hash), sha3_224_empty, sizeof(sha3_224_empty), "SHA3-224", 0))… in sha3_224_test() 47 sha3_done(&c, hash); in sha3_224_test() 48 …if (compare_testvector(hash, sizeof(hash), sha3_224_0xa3_200_times, sizeof(sha3_224_0xa3_200_times… in sha3_224_test() 58 sha3_done(&c, hash); in sha3_224_test() 59 …if (compare_testvector(hash, sizeof(hash), sha3_224_0xa3_200_times, sizeof(sha3_224_0xa3_200_times… in sha3_224_test() 72 unsigned char buf[200], hash[256 / 8]; in sha3_256_test() 94 sha3_done(&c, hash); in sha3_256_test() 95 …if (compare_testvector(hash, sizeof(hash), sha3_256_empty, sizeof(sha3_256_empty), "SHA3-256", 0))… in sha3_256_test() [all …]
|
| /optee_os/core/include/tee/ |
| H A D | fs_htree.h | 30 /* Note that calc_node_hash() depends on hash first in struct */ 31 uint8_t hash[TEE_FS_HTREE_HASH_SIZE]; member 38 * This struct is not interpreted by the hash tree, it's up to the user of 61 * enum tee_fs_htree_type - type of hash tree element 103 * tee_fs_htree_open() - opens/creates a hash tree 104 * @create: true if a new hash tree is to be created, else the hash tree 106 * @hash: hash of root node, ignored if NULL 112 * @ht: returned hash tree on success 114 TEE_Result tee_fs_htree_open(bool create, uint8_t *hash, uint32_t min_counter, 119 * tee_fs_htree_close() - close a hash tree [all …]
|
| H A D | fs_dirfile.h | 17 * @hash: hash of file, to be supplied to tee_fs_htree_open() 22 uint8_t hash[TEE_FS_HTREE_HASH_SIZE]; member 37 TEE_Result (*open)(bool create, uint8_t *hash, uint32_t min_counter, 46 TEE_Result (*commit_writes)(struct tee_file_handle *fh, uint8_t *hash, 54 * @hash: hash of underlying file 59 TEE_Result tee_fs_dirfile_open(bool create, uint8_t *hash, uint32_t min_counter, 74 * @hash: hash of underlying file is copied here if not NULL 78 uint8_t *hash, uint32_t *counter); 136 * tee_fs_dirfile_update_hash() - update hash of file handle
|
| /optee_os/core/drivers/crypto/hisilicon/ |
| H A D | sec_hmac.c | 21 struct crypto_hmac *hash = NULL; in sec_hmac_initialize() local 29 hash = to_hmac_ctx(ctx); in sec_hmac_initialize() 30 hash_ctx = hash->ctx; in sec_hmac_initialize() 38 struct crypto_hmac *hash = NULL; in sec_hmac_do_update() local 51 hash = to_hmac_ctx(ctx); in sec_hmac_do_update() 52 hashctx = hash->ctx; in sec_hmac_do_update() 60 struct crypto_hmac *hash = to_hmac_ctx(ctx); in sec_hmac_do_final() local 61 struct hashctx *hash_ctx = hash->ctx; in sec_hmac_do_final() 68 struct crypto_hmac *hash = NULL; in sec_hmac_ctx_free() local 74 hash = to_hmac_ctx(ctx); in sec_hmac_ctx_free() [all …]
|
| /optee_os/core/lib/libtomcrypt/src/hashes/helper/ |
| H A D | hash_memory.c | 8 Hash memory helper, Tom St Denis 12 Hash a block of memory and store the digest. 13 @param hash The index of the hash you wish to use 14 @param in The data you wish to hash 15 @param inlen The length of the data to hash (octets) 20 int hash_memory(int hash, const unsigned char *in, unsigned long inlen, unsigned char *out, unsigne… in hash_memory() argument 29 if ((err = hash_is_valid(hash)) != CRYPT_OK) { in hash_memory() 33 if (*outlen < hash_descriptor[hash]->hashsize) { in hash_memory() 34 *outlen = hash_descriptor[hash]->hashsize; in hash_memory() 43 if ((err = hash_descriptor[hash]->init(md)) != CRYPT_OK) { in hash_memory() [all …]
|
| H A D | hash_memory_multi.c | 9 Hash (multiple buffers) memory helper, Tom St Denis 13 Hash multiple (non-adjacent) blocks of memory at once. 14 @param hash The index of the hash you wish to use 17 @param in The data you wish to hash 18 @param inlen The length of the data to hash (octets) 19 @param ... tuples of (data,len) pairs to hash, terminated with a (NULL,x) (x=don't care) 22 int hash_memory_multi(int hash, unsigned char *out, unsigned long *outlen, in hash_memory_multi() argument 35 if ((err = hash_is_valid(hash)) != CRYPT_OK) { in hash_memory_multi() 39 if (*outlen < hash_descriptor[hash]->hashsize) { in hash_memory_multi() 40 *outlen = hash_descriptor[hash]->hashsize; in hash_memory_multi() [all …]
|
| H A D | hash_filehandle.c | 8 Hash open files, Tom St Denis 12 Hash data from an open file handle. 13 @param hash The index of the hash you want to use 14 @param in The FILE* handle of the file you want to hash 19 int hash_filehandle(int hash, FILE *in, unsigned char *out, unsigned long *outlen) in hash_filehandle() argument 34 if ((err = hash_is_valid(hash)) != CRYPT_OK) { in hash_filehandle() 38 if (*outlen < hash_descriptor[hash]->hashsize) { in hash_filehandle() 39 *outlen = hash_descriptor[hash]->hashsize; in hash_filehandle() 43 if ((err = hash_descriptor[hash]->init(&md)) != CRYPT_OK) { in hash_filehandle() 49 if ((err = hash_descriptor[hash]->process(&md, buf, (unsigned long)x)) != CRYPT_OK) { in hash_filehandle() [all …]
|
| H A D | hash_file.c | 8 Hash a file, Tom St Denis 12 @param hash The index of the hash desired 13 @param fname The name of the file you wish to hash 18 int hash_file(int hash, const char *fname, unsigned char *out, unsigned long *outlen) in hash_file() argument 26 if ((err = hash_is_valid(hash)) != CRYPT_OK) { in hash_file() 35 err = hash_filehandle(hash, in, out, outlen); in hash_file()
|
| /optee_os/lib/libmbedtls/mbedtls/library/ |
| H A D | psa_crypto_hash.h | 14 /** Calculate the hash (digest) of a message using Mbed TLS routines. 21 * \param alg The hash algorithm to compute (\c PSA_ALG_XXX value 23 * \param[in] input Buffer containing the message to hash. 25 * \param[out] hash Buffer where the hash is to be written. 26 * \param hash_size Size of the \p hash buffer in bytes. 28 * that make up the hash value. This is always 44 uint8_t *hash, 48 /** Set up a multipart hash operation using Mbed TLS routines. 68 * \param alg The hash algorithm to compute (\c PSA_ALG_XXX value 84 /** Clone an Mbed TLS hash operation. [all …]
|
| /optee_os/core/lib/libtomcrypt/src/mac/hmac/ |
| H A D | hmac_done.c | 12 #define LTC_HMAC_BLOCKSIZE hash_descriptor[hash]->blocksize 25 int hash, err; in hmac_done() local 30 /* test hash */ in hmac_done() 31 hash = hmac->hash; in hmac_done() 32 if((err = hash_is_valid(hash)) != CRYPT_OK) { in hmac_done() 36 /* get the hash message digest size */ in hmac_done() 37 hashsize = hash_descriptor[hash]->hashsize; in hmac_done() 52 /* Get the hash of the first HMAC vector plus the data */ in hmac_done() 53 if ((err = hash_descriptor[hash]->done(&hmac->md, isha)) != CRYPT_OK) { in hmac_done() 62 /* Now calculate the "outer" hash for step (5), (6), and (7) */ in hmac_done() [all …]
|
| H A D | hmac_init.c | 12 #define LTC_HMAC_BLOCKSIZE hash_descriptor[hash]->blocksize 17 @param hash The index of the hash you want to use 22 int hmac_init(hmac_state *hmac, int hash, const unsigned char *key, unsigned long keylen) in hmac_init() argument 32 /* valid hash? */ in hmac_init() 33 if ((err = hash_is_valid(hash)) != CRYPT_OK) { in hmac_init() 36 hmac->hash = hash; in hmac_init() 37 hashsize = hash_descriptor[hash]->hashsize; in hmac_init() 50 /* check hash block fits */ in hmac_init() 59 if ((err = hash_memory(hash, key, keylen, hmac->key, &z)) != CRYPT_OK) { in hmac_init() 76 /* Pre-pend that to the hash data */ in hmac_init() [all …]
|
| H A D | hmac_memory.c | 14 @param hash The index of the hash to use 23 int hmac_memory(int hash, in hmac_memory() argument 36 /* make sure hash descriptor is valid */ in hmac_memory() 37 if ((err = hash_is_valid(hash)) != CRYPT_OK) { in hmac_memory() 42 if (hash_descriptor[hash]->hmac_block != NULL) { in hmac_memory() 43 return hash_descriptor[hash]->hmac_block(key, keylen, in, inlen, out, outlen); in hmac_memory() 53 if ((err = hmac_init(hmac, hash, key, keylen)) != CRYPT_OK) { in hmac_memory()
|
| /optee_os/core/drivers/crypto/stm32/ |
| H A D | hash.c | 21 struct stm32_hash_context hash; member 32 * Initialization of the Hash operation 40 return stm32_hash_init(&c->hash, NULL, 0); in do_hash_init() 44 * Update the Hash operation 47 * @data Data to hash 55 return stm32_hash_update(&c->hash, data, len); in do_hash_update() 59 * Finalize the Hash operation 62 * @digest [out] Hash digest buffer 73 if (len < stm32_hash_digest_size(&c->hash)) in do_hash_final() 76 res = stm32_hash_final(&c->hash, tmp_digest, NULL, 0); in do_hash_final() [all …]
|
| /optee_os/core/lib/libtomcrypt/src/pk/pkcs1/ |
| H A D | pkcs_1_pss_encode.c | 14 @param msghash The hash to encode 15 @param msghashlen The length of the hash (octets) 19 @param hash_idx The index of the hash desired 31 unsigned char *DB, *mask, *salt, *hash; in pkcs_1_pss_encode() local 40 /* ensure hash and PRNG are valid */ in pkcs_1_pss_encode() 57 /* allocate ram for DB/mask/salt/hash of size modulus_len */ in pkcs_1_pss_encode() 61 hash = XMALLOC(modulus_len); in pkcs_1_pss_encode() 62 if (DB == NULL || mask == NULL || salt == NULL || hash == NULL) { in pkcs_1_pss_encode() 72 if (hash != NULL) { in pkcs_1_pss_encode() 73 XFREE(hash); in pkcs_1_pss_encode() [all …]
|
| H A D | pkcs_1_pss_decode.c | 15 @param msghash The hash to verify 16 @param msghashlen The length of the hash (octets) 20 @param hash_idx The index of the hash desired 30 unsigned char *DB, *mask, *salt, *hash; in pkcs_1_pss_decode() local 41 /* ensure hash is valid */ in pkcs_1_pss_decode() 56 /* allocate ram for DB/mask/salt/hash of size modulus_len */ in pkcs_1_pss_decode() 60 hash = XMALLOC(modulus_len); in pkcs_1_pss_decode() 61 if (DB == NULL || mask == NULL || salt == NULL || hash == NULL) { in pkcs_1_pss_decode() 71 if (hash != NULL) { in pkcs_1_pss_decode() 72 XFREE(hash); in pkcs_1_pss_decode() [all …]
|
| /optee_os/core/lib/libtomcrypt/src/prngs/ |
| H A D | yarrow.c | 37 /* these are the default hash/cipher combo used */ in yarrow_start() 84 prng->u.yarrow.hash = register_hash(&sha256_desc); in yarrow_start() 86 prng->u.yarrow.hash = register_hash(&sha512_desc); in yarrow_start() 88 prng->u.yarrow.hash = register_hash(&tiger_desc); in yarrow_start() 90 prng->u.yarrow.hash = register_hash(&sha1_desc); in yarrow_start() 92 prng->u.yarrow.hash = register_hash(&rmd320_desc); in yarrow_start() 94 prng->u.yarrow.hash = register_hash(&rmd256_desc); in yarrow_start() 96 prng->u.yarrow.hash = register_hash(&rmd160_desc); in yarrow_start() 98 prng->u.yarrow.hash = register_hash(&rmd128_desc); in yarrow_start() 100 prng->u.yarrow.hash = register_hash(&md5_desc); in yarrow_start() [all …]
|
| /optee_os/core/lib/libtomcrypt/src/misc/crypt/ |
| H A D | crypt_register_hash.c | 7 Register a HASH, Tom St Denis 11 Register a hash with the descriptor table 12 @param hash The hash you wish to register 15 int register_hash(const struct ltc_hash_descriptor *hash) in register_hash() argument 19 LTC_ARGCHK(hash != NULL); in register_hash() 24 if (hash_descriptor[x] == hash) { in register_hash() 33 hash_descriptor[x] = hash; in register_hash()
|
| H A D | crypt_unregister_hash.c | 7 Unregister a hash, Tom St Denis 11 Unregister a hash from the descriptor table 12 @param hash The hash descriptor to remove 15 int unregister_hash(const struct ltc_hash_descriptor *hash) in unregister_hash() argument 19 LTC_ARGCHK(hash != NULL); in unregister_hash() 24 if (hash_descriptor[x] == hash) { in unregister_hash()
|
| /optee_os/core/drivers/crypto/caam/hash/ |
| H A D | local.h | 5 * CAAM hash/HMAC local header. 18 struct caambuf ctx; /* Hash context used by the CAAM */ 25 * Hash/HMAC algorithm definition 39 * Initialization of the hash/HMAC operation 46 * Update the hash/HMAC operation 49 * @data Data to hash 56 * Finalize the hash/HMAC operation 59 * @digest [out] Hash digest buffer 81 * Get hash/HMAC algorithm definition 83 * @algo Hash algorithm
|
| H A D | caam_hash.c | 31 * Constants definition of the hash/HMAC algorithm 85 * Format the hash context to keep the reference to the 89 struct crypto_hash_ctx hash_ctx; /* Crypto Hash API context */ 90 struct hashctx *ctx; /* Hash Context */ 94 * Keep the HW hash limit because after the initialization 152 * Initialization of the Hash operation 153 * Call common initialization operation between hash and HMAC 159 struct crypto_hash *hash = to_hash_ctx(ctx); in do_hash_init() local 161 return caam_hash_hmac_init(hash->ctx); in do_hash_init() 165 * Update the Hash operation [all …]
|
| /optee_os/ta/pkcs11/src/ |
| H A D | processing_rsa.c | 24 uint32_t hash = 0; in pkcs2tee_proc_params_rsa_pss() local 30 rc = serialargs_get_u32(&args, &hash); in pkcs2tee_proc_params_rsa_pss() 52 ctx->hash_alg = hash; in pkcs2tee_proc_params_rsa_pss() 95 * hLen is the length in bytes of the hash value. k* is the in pkcs2tee_validate_rsa_pss() 122 uint32_t hash = 0; in pkcs2tee_algo_rsa_pss() local 128 rc = serialargs_get_u32(&args, &hash); in pkcs2tee_algo_rsa_pss() 144 if (hash == PKCS11_CKM_SHA_1 && mgf == PKCS11_CKG_MGF1_SHA1) { in pkcs2tee_algo_rsa_pss() 148 if (hash == PKCS11_CKM_SHA224 && in pkcs2tee_algo_rsa_pss() 153 if (hash == PKCS11_CKM_SHA256 && in pkcs2tee_algo_rsa_pss() 158 if (hash == PKCS11_CKM_SHA384 && in pkcs2tee_algo_rsa_pss() [all …]
|
| /optee_os/core/lib/libtomcrypt/src/pk/rsa/ |
| H A D | rsa_verify_hash.c | 17 @param hash The hash of the message that was signed 18 @param hashlen The length of the hash of the message that was signed (octets) 20 @param hash_idx The index of the desired hash 27 const unsigned char *hash, unsigned long hashlen, in rsa_verify_hash_ex() argument 38 LTC_ARGCHK(hash != NULL); in rsa_verify_hash_ex() 56 /* valid hash ? */ in rsa_verify_hash_ex() 95 … err = pkcs_1_pss_decode(hash, hashlen, tmpbuf+1, x-1, saltlen, hash_idx, modulus_bitlen, stat); in rsa_verify_hash_ex() 98 err = pkcs_1_pss_decode(hash, hashlen, tmpbuf, x, saltlen, hash_idx, modulus_bitlen, stat); in rsa_verify_hash_ex() 112 /* allocate temp buffer for decoded hash */ in rsa_verify_hash_ex() 135 /* now we must decode out[0...outlen-1] using ASN.1, test the OID and then test the hash */ in rsa_verify_hash_ex() [all …]
|
| /optee_os/lib/libmbedtls/mbedtls/include/mbedtls/ |
| H A D | ecdsa.h | 132 * \note If the bitlength of the message hash is larger than the 133 * bitlength of the group order, then the hash is truncated 148 * \param buf The content to be signed. This is usually the hash of 175 * \note If the bitlength of the message hash is larger than the 176 * bitlength of the group order, then the hash is truncated as 196 * \param md_alg The hash algorithm used to hash the original data. 229 * \note If the bitlength of the message hash is larger 231 * hash is truncated as defined in <em>Standards for 295 * \note If the bitlength of the message hash is larger 297 * hash is truncated as defined in <em>Standards for [all …]
|
| /optee_os/core/lib/libtomcrypt/src/pk/dsa/ |
| H A D | dsa_verify_hash.c | 17 @param hash The hash that was signed 18 @param hashlen The length of the hash that was signed 24 const unsigned char *hash, unsigned long hashlen, in dsa_verify_hash_raw() argument 49 /* FIPS 186-4 4.7: use leftmost min(bitlen(q), bitlen(hash)) bits of 'hash' */ in dsa_verify_hash_raw() 56 …if ((err = mp_read_unsigned_bin(u1, (unsigned char *)hash, hashlen)) != CRYPT_OK) { goto erro… in dsa_verify_hash_raw() 83 @param hash The hash that was signed 84 @param hashlen The length of the hash that was signed 90 const unsigned char *hash, unsigned long hashlen, in dsa_verify_hash() argument 119 err = dsa_verify_hash_raw(r, s, hash, hashlen, stat, key); in dsa_verify_hash()
|
| /optee_os/lib/libutils/ext/ |
| H A D | fault_mitigation.c | 47 arg->hash ^= my_hash; in ___ftmn_callee_done() 48 arg->res = arg->hash ^ res; in ___ftmn_callee_done() 57 arg->hash ^= my_hash; in ___ftmn_callee_done_not_zero() 58 arg->res = arg->hash ^ res; in ___ftmn_callee_done_not_zero() 76 arg->hash ^= my_hash; in ___ftmn_callee_done_memcmp() 77 arg->res = arg->hash ^ res; in ___ftmn_callee_done_memcmp() 93 arg->hash ^= my_hash; in ___ftmn_callee_done_check() 94 arg->res = check->res ^ FTMN_DEFAULT_HASH ^ arg->hash; in ___ftmn_callee_done_check() 104 arg->res = arg->hash ^ res; in ___ftmn_callee_update_not_zero() 113 if ((arg->res ^ arg->hash) != res) in ___ftmn_copy_linked_call_res()
|