Home
last modified time | relevance | path

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

/optee_os/core/lib/libtomcrypt/src/pk/ecc/
A Dltc_ecc_verify_key.c32 if (ltc_mp.compare_d(key->pubkey.z, 1) == LTC_MP_EQ) { in ltc_ecc_verify_key()
33 if ((ltc_mp.compare(key->pubkey.x, prime) != LTC_MP_LT) || in ltc_ecc_verify_key()
34 (ltc_mp.compare(key->pubkey.y, prime) != LTC_MP_LT) || in ltc_ecc_verify_key()
35 (ltc_mp.compare_d(key->pubkey.x, 0) == LTC_MP_LT) || in ltc_ecc_verify_key()
36 (ltc_mp.compare_d(key->pubkey.y, 0) == LTC_MP_LT) || in ltc_ecc_verify_key()
37 (mp_iszero(key->pubkey.x) && mp_iszero(key->pubkey.y)) in ltc_ecc_verify_key()
46 …if ((err = ltc_ecc_is_point(&key->dp, key->pubkey.x, key->pubkey.y)) != CRYPT_OK) { goto done… in ltc_ecc_verify_key()
50 …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.c38 ecc_key pubkey; in ecc_sign_hash_ex() local
82 if ((err = ecc_copy_curve(key, &pubkey)) != CRYPT_OK) { goto errnokey; } in ecc_sign_hash_ex()
83 if ((err = ecc_generate_key(prng, wprng, &pubkey)) != CRYPT_OK) { goto errnokey; } in ecc_sign_hash_ex()
86 if ((err = mp_mod(pubkey.pubkey.x, p, r)) != CRYPT_OK) { goto error; } in ecc_sign_hash_ex()
91 if (mp_copy(pubkey.pubkey.x, s) != CRYPT_OK) { goto error; } in ecc_sign_hash_ex()
97 if (mp_isodd(pubkey.pubkey.y)) v += 1; in ecc_sign_hash_ex()
101 ecc_free(&pubkey); in ecc_sign_hash_ex()
105 … if ((err = mp_mulmod(pubkey.k, b, p, pubkey.k)) != CRYPT_OK) { goto error; } /* k = kb */ in ecc_sign_hash_ex()
106 … if ((err = mp_invmod(pubkey.k, p, pubkey.k)) != CRYPT_OK) { goto error; } /* k = 1/kb */ in ecc_sign_hash_ex()
112 ecc_free(&pubkey); in ecc_sign_hash_ex()
[all …]
A Decc_encrypt_key.c38 ecc_key pubkey; in ecc_encrypt_key() local
56 if ((err = ecc_copy_curve(key, &pubkey)) != CRYPT_OK) { return err; } in ecc_encrypt_key()
57 if ((err = ecc_generate_key(prng, wprng, &pubkey)) != CRYPT_OK) { return err; } in ecc_encrypt_key()
72 ecc_free(&pubkey); in ecc_encrypt_key()
79 err = ecc_get_key(pub_expt, &pubkeysize, PK_PUBLIC|PK_COMPRESSED, &pubkey); in ecc_encrypt_key()
82 err = ecc_get_key(pub_expt, &pubkeysize, PK_PUBLIC, &pubkey); in ecc_encrypt_key()
85 ecc_free(&pubkey); in ecc_encrypt_key()
91 if ((err = ecc_shared_secret(&pubkey, key, ecc_shared, &x)) != CRYPT_OK) { in ecc_encrypt_key()
92 ecc_free(&pubkey); in ecc_encrypt_key()
95 ecc_free(&pubkey); in ecc_encrypt_key()
A Decc_decrypt_key.c37 ecc_key pubkey; in ecc_decrypt_key() local
89 if ((err = ecc_copy_curve(key, &pubkey)) != CRYPT_OK) { goto LBL_ERR; } in ecc_decrypt_key()
90 …if ((err = ecc_set_key(decode[1].data, decode[1].size, PK_PUBLIC, &pubkey)) != CRYPT_OK) { goto LB… in ecc_decrypt_key()
94 if ((err = ecc_shared_secret(key, &pubkey, ecc_shared, &x)) != CRYPT_OK) { in ecc_decrypt_key()
95 ecc_free(&pubkey); in ecc_decrypt_key()
98 ecc_free(&pubkey); in ecc_decrypt_key()
A Decc_import.c71 LTC_ASN1_INTEGER, 1UL, key->pubkey.x, in ecc_import_ex()
72 LTC_ASN1_INTEGER, 1UL, key->pubkey.y, in ecc_import_ex()
83 LTC_ASN1_INTEGER, 1UL, key->pubkey.x, in ecc_import_ex()
84 LTC_ASN1_INTEGER, 1UL, key->pubkey.y, in ecc_import_ex()
95 if ((err = mp_set(key->pubkey.z, 1)) != CRYPT_OK) { goto done; } in ecc_import_ex()
A Decc_export.c51 LTC_ASN1_INTEGER, 1UL, key->pubkey.x, in ecc_export()
52 LTC_ASN1_INTEGER, 1UL, key->pubkey.y, in ecc_export()
60 LTC_ASN1_INTEGER, 1UL, key->pubkey.x, in ecc_export()
61 LTC_ASN1_INTEGER, 1UL, key->pubkey.y, in ecc_export()
A Decc_set_key.c38 …if ((err = ltc_mp.ecc_ptmul(key->k, &key->dp.base, &key->pubkey, a, prime, 1)) != CRYPT_OK) … in ecc_set_key()
42 …if ((err = ltc_ecc_import_point(in, inlen, prime, a, b, key->pubkey.x, key->pubkey.y)) != CRYPT_OK… in ecc_set_key()
43 …if ((err = mp_set(key->pubkey.z, 1)) != CRYPT_OK) … in ecc_set_key()
A Decc_free.c31 &key->pubkey.x, &key->pubkey.y, &key->pubkey.z, in ecc_free()
A Decc_set_curve_internal.c56 &key->pubkey.x, &key->pubkey.y, &key->pubkey.z, &key->k, in ecc_copy_curve()
100 &key->pubkey.x, &key->pubkey.y, &key->pubkey.z, &key->k, in ecc_set_curve_from_mpis()
A Decc_set_curve.c24 &key->pubkey.x, &key->pubkey.y, &key->pubkey.z, &key->k, in ecc_set_curve()
A Decc_get_key.c37 …if ((err = ltc_ecc_export_point(out, outlen, key->pubkey.x, key->pubkey.y, size, compressed)) != C… in ecc_get_key()
A Decc_export_openssl.c70 … 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_shared_secret.c55 …if ((err = ltc_mp.ecc_ptmul(private_key->k, &public_key->pubkey, result, a, prime, 1)) != CRYPT_OK… in ecc_shared_secret()
A Decc_make_key.c65 …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.c165 …if ((err = ltc_ecc_copy_point(&key->pubkey, mQ)) != CRYPT_OK) … in ecc_verify_hash_ex()
A Decc_recover_key.c241 …if ((err = ltc_ecc_copy_point(mQ, &key->pubkey)) != CRYPT_OK) … in ecc_recover_key()
/optee_os/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.c141 if (((size_t)mp_count_bits(ltc_tmp_key.pubkey.x) > key_size_bits) || in _ltc_ecc_generate_keypair()
142 ((size_t)mp_count_bits(ltc_tmp_key.pubkey.y) > key_size_bits) || in _ltc_ecc_generate_keypair()
149 if (mp_count_bits(ltc_tmp_key.pubkey.z) != 1) { in _ltc_ecc_generate_keypair()
156 ltc_mp.copy(ltc_tmp_key.pubkey.x, key->x); in _ltc_ecc_generate_keypair()
157 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 …]
A Dsm2-pke.c396 ltc_res = ltc_ecc_mulmod(h, &ltc_key.pubkey, S, ltc_key.dp.A, in sm2_ltc_pke_encrypt()
406 ltc_res = ltc_ecc_is_point_at_infinity(&ltc_key.pubkey, in sm2_ltc_pke_encrypt()
426 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/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/core/lib/libtomcrypt/src/headers/
A Dtomcrypt_pk.h243 ecc_point pubkey; member

Completed in 25 milliseconds