Home
last modified time | relevance | path

Searched refs:key (Results 1 – 25 of 474) sorted by relevance

12345678910>>...19

/optee_os/core/lib/libtomcrypt/src/pk/ecc/
H A Decc_set_curve_internal.c15 static void s_ecc_oid_lookup(ecc_key *key) in s_ecc_oid_lookup() argument
20 key->dp.oidlen = 0; in s_ecc_oid_lookup()
23 if (s_ecc_cmp_hex_bn(curve->prime, key->dp.prime, bn) != 1) continue; in s_ecc_oid_lookup()
24 if (s_ecc_cmp_hex_bn(curve->order, key->dp.order, bn) != 1) continue; in s_ecc_oid_lookup()
25 if (s_ecc_cmp_hex_bn(curve->A, key->dp.A, bn) != 1) continue; in s_ecc_oid_lookup()
26 if (s_ecc_cmp_hex_bn(curve->B, key->dp.B, bn) != 1) continue; in s_ecc_oid_lookup()
27 if (s_ecc_cmp_hex_bn(curve->Gx, key->dp.base.x, bn) != 1) continue; in s_ecc_oid_lookup()
28 if (s_ecc_cmp_hex_bn(curve->Gy, key->dp.base.y, bn) != 1) continue; in s_ecc_oid_lookup()
29 if (key->dp.cofactor != curve->cofactor) continue; in s_ecc_oid_lookup()
34 key->dp.oidlen = 16; /* size of key->dp.oid */ in s_ecc_oid_lookup()
[all …]
H A Decc_set_curve.c8 int ecc_set_curve(const ltc_ecc_curve *cu, ecc_key *key) in ecc_set_curve() argument
12 LTC_ARGCHK(key != NULL); in ecc_set_curve()
15 if ((err = mp_init_multi(&key->dp.prime, &key->dp.order, &key->dp.A, &key->dp.B, in ecc_set_curve()
16 &key->dp.base.x, &key->dp.base.y, &key->dp.base.z, in ecc_set_curve()
17 &key->pubkey.x, &key->pubkey.y, &key->pubkey.z, &key->k, in ecc_set_curve()
23 if ((err = mp_read_radix(key->dp.prime, cu->prime, 16)) != CRYPT_OK) { goto error; } in ecc_set_curve()
24 if ((err = mp_read_radix(key->dp.order, cu->order, 16)) != CRYPT_OK) { goto error; } in ecc_set_curve()
25 if ((err = mp_read_radix(key->dp.A, cu->A, 16)) != CRYPT_OK) { goto error; } in ecc_set_curve()
26 if ((err = mp_read_radix(key->dp.B, cu->B, 16)) != CRYPT_OK) { goto error; } in ecc_set_curve()
27 if ((err = mp_read_radix(key->dp.base.x, cu->Gx, 16)) != CRYPT_OK) { goto error; } in ecc_set_curve()
[all …]
H A Decc_make_key.c21 int ecc_make_key(prng_state *prng, int wprng, int keysize, ecc_key *key) in ecc_make_key() argument
25 if ((err = ecc_set_curve_by_size(keysize, key)) != CRYPT_OK) { return err; } in ecc_make_key()
26 if ((err = ecc_generate_key(prng, wprng, key)) != CRYPT_OK) { return err; } in ecc_make_key()
30 int ecc_make_key_ex(prng_state *prng, int wprng, ecc_key *key, const ltc_ecc_curve *cu) in ecc_make_key_ex() argument
33 if ((err = ecc_set_curve(cu, key)) != CRYPT_OK) { return err; } in ecc_make_key_ex()
34 if ((err = ecc_generate_key(prng, wprng, key)) != CRYPT_OK) { return err; } in ecc_make_key_ex()
38 int ecc_generate_key(prng_state *prng, int wprng, ecc_key *key) in ecc_generate_key() argument
43 LTC_ARGCHK(key != NULL); in ecc_generate_key()
44 LTC_ARGCHK(key->dp.size > 0); in ecc_generate_key()
53 if ((err = rand_bn_upto(key->k, key->dp.order, prng, wprng)) != CRYPT_OK) { in ecc_generate_key()
[all …]
H A Decc_set_key.c8 int ecc_set_key(const unsigned char *in, unsigned long inlen, int type, ecc_key *key) in ecc_set_key() argument
13 LTC_ARGCHK(key != NULL); in ecc_set_key()
17 prime = key->dp.prime; in ecc_set_key()
18 a = key->dp.A; in ecc_set_key()
19 b = key->dp.B; in ecc_set_key()
23 if ((err = mp_read_unsigned_bin(key->k, (unsigned char *)in, inlen)) != CRYPT_OK) { in ecc_set_key()
26 if (mp_iszero(key->k) || (mp_cmp(key->k, key->dp.order) != LTC_MP_LT)) { in ecc_set_key()
31 …if ((err = ltc_mp.ecc_ptmul(key->k, &key->dp.base, &key->pubkey, a, prime, 1)) != CRYPT_OK) … in ecc_set_key()
35 …if ((err = ltc_ecc_import_point(in, inlen, prime, a, b, key->pubkey.x, key->pubkey.y)) != CRYPT_OK… in ecc_set_key()
36 …if ((err = mp_set(key->pubkey.z, 1)) != CRYPT_OK) … in ecc_set_key()
[all …]
H A Decc_free.c17 void ecc_free(ecc_key *key) in ecc_free() argument
19 LTC_ARGCHKVD(key != NULL); in ecc_free()
21 mp_cleanup_multi(&key->dp.prime, &key->dp.order, in ecc_free()
22 &key->dp.A, &key->dp.B, in ecc_free()
23 &key->dp.base.x, &key->dp.base.y, &key->dp.base.z, in ecc_free()
24 &key->pubkey.x, &key->pubkey.y, &key->pubkey.z, in ecc_free()
25 &key->k, NULL); in ecc_free()
H A Dltc_ecc_verify_key.c16 int ltc_ecc_verify_key(const ecc_key *key) in ltc_ecc_verify_key() argument
20 void *prime = key->dp.prime; in ltc_ecc_verify_key()
21 void *order = key->dp.order; in ltc_ecc_verify_key()
22 void *a = key->dp.A; in ltc_ecc_verify_key()
25 if (ltc_mp.compare_d(key->pubkey.z, 1) == LTC_MP_EQ) { in ltc_ecc_verify_key()
26 if ((ltc_mp.compare(key->pubkey.x, prime) != LTC_MP_LT) || in ltc_ecc_verify_key()
27 (ltc_mp.compare(key->pubkey.y, prime) != LTC_MP_LT) || in ltc_ecc_verify_key()
28 (ltc_mp.compare_d(key->pubkey.x, 0) == LTC_MP_LT) || in ltc_ecc_verify_key()
29 (ltc_mp.compare_d(key->pubkey.y, 0) == LTC_MP_LT) || in ltc_ecc_verify_key()
30 (mp_iszero(key->pubkey.x) && mp_iszero(key->pubkey.y)) in ltc_ecc_verify_key()
[all …]
/optee_os/core/lib/libtomcrypt/src/pk/rsa/
H A Drsa_key.c76 void rsa_shrink_key(rsa_key *key) in rsa_shrink_key() argument
78 LTC_ARGCHKVD(key != NULL); in rsa_shrink_key()
79 …s_mpi_shrink_multi(&key->e, &key->d, &key->N, &key->dQ, &key->dP, &key->qP, &key->p, &key->q, NULL… in rsa_shrink_key()
87 int rsa_init(rsa_key *key) in rsa_init() argument
89 LTC_ARGCHK(key != NULL); in rsa_init()
90 …return mp_init_multi(&key->e, &key->d, &key->N, &key->dQ, &key->dP, &key->qP, &key->p, &key->q, LT… in rsa_init()
97 void rsa_free(rsa_key *key) in rsa_free() argument
99 LTC_ARGCHKVD(key != NULL); in rsa_free()
100 …mp_cleanup_multi(&key->q, &key->p, &key->qP, &key->dP, &key->dQ, &key->N, &key->d, &key->e, LTC_NU… in rsa_free()
H A Drsa_exptmod.c25 const rsa_key *key) in rsa_exptmod() argument
37 LTC_ARGCHK(key != NULL); in rsa_exptmod()
40 if (which == PK_PRIVATE && (key->type != PK_PRIVATE)) { in rsa_exptmod()
61 if (mp_cmp(key->N, tmp) == LTC_MP_LT) { in rsa_exptmod()
70 err = mp_rand(rnd, mp_get_digit_count(key->N)); in rsa_exptmod()
76 err = mp_invmod(rnd, key->N, rndi); in rsa_exptmod()
82 err = mp_exptmod( rnd, key->e, key->N, rnd); in rsa_exptmod()
88 err = mp_mulmod( tmp, rnd, key->N, tmp); in rsa_exptmod()
94 has_crt_parameters = (key->p != NULL) && (mp_get_digit_count(key->p) != 0) && in rsa_exptmod()
95 (key->q != NULL) && (mp_get_digit_count(key->q) != 0) && in rsa_exptmod()
[all …]
H A Drsa_set.c23 rsa_key *key) in rsa_set_key() argument
27 LTC_ARGCHK(key != NULL); in rsa_set_key()
32 if ((err = rsa_init(key)) != CRYPT_OK) return err; in rsa_set_key()
34 …if ((err = mp_read_unsigned_bin(key->N , (unsigned char *)N , Nlen)) != CRYPT_OK) { goto LBL_ER… in rsa_set_key()
35 …if ((err = mp_read_unsigned_bin(key->e , (unsigned char *)e , elen)) != CRYPT_OK) { goto LBL_ER… in rsa_set_key()
37 …if ((err = mp_read_unsigned_bin(key->d , (unsigned char *)d , dlen)) != CRYPT_OK) { goto LBL_ERR; } in rsa_set_key()
38 key->type = PK_PRIVATE; in rsa_set_key()
41 key->type = PK_PUBLIC; in rsa_set_key()
46 rsa_free(key); in rsa_set_key()
64 rsa_key *key) in rsa_set_factors() argument
[all …]
H A Drsa_import.c24 int rsa_import_pkcs1(const unsigned char *in, unsigned long inlen, rsa_key *key) in rsa_import_pkcs1() argument
37 LTC_ASN1_INTEGER, 1UL, key->N, in rsa_import_pkcs1()
38 LTC_ASN1_INTEGER, 1UL, key->e, in rsa_import_pkcs1()
40 key->type = PK_PUBLIC; in rsa_import_pkcs1()
52 LTC_ASN1_INTEGER, 1UL, key->N, in rsa_import_pkcs1()
53 LTC_ASN1_INTEGER, 1UL, key->e, in rsa_import_pkcs1()
54 LTC_ASN1_INTEGER, 1UL, key->d, in rsa_import_pkcs1()
55 LTC_ASN1_INTEGER, 1UL, key->p, in rsa_import_pkcs1()
56 LTC_ASN1_INTEGER, 1UL, key->q, in rsa_import_pkcs1()
57 LTC_ASN1_INTEGER, 1UL, key->dP, in rsa_import_pkcs1()
[all …]
/optee_os/core/lib/libtomcrypt/src/pk/dsa/
H A Ddsa_verify_key.c23 int dsa_verify_key(const dsa_key *key, int *stat) in dsa_verify_key() argument
27 err = dsa_int_validate_primes(key, stat); in dsa_verify_key()
30 err = dsa_int_validate_pqg(key, stat); in dsa_verify_key()
33 return dsa_int_validate_xy(key, stat); in dsa_verify_key()
44 int dsa_int_validate_pqg(const dsa_key *key, int *stat) in dsa_int_validate_pqg() argument
49 LTC_ARGCHK(key != NULL); in dsa_int_validate_pqg()
54 if ( key->qord >= LTC_MDSA_MAX_GROUP || key->qord <= 15 || in dsa_int_validate_pqg()
55 (unsigned long)key->qord >= mp_unsigned_bin_size(key->p) || in dsa_int_validate_pqg()
56 (mp_unsigned_bin_size(key->p) - key->qord) >= LTC_MDSA_DELTA ) { in dsa_int_validate_pqg()
61 if (mp_cmp_d(key->g, 1) != LTC_MP_GT || mp_cmp(key->g, key->p) != LTC_MP_LT) { in dsa_int_validate_pqg()
[all …]
H A Ddsa_set.c22 dsa_key *key) in dsa_set_pqg() argument
29 LTC_ARGCHK(key != NULL); in dsa_set_pqg()
33 err = mp_init_multi(&key->p, &key->g, &key->q, &key->x, &key->y, LTC_NULL); in dsa_set_pqg()
36 … if ((err = mp_read_unsigned_bin(key->p, (unsigned char *)p , plen)) != CRYPT_OK) { goto LBL_ERR; } in dsa_set_pqg()
37 … if ((err = mp_read_unsigned_bin(key->g, (unsigned char *)g , glen)) != CRYPT_OK) { goto LBL_ERR; } in dsa_set_pqg()
38 … if ((err = mp_read_unsigned_bin(key->q, (unsigned char *)q , qlen)) != CRYPT_OK) { goto LBL_ERR; } in dsa_set_pqg()
40 key->qord = mp_unsigned_bin_size(key->q); in dsa_set_pqg()
43 … if ((err = dsa_int_validate_pqg(key, &stat)) != CRYPT_OK) { goto LBL_ERR; } in dsa_set_pqg()
52 dsa_free(key); in dsa_set_pqg()
67 int dsa_set_key(const unsigned char *in, unsigned long inlen, int type, dsa_key *key) in dsa_set_key() argument
[all …]
H A Ddsa_import.c19 int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key) in dsa_import() argument
27 LTC_ARGCHK(key != NULL); in dsa_import()
31 if (mp_init_multi(&key->p, &key->g, &key->q, &key->x, &key->y, LTC_NULL) != CRYPT_OK) { in dsa_import()
44 LTC_ASN1_INTEGER, 1UL, key->g, in dsa_import()
45 LTC_ASN1_INTEGER, 1UL, key->p, in dsa_import()
46 LTC_ASN1_INTEGER, 1UL, key->q, in dsa_import()
47 LTC_ASN1_INTEGER, 1UL, key->y, in dsa_import()
48 LTC_ASN1_INTEGER, 1UL, key->x, in dsa_import()
52 key->type = PK_PRIVATE; in dsa_import()
59 LTC_ASN1_INTEGER, 1UL, key->g, in dsa_import()
[all …]
H A Ddsa_export.c20 int dsa_export(unsigned char *out, unsigned long *outlen, int type, const dsa_key *key) in dsa_export() argument
28 LTC_ARGCHK(key != NULL); in dsa_export()
33 if (type == PK_PRIVATE && key->type != PK_PRIVATE) { in dsa_export()
41 LTC_ASN1_INTEGER, 1UL, key->p, in dsa_export()
42 LTC_ASN1_INTEGER, 1UL, key->q, in dsa_export()
43 LTC_ASN1_INTEGER, 1UL, key->g, in dsa_export()
44 LTC_ASN1_INTEGER, 1UL, key->y, in dsa_export()
45 LTC_ASN1_INTEGER, 1UL, key->x, in dsa_export()
51 LTC_ASN1_INTEGER, 1UL, key->g, in dsa_export()
52 LTC_ASN1_INTEGER, 1UL, key->p, in dsa_export()
[all …]
H A Ddsa_set_pqg_dsaparam.c19 dsa_key *key) in dsa_set_pqg_dsaparam() argument
24 LTC_ARGCHK(key != NULL); in dsa_set_pqg_dsaparam()
28 err = mp_init_multi(&key->p, &key->g, &key->q, &key->x, &key->y, LTC_NULL); in dsa_set_pqg_dsaparam()
32 LTC_ASN1_INTEGER, 1UL, key->p, in dsa_set_pqg_dsaparam()
33 LTC_ASN1_INTEGER, 1UL, key->q, in dsa_set_pqg_dsaparam()
34 LTC_ASN1_INTEGER, 1UL, key->g, in dsa_set_pqg_dsaparam()
39 key->qord = mp_unsigned_bin_size(key->q); in dsa_set_pqg_dsaparam()
42 if ((err = dsa_int_validate_pqg(key, &stat)) != CRYPT_OK) { in dsa_set_pqg_dsaparam()
53 dsa_free(key); in dsa_set_pqg_dsaparam()
/optee_os/core/lib/libtomcrypt/src/pk/dh/
H A Ddh_set.c20 dh_key *key) in dh_set_pg() argument
24 LTC_ARGCHK(key != NULL); in dh_set_pg()
29 if ((err = mp_init_multi(&key->x, &key->y, &key->base, &key->prime, LTC_NULL)) != CRYPT_OK) { in dh_set_pg()
33 …if ((err = mp_read_unsigned_bin(key->base, (unsigned char*)g, glen)) != CRYPT_OK) { goto LBL_E… in dh_set_pg()
34 …if ((err = mp_read_unsigned_bin(key->prime, (unsigned char*)p, plen)) != CRYPT_OK) { goto LBL_ERR… in dh_set_pg()
39 dh_free(key); in dh_set_pg()
50 int dh_set_pg_groupsize(int groupsize, dh_key *key) in dh_set_pg_groupsize() argument
54 LTC_ARGCHK(key != NULL); in dh_set_pg_groupsize()
61 if ((err = mp_init_multi(&key->x, &key->y, &key->base, &key->prime, LTC_NULL)) != CRYPT_OK) { in dh_set_pg_groupsize()
64 if ((err = mp_read_radix(key->base, ltc_dh_sets[i].base, 16)) != CRYPT_OK) { goto LBL_ERR; } in dh_set_pg_groupsize()
[all …]
H A Ddh_import.c15 int dh_import(const unsigned char *in, unsigned long inlen, dh_key *key) in dh_import() argument
22 LTC_ARGCHK(key != NULL); in dh_import()
25 if ((err = mp_init_multi(&key->x, &key->y, &key->base, &key->prime, LTC_NULL)) != CRYPT_OK) { in dh_import()
40 key->type = PK_PRIVATE; in dh_import()
44 LTC_ASN1_INTEGER, 1UL, key->prime, in dh_import()
45 LTC_ASN1_INTEGER, 1UL, key->base, in dh_import()
46 LTC_ASN1_INTEGER, 1UL, key->x, in dh_import()
51 if ((err = mp_exptmod(key->base, key->x, key->prime, key->y)) != CRYPT_OK) { in dh_import()
56 key->type = PK_PUBLIC; in dh_import()
60 LTC_ASN1_INTEGER, 1UL, key->prime, in dh_import()
[all …]
H A Ddh_make_key.c49 int dh_make_key(prng_state *prng, int wprng, void *q, int xbits, dh_key *key) in dh_make_key() argument
61 LTC_ARGCHK(key != NULL); in dh_make_key()
62 LTC_ARGCHK(key->base != NULL); in dh_make_key()
63 LTC_ARGCHK(key->prime != NULL); in dh_make_key()
75 key_size_p = mp_unsigned_bin_size(key->prime); in dh_make_key()
93 arg_mod = key->prime; in dh_make_key()
96 key->x = NULL; in dh_make_key()
97 key->y = NULL; in dh_make_key()
98 err = mp_init_multi(&key->x, &key->y, NULL); in dh_make_key()
119 err = mp_read_unsigned_bin(key->y, buf, key_size); in dh_make_key()
[all …]
/optee_os/core/drivers/crypto/caam/
H A Dcaam_key.c91 uint8_t key[]; member
136 struct caam_key_serialized *key = data_to_serialized_key(data, size); in get_key_type() local
138 if (key->magic_number != MAGIC_NUMBER) in get_key_type()
141 return key->key_type; in get_key_type()
152 struct caam_key_serialized *key = data_to_serialized_key(data, size); in get_key_sec_size() local
154 if (key->magic_number != MAGIC_NUMBER) in get_key_sec_size()
157 return key->sec_size; in get_key_sec_size()
168 struct caam_key_serialized *key = data_to_serialized_key(data, size); in get_key_buf_offset() local
170 if (key->magic_number != MAGIC_NUMBER) in get_key_buf_offset()
173 return offsetof(struct caam_key_serialized, key); in get_key_buf_offset()
[all …]
/optee_os/core/drivers/crypto/crypto_api/acipher/
H A Drsa.c17 TEE_Result crypto_acipher_alloc_rsa_keypair(struct rsa_keypair *key, in crypto_acipher_alloc_rsa_keypair() argument
24 if (!key || !size_bits) { in crypto_acipher_alloc_rsa_keypair()
25 CRYPTO_TRACE("Parameters error (key @%p) (size %zu bits)", key, in crypto_acipher_alloc_rsa_keypair()
32 ret = rsa->alloc_keypair(key, size_bits); in crypto_acipher_alloc_rsa_keypair()
39 TEE_Result crypto_acipher_alloc_rsa_public_key(struct rsa_public_key *key, in crypto_acipher_alloc_rsa_public_key() argument
45 if (!key || !size_bits) { in crypto_acipher_alloc_rsa_public_key()
46 CRYPTO_TRACE("Parameters error (key @%p) (size %zu bits)", key, in crypto_acipher_alloc_rsa_public_key()
53 ret = rsa->alloc_publickey(key, size_bits); in crypto_acipher_alloc_rsa_public_key()
60 void crypto_acipher_free_rsa_public_key(struct rsa_public_key *key) in crypto_acipher_free_rsa_public_key() argument
64 if (key) { in crypto_acipher_free_rsa_public_key()
[all …]
/optee_os/core/lib/libtomcrypt/src/ciphers/safer/
H A Dsafer.c98 safer_key_t key) in s_safer_expand_userkey() argument
104 safer_key_t key) in s_safer_expand_userkey()
113 *key++ = (unsigned char)nof_rounds; in s_safer_expand_userkey()
120 kb[j] = *key++ = userkey_2[j]; in s_safer_expand_userkey()
134 *key++ = (ka[k] in s_safer_expand_userkey()
138 *key++ = (ka[j] + safer_ebox[(int)safer_ebox[(int)((18 * i + j + 1)&0xFF)]]) & 0xFF; in s_safer_expand_userkey()
147 *key++ = (kb[k] in s_safer_expand_userkey()
151 … *key++ = (kb[j] + safer_ebox[(int)safer_ebox[(int)((18 * i + j + 10)&0xFF)]]) & 0xFF; in s_safer_expand_userkey()
167 safer_key_t key) in safer_expand_userkey() argument
169 s_safer_expand_userkey(userkey_1, userkey_2, nof_rounds, strengthened, key); in safer_expand_userkey()
[all …]
/optee_os/core/lib/libtomcrypt/
H A Ded25519.c19 TEE_Result crypto_acipher_alloc_ed25519_keypair(struct ed25519_keypair *key, in crypto_acipher_alloc_ed25519_keypair() argument
22 if (!key || key_size != ED25519_KEY_SIZE) in crypto_acipher_alloc_ed25519_keypair()
25 memset(key, 0, sizeof(*key)); in crypto_acipher_alloc_ed25519_keypair()
27 key->priv = calloc(1, key_size >> 3); in crypto_acipher_alloc_ed25519_keypair()
28 key->pub = calloc(1, key_size >> 3); in crypto_acipher_alloc_ed25519_keypair()
30 if (!key->priv || !key->pub) { in crypto_acipher_alloc_ed25519_keypair()
31 free(key->priv); in crypto_acipher_alloc_ed25519_keypair()
32 free(key->pub); in crypto_acipher_alloc_ed25519_keypair()
40 crypto_acipher_alloc_ed25519_public_key(struct ed25519_public_key *key, in crypto_acipher_alloc_ed25519_public_key() argument
43 if (!key || key_size != ED25519_KEY_SIZE) in crypto_acipher_alloc_ed25519_public_key()
[all …]
/optee_os/core/drivers/crypto/versal/
H A Drsa.c31 struct rsa_public_key *p = rsa_data->key.key; in do_encrypt()
35 struct versal_mbox_mem key = { }; in do_encrypt() local
44 rsa_data->key.key, in do_encrypt()
54 rsa_data->key.key, in do_encrypt()
63 return sw_crypto_acipher_rsanopad_encrypt(rsa_data->key.key, in do_encrypt()
70 assert(rsa_data->key.n_size != 128); in do_encrypt()
77 versal_mbox_alloc(RSA_MAX_MOD_LEN + RSA_MAX_PUB_EXP_LEN, NULL, &key); in do_encrypt()
78 crypto_bignum_bn2bin_pad(rsa_data->key.n_size, p->n, key.buf); in do_encrypt()
80 p->e, (uint8_t *)key.buf + RSA_MAX_MOD_LEN); in do_encrypt()
88 cmd->key_len = rsa_data->key.n_size; in do_encrypt()
[all …]
/optee_os/core/drivers/crypto/hisilicon/
H A Dhpre_dh.c20 static TEE_Result hpre_dh_alloc_keypair(struct dh_keypair *key, in hpre_dh_alloc_keypair() argument
23 if (!key || !size_bits) { in hpre_dh_alloc_keypair()
28 memset(key, 0, sizeof(*key)); in hpre_dh_alloc_keypair()
29 key->g = crypto_bignum_allocate(size_bits); in hpre_dh_alloc_keypair()
30 if (!key->g) in hpre_dh_alloc_keypair()
33 key->p = crypto_bignum_allocate(size_bits); in hpre_dh_alloc_keypair()
34 if (!key->p) in hpre_dh_alloc_keypair()
37 key->x = crypto_bignum_allocate(size_bits); in hpre_dh_alloc_keypair()
38 if (!key->x) in hpre_dh_alloc_keypair()
41 key->y = crypto_bignum_allocate(size_bits); in hpre_dh_alloc_keypair()
[all …]
/optee_os/core/lib/libtomcrypt/src/headers/
H A Dtomcrypt_pk.h47 int rsa_make_key(prng_state *prng, int wprng, int size, long e, rsa_key *key);
49 const unsigned char *e, unsigned long elen, rsa_key *key);
50 int rsa_get_size(const rsa_key *key);
54 const rsa_key *key);
56 void rsa_free(rsa_key *key);
59 #define rsa_encrypt_key(in, inlen, out, outlen, lparam, lparamlen, prng, prng_idx, hash_idx, key) \ argument
60 …y_ex(in, inlen, out, outlen, lparam, lparamlen, prng, prng_idx, hash_idx, -1, LTC_PKCS_1_OAEP, key)
62 #define rsa_decrypt_key(in, inlen, out, outlen, lparam, lparamlen, hash_idx, stat, key) \ argument
63 …decrypt_key_ex(in, inlen, out, outlen, lparam, lparamlen, hash_idx, -1, LTC_PKCS_1_OAEP, stat, key)
65 #define rsa_sign_hash(in, inlen, out, outlen, prng, prng_idx, hash_idx, saltlen, key) \ argument
[all …]

12345678910>>...19