/optee_os-3.20.0/core/lib/libtomcrypt/src/mac/hmac/ |
A D | hmac_init.c | 22 int hmac_init(hmac_state *hmac, int hash, const unsigned char *key, unsigned long keylen) in hmac_init() argument 29 LTC_ARGCHK(hmac != NULL); in hmac_init() 36 hmac->hash = hash; in hmac_init() 51 if (sizeof(hmac->key) < LTC_HMAC_BLOCKSIZE) { in hmac_init() 59 if ((err = hash_memory(hash, key, keylen, hmac->key, &z)) != CRYPT_OK) { in hmac_init() 64 XMEMCPY(hmac->key, key, (size_t)keylen); in hmac_init() 68 zeromem((hmac->key) + keylen, (size_t)(LTC_HMAC_BLOCKSIZE - keylen)); in hmac_init() 73 buf[i] = hmac->key[i] ^ 0x36; in hmac_init() 77 if ((err = hash_descriptor[hash]->init(&hmac->md)) != CRYPT_OK) { in hmac_init() 81 if ((err = hash_descriptor[hash]->process(&hmac->md, buf, LTC_HMAC_BLOCKSIZE)) != CRYPT_OK) { in hmac_init()
|
A D | hmac_done.c | 21 int hmac_done(hmac_state *hmac, unsigned char *out, unsigned long *outlen) in hmac_done() argument 27 LTC_ARGCHK(hmac != NULL); in hmac_done() 31 hash = hmac->hash; in hmac_done() 53 if ((err = hash_descriptor[hash]->done(&hmac->md, isha)) != CRYPT_OK) { in hmac_done() 59 buf[i] = hmac->key[i] ^ 0x5C; in hmac_done() 63 if ((err = hash_descriptor[hash]->init(&hmac->md)) != CRYPT_OK) { in hmac_done() 66 if ((err = hash_descriptor[hash]->process(&hmac->md, buf, LTC_HMAC_BLOCKSIZE)) != CRYPT_OK) { in hmac_done() 69 if ((err = hash_descriptor[hash]->process(&hmac->md, isha, hashsize)) != CRYPT_OK) { in hmac_done() 72 if ((err = hash_descriptor[hash]->done(&hmac->md, buf)) != CRYPT_OK) { in hmac_done() 87 zeromem(hmac, sizeof(*hmac)); in hmac_done()
|
A D | hmac_memory.c | 28 hmac_state *hmac; in hmac_memory() local 48 hmac = XMALLOC(sizeof(hmac_state)); in hmac_memory() 49 if (hmac == NULL) { in hmac_memory() 53 if ((err = hmac_init(hmac, hash, key, keylen)) != CRYPT_OK) { in hmac_memory() 57 if ((err = hmac_process(hmac, in, inlen)) != CRYPT_OK) { in hmac_memory() 61 if ((err = hmac_done(hmac, out, outlen)) != CRYPT_OK) { in hmac_memory() 68 zeromem(hmac, sizeof(hmac_state)); in hmac_memory() 71 XFREE(hmac); in hmac_memory()
|
A D | hmac_memory_multi.c | 31 hmac_state *hmac; in hmac_memory_multi() local 43 hmac = XMALLOC(sizeof(hmac_state)); in hmac_memory_multi() 44 if (hmac == NULL) { in hmac_memory_multi() 48 if ((err = hmac_init(hmac, hash, key, keylen)) != CRYPT_OK) { in hmac_memory_multi() 57 if ((err = hmac_process(hmac, curptr, curlen)) != CRYPT_OK) { in hmac_memory_multi() 67 if ((err = hmac_done(hmac, out, outlen)) != CRYPT_OK) { in hmac_memory_multi() 72 zeromem(hmac, sizeof(hmac_state)); in hmac_memory_multi() 74 XFREE(hmac); in hmac_memory_multi()
|
A D | hmac_process.c | 19 int hmac_process(hmac_state *hmac, const unsigned char *in, unsigned long inlen) in hmac_process() argument 22 LTC_ARGCHK(hmac != NULL); in hmac_process() 24 if ((err = hash_is_valid(hmac->hash)) != CRYPT_OK) { in hmac_process() 27 return hash_descriptor[hmac->hash]->process(&hmac->md, in, inlen); in hmac_process()
|
A D | hmac_file.c | 35 hmac_state hmac; in hmac_file() 54 if ((err = hmac_init(&hmac, hash, key, keylen)) != CRYPT_OK) { in hmac_file() 66 if ((err = hmac_process(&hmac, buf, (unsigned long)x)) != CRYPT_OK) { in hmac_file() 77 err = hmac_done(&hmac, out, outlen); in hmac_file() 83 zeromem(&hmac, sizeof(hmac_state)); in hmac_file()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/misc/pkcs5/ |
A D | pkcs_5_2.c | 32 hmac_state *hmac; in pkcs_5_alg2() local 49 hmac = XMALLOC(sizeof(hmac_state)); in pkcs_5_alg2() 50 if (hmac == NULL || buf[0] == NULL) { in pkcs_5_alg2() 51 if (hmac != NULL) { in pkcs_5_alg2() 52 XFREE(hmac); in pkcs_5_alg2() 74 if ((err = hmac_init(hmac, hash_idx, password, password_len)) != CRYPT_OK) { in pkcs_5_alg2() 77 if ((err = hmac_process(hmac, salt, salt_len)) != CRYPT_OK) { in pkcs_5_alg2() 80 if ((err = hmac_process(hmac, buf[1], 4)) != CRYPT_OK) { in pkcs_5_alg2() 84 if ((err = hmac_done(hmac, buf[0], &x)) != CRYPT_OK) { in pkcs_5_alg2() 111 zeromem(hmac, sizeof(hmac_state)); in pkcs_5_alg2() [all …]
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/mac/ |
A D | sub.mk | 1 subdirs-$(_CFG_CORE_LTC_HMAC) += hmac
|
/optee_os-3.20.0/core/drivers/tpm2/ |
A D | tpm2_cmd.c | 331 if (pass_sz && (pass_sz > sizeof(cmd.hmac.buffer) || !passwd)) in tpm2_add_password_auth_cmd() 339 cmd.hmac.size = pass_sz; in tpm2_add_password_auth_cmd() 342 sizeof(cmd.session_attributes) + sizeof(cmd.hmac.size) + in tpm2_add_password_auth_cmd() 343 cmd.hmac.size; in tpm2_add_password_auth_cmd() 349 tpm2_cmd_add_u16(buf, buf_len, cmd.hmac.size); in tpm2_add_password_auth_cmd() 350 if (cmd.hmac.size) in tpm2_add_password_auth_cmd()
|
/optee_os-3.20.0/lib/libmbedtls/core/ |
A D | sub.mk | 20 srcs-$(CFG_CRYPTO_HMAC) += hmac.c
|
/optee_os-3.20.0/core/crypto/ |
A D | sub.mk | 33 srcs-$(CFG_CRYPTO_HMAC) += sm3-hmac.c
|
/optee_os-3.20.0/lib/libmbedtls/mbedtls/include/mbedtls/ |
A D | md.h | 215 int mbedtls_md_setup( mbedtls_md_context_t *ctx, const mbedtls_md_info_t *md_info, int hmac );
|
/optee_os-3.20.0/core/include/ |
A D | tpm2.h | 155 struct tpm2b_digest hmac; member
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/headers/ |
A D | tomcrypt_mac.h | 11 int hmac_init(hmac_state *hmac, int hash, const unsigned char *key, unsigned long keylen); 12 int hmac_process(hmac_state *hmac, const unsigned char *in, unsigned long inlen); 13 int hmac_done(hmac_state *hmac, unsigned char *out, unsigned long *outlen);
|
/optee_os-3.20.0/core/lib/libtomcrypt/ |
A D | sub.mk | 117 srcs-$(_CFG_CORE_LTC_HMAC) += hmac.c
|
/optee_os-3.20.0/lib/libmbedtls/mbedtls/library/ |
A D | md.c | 412 int mbedtls_md_setup( mbedtls_md_context_t *ctx, const mbedtls_md_info_t *md_info, int hmac ) in mbedtls_md_setup() argument 466 if( hmac != 0 ) in mbedtls_md_setup()
|
/optee_os-3.20.0/core/tee/ |
A D | tee_rpmb_fs.c | 946 uint8_t hmac[RPMB_KEY_MAC_SIZE]; in tee_rpmb_init_read_wr_cnt() local 988 rawdata.key_mac = hmac; in tee_rpmb_init_read_wr_cnt() 1202 uint8_t hmac[RPMB_KEY_MAC_SIZE]; in tee_rpmb_read() local 1264 rawdata.key_mac = hmac; in tee_rpmb_read() 1287 uint8_t hmac[RPMB_KEY_MAC_SIZE] = { }; in write_req() local 1305 rawdata.key_mac = hmac; in write_req() 1347 rawdata.key_mac = hmac; in write_req()
|