Home
last modified time | relevance | path

Searched refs:ecKey (Results 1 – 7 of 7) sorted by relevance

/base/security/crypto_framework/plugin/openssl_plugin/key/asy_key_generator/src/
Decc_asy_key_generator_openssl.c42 EC_KEY *ecKey = EC_KEY_new_by_curve_name(curveId); in NewEcKeyPairByOpenssl() local
43 if (ecKey == NULL) { in NewEcKeyPairByOpenssl()
47 if (EC_KEY_generate_key(ecKey) <= 0) { in NewEcKeyPairByOpenssl()
49 EC_KEY_free(ecKey); in NewEcKeyPairByOpenssl()
52 if (EC_KEY_check_key(ecKey) <= 0) { in NewEcKeyPairByOpenssl()
54 EC_KEY_free(ecKey); in NewEcKeyPairByOpenssl()
57 const EC_POINT *pubKey = EC_KEY_get0_public_key(ecKey); in NewEcKeyPairByOpenssl()
58 const BIGNUM *priKey = EC_KEY_get0_private_key(ecKey); in NewEcKeyPairByOpenssl()
59 const EC_GROUP *group = EC_KEY_get0_group(ecKey); in NewEcKeyPairByOpenssl()
62 EC_KEY_free(ecKey); in NewEcKeyPairByOpenssl()
[all …]
/base/security/crypto_framework/plugin/openssl_plugin/crypto_operation/key_agreement/src/
Decdh_openssl.c36 EC_KEY *ecKey = EC_KEY_new_by_curve_name(curveId); in NewPKeyByEccPubKey() local
37 if (ecKey == NULL) { in NewPKeyByEccPubKey()
41 if (EC_KEY_set_public_key(ecKey, (publicKey->pk)) != HCF_OPENSSL_SUCCESS) { in NewPKeyByEccPubKey()
43 EC_KEY_free(ecKey); in NewPKeyByEccPubKey()
49 EC_KEY_free(ecKey); in NewPKeyByEccPubKey()
52 if (EVP_PKEY_assign_EC_KEY(pKey, ecKey) != HCF_OPENSSL_SUCCESS) { in NewPKeyByEccPubKey()
55 EC_KEY_free(ecKey); in NewPKeyByEccPubKey()
63 EC_KEY *ecKey = EC_KEY_new_by_curve_name(curveId); in NewPKeyByEccPriKey() local
64 if (ecKey == NULL) { in NewPKeyByEccPriKey()
68 if (EC_KEY_set_private_key(ecKey, (privateKey->sk)) != HCF_OPENSSL_SUCCESS) { in NewPKeyByEccPriKey()
[all …]
/base/security/crypto_framework/plugin/openssl_plugin/crypto_operation/signature/src/
Decdsa_openssl.c129 EC_KEY *ecKey = EC_KEY_new_by_curve_name(impl->curveId); in EngineSignInit() local
130 if (ecKey == NULL) { in EngineSignInit()
134 …if (EC_KEY_set_private_key(ecKey, ((HcfOpensslEccPriKey *)privateKey)->sk) != HCF_OPENSSL_SUCCESS)… in EngineSignInit()
136 EC_KEY_free(ecKey); in EngineSignInit()
142 EC_KEY_free(ecKey); in EngineSignInit()
145 if (EVP_PKEY_assign_EC_KEY(pKey, ecKey) != HCF_OPENSSL_SUCCESS) { in EngineSignInit()
148 EC_KEY_free(ecKey); in EngineSignInit()
255 EC_KEY *ecKey = EC_KEY_new_by_curve_name(impl->curveId); in EngineVerifyInit() local
256 if (ecKey == NULL) { in EngineVerifyInit()
260 … if (EC_KEY_set_public_key(ecKey, ((HcfOpensslEccPubKey *)publicKey)->pk) != HCF_OPENSSL_SUCCESS) { in EngineVerifyInit()
[all …]
/base/update/updater/services/package/pkg_algorithm/
Dpkg_algo_sign.cpp94 EC_KEY *ecKey = PEM_read_bio_ECPrivateKey(in, nullptr, nullptr, nullptr); in SignBuffer() local
96 if (ecKey == nullptr) { in SignBuffer()
102 uint32_t size = static_cast<uint32_t>(ECDSA_size(ecKey)); in SignBuffer()
104 ret = ECDSA_sign(0, buffer.buffer, buffer.length, sign.data() + sizeof(uint32_t), &size, ecKey); in SignBuffer()
107 EC_KEY_free(ecKey); in SignBuffer()
Dpkg_algo_sign.h40 EC_KEY *ecKey; member
/base/security/huks/utils/crypto_adapter/
Dhks_client_service_adapter.c150 EC_KEY *ecKey = NULL; in EccToX509PublicKey() local
156 ecKey = EC_KEY_new_by_curve_name(nid); in EccToX509PublicKey()
157 HKS_IF_NULL_LOGE_BREAK(ecKey, in EccToX509PublicKey()
167 if (EC_KEY_set_public_key_affine_coordinates(ecKey, ecX, ecY) == 0) { in EccToX509PublicKey()
173 EC_KEY_set_conv_form(ecKey, POINT_CONVERSION_UNCOMPRESSED); in EccToX509PublicKey()
177 if (EVP_PKEY_set1_EC_KEY(pkey, ecKey) == 0) { in EccToX509PublicKey()
185 SELF_FREE_PTR(ecKey, EC_KEY_free); in EccToX509PublicKey()
467 static int32_t EcKeyToPublicKey(const uint32_t alg, EC_KEY *ecKey, struct HksBlob *eccPublicKey) in EcKeyToPublicKey() argument
479 …if (EC_POINT_get_affine_coordinates_GFp(EC_KEY_get0_group(ecKey), EC_KEY_get0_public_key(ecKey), x… in EcKeyToPublicKey()
486 uint32_t keyLen = (uint32_t)EC_GROUP_order_bits(EC_KEY_get0_group(ecKey)); in EcKeyToPublicKey()
[all …]
/base/security/huks/test/unittest/huks_standard_test/interface_inner_test/alg_module_test/src/
Dopenssl_ecc_helper.c473 static int32_t EcKeyToPublicKey(EC_KEY *ecKey, struct HksBlob *eccPublicKey) in EcKeyToPublicKey() argument
484 …if (EC_POINT_get_affine_coordinates_GFp(EC_KEY_get0_group(ecKey), EC_KEY_get0_public_key(ecKey), x… in EcKeyToPublicKey()
489 uint32_t keyLen = (uint32_t)EC_GROUP_order_bits(EC_KEY_get0_group(ecKey)); in EcKeyToPublicKey()
540 EC_KEY *ecKey = EVP_PKEY_get0_EC_KEY(pkey); in X509ToHksBlob() local
541 if (ecKey == NULL) { in X509ToHksBlob()
546 if (EcKeyToPublicKey(ecKey, publicKey) != ECC_SUCCESS) { in X509ToHksBlob()