Home
last modified time | relevance | path

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

/optee_os-3.20.0/core/lib/libtomcrypt/src/pk/ecc/
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()
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()
105 ecc_free(&pubkey); in ecc_sign_hash_ex()
[all …]
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()
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()
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()
A Decc_free.c24 &key->pubkey.x, &key->pubkey.y, &key->pubkey.z, in ecc_free()
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()
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()
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()
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()
A Decc_set_curve.c17 &key->pubkey.x, &key->pubkey.y, &key->pubkey.z, &key->k, in ecc_set_curve()
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()
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()
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()
A Decc_verify_hash.c159 …if ((err = ltc_ecc_copy_point(&key->pubkey, mQ)) != CRYPT_OK) … in ecc_verify_hash_ex()
A Decc_recover_key.c235 …if ((err = ltc_ecc_copy_point(mQ, &key->pubkey)) != CRYPT_OK) … in ecc_recover_key()
/optee_os-3.20.0/core/lib/libtomcrypt/
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 …]
A Decc.c164 if (((size_t)mp_count_bits(ltc_tmp_key.pubkey.x) > key_size_bits) || in _ltc_ecc_generate_keypair()
165 ((size_t)mp_count_bits(ltc_tmp_key.pubkey.y) > key_size_bits) || in _ltc_ecc_generate_keypair()
172 if (mp_count_bits(ltc_tmp_key.pubkey.z) != 1) { in _ltc_ecc_generate_keypair()
179 ltc_mp.copy(ltc_tmp_key.pubkey.x, key->x); in _ltc_ecc_generate_keypair()
180 ltc_mp.copy(ltc_tmp_key.pubkey.y, key->y); in _ltc_ecc_generate_keypair()
212 mp_copy(key->x, ltc_key->pubkey.x); in ecc_populate_ltc_private_key()
213 mp_copy(key->y, ltc_key->pubkey.y); in ecc_populate_ltc_private_key()
214 mp_set_int(ltc_key->pubkey.z, 1); in ecc_populate_ltc_private_key()
243 mp_copy(key->x, ltc_key->pubkey.x); in ecc_populate_ltc_public_key()
244 mp_copy(key->y, ltc_key->pubkey.y); in ecc_populate_ltc_public_key()
[all …]
A Dsm2-pke.c397 ltc_res = ltc_ecc_mulmod(h, &ltc_key.pubkey, S, ltc_key.dp.A, in sm2_ltc_pke_encrypt()
407 ltc_res = ltc_ecc_is_point_at_infinity(&ltc_key.pubkey, in sm2_ltc_pke_encrypt()
427 ltc_res = ltc_ecc_mulmod(k, &ltc_key.pubkey, x2y2p, ltc_key.dp.A, in sm2_ltc_pke_encrypt()
A Dsm2-dsa.c226 ltc_res = ltc_ecc_mul2add(&ltc_key.dp.base, sprime, &ltc_key.pubkey, t, in sm2_ltc_dsa_verify()
/optee_os-3.20.0/core/drivers/crypto/se050/adaptors/apis/
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()
/optee_os-3.20.0/core/lib/libtomcrypt/src/headers/
A Dtomcrypt_pk.h236 ecc_point pubkey; member

Completed in 18 milliseconds