Home
last modified time | relevance | path

Searched refs:pubkey (Results 1 – 25 of 31) sorted by relevance

12

/optee_os/core/pta/veraison_attestation/
H A Dsign.c18 static struct ecc_public_key *pubkey; variable
99 if (!pubkey) in free_pubkey()
102 crypto_bignum_free(&pubkey->x); in free_pubkey()
103 crypto_bignum_free(&pubkey->y); in free_pubkey()
105 free_wipe(pubkey); in free_pubkey()
106 pubkey = NULL; in free_pubkey()
133 assert(!pubkey); in generate_key()
134 pubkey = calloc(1, sizeof(*pubkey)); in generate_key()
135 if (!pubkey) { in generate_key()
139 res = crypto_acipher_alloc_ecc_public_key(pubkey, in generate_key()
[all …]
/optee_os/core/lib/libtomcrypt/src/pk/ecc/
H A Dltc_ecc_verify_key.c25 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()
39 …if ((err = ltc_ecc_is_point(&key->dp, key->pubkey.x, key->pubkey.y)) != CRYPT_OK) { goto done… in ltc_ecc_verify_key()
43 …if ((err = ltc_ecc_mulmod(order, &(key->pubkey), point, a, prime, 1)) != CRYPT_OK) { goto done… in ltc_ecc_verify_key()
H A Decc_sign_hash.c31 ecc_key pubkey; in ecc_sign_hash_ex() local
75 if ((err = ecc_copy_curve(key, &pubkey)) != CRYPT_OK) { goto errnokey; } in ecc_sign_hash_ex()
76 if ((err = ecc_generate_key(prng, wprng, &pubkey)) != CRYPT_OK) { goto errnokey; } in ecc_sign_hash_ex()
79 if ((err = mp_mod(pubkey.pubkey.x, p, r)) != CRYPT_OK) { goto error; } in ecc_sign_hash_ex()
84 if (mp_copy(pubkey.pubkey.x, s) != CRYPT_OK) { goto error; } in ecc_sign_hash_ex()
90 if (mp_isodd(pubkey.pubkey.y)) v += 1; in ecc_sign_hash_ex()
94 ecc_free(&pubkey); in ecc_sign_hash_ex()
98 … if ((err = mp_mulmod(pubkey.k, b, p, pubkey.k)) != CRYPT_OK) { goto error; } /* k = kb */ in ecc_sign_hash_ex()
99 … if ((err = mp_invmod(pubkey.k, p, pubkey.k)) != CRYPT_OK) { goto error; } /* k = 1/kb */ in ecc_sign_hash_ex()
101 … if ((err = mp_mulmod(pubkey.k, s, p, s)) != CRYPT_OK) { goto error; } /* s = xr/kb */ in ecc_sign_hash_ex()
[all …]
H A Decc_encrypt_key.c31 ecc_key pubkey; in ecc_encrypt_key() local
49 if ((err = ecc_copy_curve(key, &pubkey)) != CRYPT_OK) { return err; } in ecc_encrypt_key()
50 if ((err = ecc_generate_key(prng, wprng, &pubkey)) != CRYPT_OK) { return err; } in ecc_encrypt_key()
65 ecc_free(&pubkey); in ecc_encrypt_key()
72 err = ecc_get_key(pub_expt, &pubkeysize, PK_PUBLIC|PK_COMPRESSED, &pubkey); in ecc_encrypt_key()
75 err = ecc_get_key(pub_expt, &pubkeysize, PK_PUBLIC, &pubkey); in ecc_encrypt_key()
78 ecc_free(&pubkey); in ecc_encrypt_key()
84 if ((err = ecc_shared_secret(&pubkey, key, ecc_shared, &x)) != CRYPT_OK) { in ecc_encrypt_key()
85 ecc_free(&pubkey); in ecc_encrypt_key()
88 ecc_free(&pubkey); in ecc_encrypt_key()
H A Decc_export.c44 LTC_ASN1_INTEGER, 1UL, key->pubkey.x, in ecc_export()
45 LTC_ASN1_INTEGER, 1UL, key->pubkey.y, in ecc_export()
53 LTC_ASN1_INTEGER, 1UL, key->pubkey.x, in ecc_export()
54 LTC_ASN1_INTEGER, 1UL, key->pubkey.y, in ecc_export()
H A Decc_import.c64 LTC_ASN1_INTEGER, 1UL, key->pubkey.x, in ecc_import_ex()
65 LTC_ASN1_INTEGER, 1UL, key->pubkey.y, in ecc_import_ex()
76 LTC_ASN1_INTEGER, 1UL, key->pubkey.x, in ecc_import_ex()
77 LTC_ASN1_INTEGER, 1UL, key->pubkey.y, in ecc_import_ex()
88 if ((err = mp_set(key->pubkey.z, 1)) != CRYPT_OK) { goto done; } in ecc_import_ex()
H A Decc_decrypt_key.c30 ecc_key pubkey; in ecc_decrypt_key() local
82 if ((err = ecc_copy_curve(key, &pubkey)) != CRYPT_OK) { goto LBL_ERR; } in ecc_decrypt_key()
83 …if ((err = ecc_set_key(decode[1].data, decode[1].size, PK_PUBLIC, &pubkey)) != CRYPT_OK) { goto LB… in ecc_decrypt_key()
87 if ((err = ecc_shared_secret(key, &pubkey, ecc_shared, &x)) != CRYPT_OK) { in ecc_decrypt_key()
88 ecc_free(&pubkey); in ecc_decrypt_key()
91 ecc_free(&pubkey); in ecc_decrypt_key()
H A Decc_free.c24 &key->pubkey.x, &key->pubkey.y, &key->pubkey.z, in ecc_free()
H A Decc_set_key.c31 …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()
H A Decc_set_curve_internal.c49 &key->pubkey.x, &key->pubkey.y, &key->pubkey.z, &key->k, in ecc_copy_curve()
93 &key->pubkey.x, &key->pubkey.y, &key->pubkey.z, &key->k, in ecc_set_curve_from_mpis()
H A Decc_get_key.c30 …if ((err = ltc_ecc_export_point(out, outlen, key->pubkey.x, key->pubkey.y, size, compressed)) != C… in ecc_get_key()
H A Decc_set_curve.c17 &key->pubkey.x, &key->pubkey.y, &key->pubkey.z, &key->k, in ecc_set_curve()
H A Decc_export_openssl.c120 … err = ltc_ecc_export_point(bin_xy, &len_xy, key->pubkey.x, key->pubkey.y, key->dp.size, flag_com); in ecc_export_openssl()
H A Decc_shared_secret.c48 …if ((err = ltc_mp.ecc_ptmul(private_key->k, &public_key->pubkey, result, a, prime, 1)) != CRYPT_OK… in ecc_shared_secret()
H A Decc_make_key.c58 …if ((err = ltc_mp.ecc_ptmul(key->k, &key->dp.base, &key->pubkey, key->dp.A, key->dp.prime, 1)) != … in ecc_generate_key()
/optee_os/core/lib/libtomcrypt/
H A Dsm2-kep.c79 mp_to_unsigned_bin2(key->pubkey.x, buf, SM2_INT_SIZE_BYTES); in sm2_kep_compute_Z()
84 mp_to_unsigned_bin2(key->pubkey.y, buf, SM2_INT_SIZE_BYTES); in sm2_kep_compute_Z()
138 mp_to_unsigned_bin2(initiator_eph_key->pubkey.x, buf, in sm2_kep_compute_S()
145 mp_to_unsigned_bin2(initiator_eph_key->pubkey.y, buf, in sm2_kep_compute_S()
152 mp_to_unsigned_bin2(responder_eph_key->pubkey.x, buf, in sm2_kep_compute_S()
159 mp_to_unsigned_bin2(responder_eph_key->pubkey.y, buf, in sm2_kep_compute_S()
254 mp_to_unsigned_bin2(my_eph_key->pubkey.x, tmp, SM2_INT_SIZE_BYTES); in sm2_kep_derive()
271 ltc_res = ltc_ecc_is_point(&peer_eph_key->dp, peer_eph_key->pubkey.x, in sm2_kep_derive()
272 peer_eph_key->pubkey.y); in sm2_kep_derive()
278 mp_to_unsigned_bin2(peer_eph_key->pubkey.x, tmp, SM2_INT_SIZE_BYTES); in sm2_kep_derive()
[all …]
H A Decc.c159 if (((size_t)mp_count_bits(ltc_tmp_key.pubkey.x) > key_size_bits) || in _ltc_ecc_generate_keypair()
160 ((size_t)mp_count_bits(ltc_tmp_key.pubkey.y) > key_size_bits) || in _ltc_ecc_generate_keypair()
167 if (mp_count_bits(ltc_tmp_key.pubkey.z) != 1) { in _ltc_ecc_generate_keypair()
174 ltc_mp.copy(ltc_tmp_key.pubkey.x, key->x); in _ltc_ecc_generate_keypair()
175 ltc_mp.copy(ltc_tmp_key.pubkey.y, key->y); in _ltc_ecc_generate_keypair()
207 mp_copy(key->x, ltc_key->pubkey.x); in ecc_populate_ltc_private_key()
208 mp_copy(key->y, ltc_key->pubkey.y); in ecc_populate_ltc_private_key()
209 mp_set_int(ltc_key->pubkey.z, 1); in ecc_populate_ltc_private_key()
238 mp_copy(key->x, ltc_key->pubkey.x); in ecc_populate_ltc_public_key()
239 mp_copy(key->y, ltc_key->pubkey.y); in ecc_populate_ltc_public_key()
[all …]
/optee_os/core/drivers/crypto/hisilicon/
H A Dhpre_montgomery.c228 uint8_t *privkey, uint8_t *pubkey) in hpre_montgomery_params_fill() argument
240 if (!pubkey) in hpre_montgomery_params_fill()
243 memcpy(x, pubkey, msg->x_bytes); in hpre_montgomery_params_fill()
276 uint8_t *pubkey) in hpre_montgomery_request_init() argument
296 ret = hpre_montgomery_params_fill(curve, msg, privkey, pubkey); in hpre_montgomery_request_init()
440 uint8_t *pubkey = NULL; in hpre_montgomery_do_shared_secret() local
449 pubkey = sdata->key_pub; in hpre_montgomery_do_shared_secret()
457 ret = hpre_montgomery_request_init(curve, &msg, key->priv, pubkey); in hpre_montgomery_do_shared_secret()
H A Dhpre_dh.c208 struct bignum *pubkey) in hpre_dh_params_bn2bin() argument
219 if (!pubkey) { in hpre_dh_params_bn2bin()
223 msg->gbytes = crypto_bignum_num_bytes(pubkey); in hpre_dh_params_bn2bin()
226 crypto_bignum_bn2bin(pubkey, msg->g); in hpre_dh_params_bn2bin()
251 struct bignum *pubkey) in hpre_dh_request_init() argument
264 ret = hpre_dh_params_bn2bin(msg, key, pubkey); in hpre_dh_request_init()
H A Dhpre_rsa.h38 uint8_t *pubkey; member
H A Dhpre_ecc.c756 struct ecc_public_key *pubkey) in hpre_ecc_dh_params_fill() argument
778 if (!pubkey) { in hpre_ecc_dh_params_fill()
784 crypto_bignum_bn2bin(pubkey->x, x); in hpre_ecc_dh_params_fill()
785 ecc_dh->x_bytes = crypto_bignum_num_bytes(pubkey->x); in hpre_ecc_dh_params_fill()
786 crypto_bignum_bn2bin(pubkey->y, y); in hpre_ecc_dh_params_fill()
787 ecc_dh->y_bytes = crypto_bignum_num_bytes(pubkey->y); in hpre_ecc_dh_params_fill()
830 struct ecc_public_key *pubkey) in hpre_ecc_request_init() argument
848 ret = hpre_ecc_dh_params_fill(curve, msg, d, pubkey); in hpre_ecc_request_init()
964 struct ecc_public_key *pubkey = NULL; in hpre_ecc_do_shared_secret() local
975 pubkey = sdata->key_pub; in hpre_ecc_do_shared_secret()
[all …]
H A Dhpre_rsa.c171 free(msg->pubkey); in hpre_rsa_params_free()
194 msg->pubkey = data; in hpre_rsa_encrypt_alloc()
195 msg->pubkey_dma = virt_to_phys(msg->pubkey); in hpre_rsa_encrypt_alloc()
216 n = msg->pubkey + msg->key_bytes; in hpre_rsa_encrypt_bn2bin()
218 crypto_bignum_bn2bin(key->e, msg->pubkey); in hpre_rsa_encrypt_bn2bin()
223 ret = hpre_bin_from_crypto_bin(msg->pubkey, msg->pubkey, in hpre_rsa_encrypt_bn2bin()
/optee_os/core/include/drivers/
H A Dcaam_extension.h29 TEE_Result caam_mp_export_publickey(uint8_t *pubkey, size_t *size);
/optee_os/core/drivers/crypto/caam/mp/
H A Dcaam_mp.c106 TEE_Result caam_mp_export_publickey(uint8_t *pubkey, size_t *size) in caam_mp_export_publickey() argument
120 if (!pubkey || !size) in caam_mp_export_publickey()
129 ret = caam_dmaobj_output_sgtbuf(&reskey, pubkey, *size, in caam_mp_export_publickey()
166 MP_DUMPBUF("MP PubKey", pubkey, *size); in caam_mp_export_publickey()
/optee_os/core/drivers/crypto/se050/adaptors/apis/
H A Dapdu.c531 uint8_t *pubkey = NULL; in alloc_pubkey_buf() local
540 pubkey = buf + 1; in alloc_pubkey_buf()
541 memcpy(pubkey, keypub->x, keypub->x_len); in alloc_pubkey_buf()
542 memcpy(pubkey + keypub->x_len, keypub->y, keypub->y_len); in alloc_pubkey_buf()

12