| /optee_os/core/lib/libtomcrypt/src/misc/pkcs5/ |
| H A D | pkcs_5_1.c | 35 int iteration_count, int hash_idx, in s_pkcs_5_alg1_common() argument 58 if ((err = hash_is_valid(hash_idx)) != CRYPT_OK) { in s_pkcs_5_alg1_common() 75 while(block * hash_descriptor[hash_idx]->hashsize < *outlen) { in s_pkcs_5_alg1_common() 78 if ((err = hash_descriptor[hash_idx]->init(md)) != CRYPT_OK) { in s_pkcs_5_alg1_common() 83 …if ((err = hash_descriptor[hash_idx]->process(md, buf, hash_descriptor[hash_idx]->hashsize)) != CR… in s_pkcs_5_alg1_common() 87 if ((err = hash_descriptor[hash_idx]->process(md, password, password_len)) != CRYPT_OK) { in s_pkcs_5_alg1_common() 90 if ((err = hash_descriptor[hash_idx]->process(md, salt, 8)) != CRYPT_OK) { in s_pkcs_5_alg1_common() 93 if ((err = hash_descriptor[hash_idx]->done(md, buf)) != CRYPT_OK) { in s_pkcs_5_alg1_common() 101 …if ((err = hash_memory(hash_idx, buf, hash_descriptor[hash_idx]->hashsize, buf, &x)) != CRYPT_OK) { in s_pkcs_5_alg1_common() 108 outidx = block*hash_descriptor[hash_idx]->hashsize; in s_pkcs_5_alg1_common() [all …]
|
| H A D | pkcs_5_2.c | 25 int iteration_count, int hash_idx, in pkcs_5_alg2() argument 44 if ((err = hash_is_valid(hash_idx)) != CRYPT_OK) { in pkcs_5_alg2() 74 if ((err = hmac_init(hmac, hash_idx, password, password_len)) != CRYPT_OK) { in pkcs_5_alg2() 91 … if ((err = hmac_memory(hash_idx, password, password_len, buf[0], x, buf[0], &x)) != CRYPT_OK) { in pkcs_5_alg2()
|
| /optee_os/core/lib/libtomcrypt/src/misc/hkdf/ |
| H A D | hkdf.c | 13 int hkdf_extract(int hash_idx, const unsigned char *salt, unsigned long saltlen, in hkdf_extract() argument 26 return hmac_memory(hash_idx, (const unsigned char *)"", 1, in, inlen, out, outlen); in hkdf_extract() 28 return hmac_memory(hash_idx, salt, saltlen, in, inlen, out, outlen); in hkdf_extract() 31 int hkdf_expand(int hash_idx, const unsigned char *info, unsigned long infolen, in hkdf_expand() argument 44 if ((err = hash_is_valid(hash_idx)) != CRYPT_OK) { in hkdf_expand() 48 hashsize = hash_descriptor[hash_idx]->hashsize; in hkdf_expand() 77 if ((err = hmac_memory(hash_idx, in, inlen, dat, datlen, in hkdf_expand() 102 int hkdf(int hash_idx, const unsigned char *salt, unsigned long saltlen, in hkdf() argument 112 if ((err = hash_is_valid(hash_idx)) != CRYPT_OK) { in hkdf() 116 hashsize = hash_descriptor[hash_idx]->hashsize; in hkdf() [all …]
|
| /optee_os/core/lib/libtomcrypt/src/pk/pkcs1/ |
| H A D | pkcs_1_mgf1.c | 21 int pkcs_1_mgf1(int hash_idx, in pkcs_1_mgf1() argument 35 if ((err = hash_is_valid(hash_idx)) != CRYPT_OK) { in pkcs_1_mgf1() 40 hLen = hash_descriptor[hash_idx]->hashsize; in pkcs_1_mgf1() 64 if ((err = hash_descriptor[hash_idx]->init(md)) != CRYPT_OK) { in pkcs_1_mgf1() 67 if ((err = hash_descriptor[hash_idx]->process(md, seed, seedlen)) != CRYPT_OK) { in pkcs_1_mgf1() 70 if ((err = hash_descriptor[hash_idx]->process(md, buf, 4)) != CRYPT_OK) { in pkcs_1_mgf1() 73 if ((err = hash_descriptor[hash_idx]->done(md, buf)) != CRYPT_OK) { in pkcs_1_mgf1()
|
| H A D | pkcs_1_pss_decode.c | 27 unsigned long saltlen, int hash_idx, in pkcs_1_pss_decode() argument 42 if ((err = hash_is_valid(hash_idx)) != CRYPT_OK) { in pkcs_1_pss_decode() 46 hLen = hash_descriptor[hash_idx]->hashsize; in pkcs_1_pss_decode() 99 if ((err = pkcs_1_mgf1(hash_idx, hash, hLen, mask, modulus_len - hLen - 1)) != CRYPT_OK) { in pkcs_1_pss_decode() 128 if ((err = hash_descriptor[hash_idx]->init(&md)) != CRYPT_OK) { in pkcs_1_pss_decode() 132 if ((err = hash_descriptor[hash_idx]->process(&md, mask, 8)) != CRYPT_OK) { in pkcs_1_pss_decode() 135 if ((err = hash_descriptor[hash_idx]->process(&md, msghash, msghashlen)) != CRYPT_OK) { in pkcs_1_pss_decode() 138 if ((err = hash_descriptor[hash_idx]->process(&md, DB+x, saltlen)) != CRYPT_OK) { in pkcs_1_pss_decode() 141 if ((err = hash_descriptor[hash_idx]->done(&md, mask)) != CRYPT_OK) { in pkcs_1_pss_decode()
|
| H A D | pkcs_1_pss_encode.c | 27 int prng_idx, int hash_idx, in pkcs_1_pss_encode() argument 41 if ((err = hash_is_valid(hash_idx)) != CRYPT_OK) { in pkcs_1_pss_encode() 48 hLen = hash_descriptor[hash_idx]->hashsize; in pkcs_1_pss_encode() 88 if ((err = hash_descriptor[hash_idx]->init(&md)) != CRYPT_OK) { in pkcs_1_pss_encode() 92 if ((err = hash_descriptor[hash_idx]->process(&md, DB, 8)) != CRYPT_OK) { in pkcs_1_pss_encode() 95 if ((err = hash_descriptor[hash_idx]->process(&md, msghash, msghashlen)) != CRYPT_OK) { in pkcs_1_pss_encode() 98 if ((err = hash_descriptor[hash_idx]->process(&md, salt, saltlen)) != CRYPT_OK) { in pkcs_1_pss_encode() 101 if ((err = hash_descriptor[hash_idx]->done(&md, hash)) != CRYPT_OK) { in pkcs_1_pss_encode() 114 if ((err = pkcs_1_mgf1(hash_idx, hash, hLen, mask, modulus_len - hLen - 1)) != CRYPT_OK) { in pkcs_1_pss_encode()
|
| /optee_os/core/lib/libtomcrypt/src/headers/ |
| H A D | tomcrypt_pkcs.h | 23 int pkcs_1_mgf1( int hash_idx, 65 int prng_idx, int hash_idx, 71 unsigned long saltlen, int hash_idx, 82 int iteration_count, int hash_idx, 90 int iteration_count, int hash_idx, 96 int iteration_count, int hash_idx,
|
| H A D | tomcrypt_misc.h | 59 unsigned int rounds, int hash_idx, 68 int hkdf_extract(int hash_idx, 73 int hkdf_expand(int hash_idx, 78 int hkdf(int hash_idx,
|
| H A D | tomcrypt_pk.h | 59 #define rsa_encrypt_key(in, inlen, out, outlen, lparam, lparamlen, prng, prng_idx, hash_idx, key) \ argument 60 …rsa_encrypt_key_ex(in, inlen, out, outlen, lparam, lparamlen, prng, prng_idx, hash_idx, -1, LTC_PK… 62 #define rsa_decrypt_key(in, inlen, out, outlen, lparam, lparamlen, hash_idx, stat, key) \ argument 63 …rsa_decrypt_key_ex(in, inlen, out, outlen, lparam, lparamlen, hash_idx, -1, LTC_PKCS_1_OAEP, stat,… 65 #define rsa_sign_hash(in, inlen, out, outlen, prng, prng_idx, hash_idx, saltlen, key) \ argument 66 rsa_sign_hash_ex(in, inlen, out, outlen, LTC_PKCS_1_PSS, prng, prng_idx, hash_idx, saltlen, key) 68 #define rsa_verify_hash(sig, siglen, hash, hashlen, hash_idx, saltlen, stat, key) \ argument 69 rsa_verify_hash_ex(sig, siglen, hash, hashlen, LTC_PKCS_1_PSS, hash_idx, saltlen, stat, key) 71 #define rsa_sign_saltlen_get_max(hash_idx, key) \ argument 72 rsa_sign_saltlen_get_max_ex(LTC_PKCS_1_PSS, hash_idx, key) [all …]
|
| H A D | tomcrypt_private.h | 66 int iteration_count, int hash_idx,
|
| /optee_os/core/lib/libtomcrypt/ |
| H A D | hmac.c | 18 int hash_idx; member 36 if (hmac_init(&hc->state, hc->hash_idx, key, len) == CRYPT_OK) in ltc_hmac_init() 73 assert(src->hash_idx == dst->hash_idx); in ltc_hmac_copy_state() 86 int hash_idx) in ltc_hmac_alloc_ctx() argument 90 if (hash_idx < 0) in ltc_hmac_alloc_ctx() 98 ctx->hash_idx = hash_idx; in ltc_hmac_alloc_ctx()
|
| /optee_os/core/lib/libtomcrypt/src/pk/rsa/ |
| H A D | rsa_sign_hash.c | 30 int hash_idx, unsigned long saltlen, in rsa_sign_hash_ex() argument 57 if ((err = hash_is_valid(hash_idx)) != CRYPT_OK) { in rsa_sign_hash_ex() 76 hash_idx, modulus_bitlen, out, &x)) != CRYPT_OK) { in rsa_sign_hash_ex() 86 if (hash_descriptor[hash_idx]->OIDlen == 0) { in rsa_sign_hash_ex() 98 …estinfo, 0, LTC_ASN1_OBJECT_IDENTIFIER, hash_descriptor[hash_idx]->OID, hash_descriptor[hash_idx]-… in rsa_sign_hash_ex()
|
| H A D | rsa_verify_hash.c | 29 int hash_idx, unsigned long saltlen, in rsa_verify_hash_ex() argument 57 if ((err = hash_is_valid(hash_idx)) != CRYPT_OK) { 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() 130 if (hash_descriptor[hash_idx]->OIDlen == 0) { in rsa_verify_hash_ex() 165 (digestinfo[0].size == hash_descriptor[hash_idx]->OIDlen) && in rsa_verify_hash_ex() 166 …XMEMCMP(digestinfo[0].data, hash_descriptor[hash_idx]->OID, sizeof(unsigned long) * hash_descripto… in rsa_verify_hash_ex()
|
| H A D | rsa_sign_saltlen_get.c | 19 int rsa_sign_saltlen_get_max_ex(int padding, int hash_idx, const rsa_key *key) in rsa_sign_saltlen_get_max_ex() argument 24 if ((hash_is_valid(hash_idx) == CRYPT_OK) && in rsa_sign_saltlen_get_max_ex() 30 ret -= (hash_descriptor[hash_idx]->hashsize + 2); in rsa_sign_saltlen_get_max_ex()
|
| /optee_os/core/lib/libtomcrypt/src/misc/pbes/ |
| H A D | pbes1.c | 9 int iteration_count, int hash_idx, in s_pkcs_5_alg1_wrap() argument 13 return pkcs_5_alg1(password, password_len, salt, iteration_count, hash_idx, out, outlen); in s_pkcs_5_alg1_wrap() 18 int iteration_count, int hash_idx, in s_pkcs_12_wrap() argument 32 …if ((err = pkcs12_kdf(hash_idx, pw, pwlen, salt, salt_len, iteration_count, 1, out, 24)) != CRYPT_… in s_pkcs_12_wrap() 34 …if ((err = pkcs12_kdf(hash_idx, pw, pwlen, salt, salt_len, iteration_count, 2, out+24, 8)) != CRYP… in s_pkcs_12_wrap()
|
| /optee_os/core/lib/libtomcrypt/src/misc/bcrypt/ |
| H A D | bcrypt.c | 77 unsigned int rounds, int hash_idx, in bcrypt_pbkdf_openbsd() argument 95 if ((err = hash_is_valid(hash_idx)) != CRYPT_OK) { in bcrypt_pbkdf_openbsd() 124 …if ((err = hash_memory(hash_idx, (unsigned char*)secret, secret_len, hashed_pass, &hashed_pass_len… in bcrypt_pbkdf_openbsd() 139 if ((err = hash_memory_multi(hash_idx, buf[0], &x, in bcrypt_pbkdf_openbsd() 154 if ((err = hash_memory(hash_idx, buf[1], y, buf[0], &x)) != CRYPT_OK) { in bcrypt_pbkdf_openbsd()
|
| /optee_os/core/lib/libtomcrypt/src/pk/ec25519/ |
| H A D | tweetnacl.c | 227 int hash_idx = find_hash("sha512"); in tweetnacl_crypto_hash_ctx() local 232 return hash_memory(hash_idx, m, n, out, &len); in tweetnacl_crypto_hash_ctx() 234 return hash_memory_multi(hash_idx, out, &len, ctx, cs, m, n, LTC_NULL); in tweetnacl_crypto_hash_ctx()
|