Home
last modified time | relevance | path

Searched refs:ecKey (Results 1 - 16 of 16) sorted by relevance

/base/security/crypto_framework/plugin/openssl_plugin/key/asy_key_generator/src/
H A Dsm2_asy_key_generator_openssl.c103 EC_KEY *ecKey = NULL; in GenerateSm2KeyWithParamsSpec() local
107 ecKey = OpensslEcKeyNewByCurveName(curveId); in GenerateSm2KeyWithParamsSpec()
109 if (ecKey == NULL) { in GenerateSm2KeyWithParamsSpec()
120 ecKey = OpensslEcKeyNew(); in GenerateSm2KeyWithParamsSpec()
121 if (ecKey == NULL) { in GenerateSm2KeyWithParamsSpec()
126 if (OpensslEcKeySetGroup(ecKey, group) != HCF_OPENSSL_SUCCESS) { in GenerateSm2KeyWithParamsSpec()
129 OpensslEcKeyFree(ecKey); in GenerateSm2KeyWithParamsSpec()
136 *returnKey = ecKey; in GenerateSm2KeyWithParamsSpec()
146 EC_KEY *ecKey = NULL; in NewSm2KeyPairWithCommSpec() local
147 HcfResult ret = GenerateSm2KeyWithParamsSpec(ecParams, &ecKey); in NewSm2KeyPairWithCommSpec()
173 EC_KEY *ecKey = NULL; NewSm2PubKeyWithPubSpec() local
201 EC_KEY *ecKey = NULL; NewSm2PriKeyWithPriSpec() local
230 EC_KEY *ecKey = NULL; NewSm2KeyWithKeyPairSpec() local
256 GenKeyPairSm2KeyBySpec(const HcfAsyKeyParamsSpec *params, EC_KEY **ecKey) GenKeyPairSm2KeyBySpec() argument
273 GenPubKeySm2KeyBySpec(const HcfAsyKeyParamsSpec *params, EC_KEY **ecKey) GenPubKeySm2KeyBySpec() argument
290 GenPriKeySm2KeyBySpec(const HcfAsyKeyParamsSpec *params, EC_KEY **ecKey) GenPriKeySm2KeyBySpec() argument
746 PackSm2PubKey(int32_t curveId, EC_KEY *ecKey, const char *fieldType, HcfOpensslSm2PubKey **returnObj) PackSm2PubKey() argument
797 PackSm2PriKey(int32_t curveId, EC_KEY *ecKey, const char *fieldType, HcfOpensslSm2PriKey **returnObj) PackSm2PriKey() argument
861 EC_KEY *ecKey = OpensslD2iEcPubKey(NULL, &tmpData, pubKeyBlob->len); ConvertEcPubKey() local
879 EC_KEY *ecKey = OpensslD2iEcPrivateKey(NULL, &tmpData, priKeyBlob->len); ConvertEcPriKey() local
948 EC_KEY *ecKey = NULL; GetSm2EckeyformPubKey() local
1003 EC_KEY *ecKey = NULL; GetSm2EckeyformPriKey() local
1040 EC_KEY *ecKey = GetSm2EckeyformPubKey(pkey); ConvertSM2PemPubKey() local
1068 EC_KEY *ecKey = GetSm2EckeyformPriKey(pkey); ConvertSM2PemPriKey() local
1131 PackAndAssignPubKey(const HcfAsyKeyGeneratorSpiOpensslSm2Impl *impl, const char *fieldType, EC_KEY *ecKey, HcfPubKey **returnObj) PackAndAssignPubKey() argument
1144 PackAndAssignPriKey(const HcfAsyKeyGeneratorSpiOpensslSm2Impl *impl, const char *fieldType, EC_KEY *ecKey, HcfPriKey **returnObj) PackAndAssignPriKey() argument
1157 CreateAndAssignKeyPair(const HcfAsyKeyGeneratorSpiOpensslSm2Impl *impl, const char *fieldType, EC_KEY *ecKey, HcfKeyPair **returnObj) CreateAndAssignKeyPair() argument
1210 EC_KEY *ecKey = NULL; EngineGenerateKeyPair() local
1236 EC_KEY *ecKey = NULL; EngineGenerateKeyPairBySpec() local
1272 EC_KEY *ecKey = NULL; EngineGeneratePubKeyBySpec() local
1305 EC_KEY *ecKey = NULL; EngineGeneratePriKeyBySpec() local
[all...]
H A Decc_asy_key_generator_openssl.c692 EC_KEY *ecKey = NULL; in GenerateEcKeyWithParamsSpec() local
696 ecKey = OpensslEcKeyNewByCurveName(curveId); in GenerateEcKeyWithParamsSpec()
698 if (ecKey == NULL) { in GenerateEcKeyWithParamsSpec()
709 ecKey = OpensslEcKeyNew(); in GenerateEcKeyWithParamsSpec()
710 if (ecKey == NULL) { in GenerateEcKeyWithParamsSpec()
715 if (OpensslEcKeySetGroup(ecKey, group) != HCF_OPENSSL_SUCCESS) { in GenerateEcKeyWithParamsSpec()
718 OpensslEcKeyFree(ecKey); in GenerateEcKeyWithParamsSpec()
725 *returnKey = ecKey; in GenerateEcKeyWithParamsSpec()
735 EC_KEY *ecKey = NULL; in NewEcKeyPairWithCommSpec() local
736 HcfResult ret = GenerateEcKeyWithParamsSpec(ecParams, &ecKey); in NewEcKeyPairWithCommSpec()
762 EC_KEY *ecKey = NULL; NewEcPubKeyWithPubSpec() local
790 EC_KEY *ecKey = NULL; NewEcPriKeyWithPriSpec() local
819 EC_KEY *ecKey = NULL; NewEcKeyWithKeyPairSpec() local
845 GenKeyPairEcKeyBySpec(const HcfAsyKeyParamsSpec *params, EC_KEY **ecKey) GenKeyPairEcKeyBySpec() argument
862 GenPubKeyEcKeyBySpec(const HcfAsyKeyParamsSpec *params, EC_KEY **ecKey) GenPubKeyEcKeyBySpec() argument
879 GenPriKeyEcKeyBySpec(const HcfAsyKeyParamsSpec *params, EC_KEY **ecKey) GenPriKeyEcKeyBySpec() argument
1134 EC_KEY *ecKey = impl->ecKey; GetCompressedEccPointEncoded() local
1173 GetDerEccPubKeyEncoded(EC_KEY *ecKey, HcfBlob *returnBlob) GetDerEccPubKeyEncoded() argument
1610 PackEccPubKey(int32_t curveId, EC_KEY *ecKey, const char *fieldType, HcfOpensslEccPubKey **returnObj) PackEccPubKey() argument
1653 PackEccPriKey(int32_t curveId, EC_KEY *ecKey, const char *fieldType, HcfOpensslEccPriKey **returnObj) PackEccPriKey() argument
1717 EC_KEY *ecKey = OpensslD2iEcPubKey(NULL, &tmpData, pubKeyBlob->len); ConvertEcPubKey() local
1753 EC_KEY *ecKey = NULL; ConvertEcPriKey() local
1832 EC_KEY *ecKey = OpensslEvpPkeyGet1EcKey(pkey); ConvertEcPemPubKey() local
1860 EC_KEY *ecKey = OpensslEvpPkeyGet1EcKey(pkey); ConvertEcPemPriKey() local
1922 PackAndAssignPubKey(const HcfAsyKeyGeneratorSpiOpensslEccImpl *impl, const char *fieldType, EC_KEY *ecKey, HcfPubKey **returnObj) PackAndAssignPubKey() argument
1934 PackAndAssignPriKey(const HcfAsyKeyGeneratorSpiOpensslEccImpl *impl, const char *fieldType, EC_KEY *ecKey, HcfPriKey **returnObj) PackAndAssignPriKey() argument
1946 CreateAndAssignKeyPair(const HcfAsyKeyGeneratorSpiOpensslEccImpl *impl, const char *fieldType, EC_KEY *ecKey, HcfKeyPair **returnObj) CreateAndAssignKeyPair() argument
2001 EC_KEY *ecKey = NULL; EngineGenerateKeyPair() local
2028 EC_KEY *ecKey = NULL; EngineGenerateKeyPairBySpec() local
2064 EC_KEY *ecKey = NULL; EngineGeneratePubKeyBySpec() local
2097 EC_KEY *ecKey = NULL; EngineGeneratePriKeyBySpec() local
[all...]
/base/security/crypto_framework/plugin/openssl_plugin/crypto_operation/key_agreement/src/
H A Decdh_openssl.c33 static EVP_PKEY *AssignEcKeyToPkey(EC_KEY *ecKey) in AssignEcKeyToPkey() argument
40 if (OpensslEvpPkeyAssignEcKey(pKey, ecKey) != HCF_OPENSSL_SUCCESS) { in AssignEcKeyToPkey()
50 EC_KEY *ecKey = OpensslEcKeyDup(publicKey->ecKey); in NewPKeyByEccPubKey() local
51 if (ecKey == NULL) { in NewPKeyByEccPubKey()
54 EVP_PKEY *res = AssignEcKeyToPkey(ecKey); in NewPKeyByEccPubKey()
56 OpensslEcKeyFree(ecKey); in NewPKeyByEccPubKey()
63 EC_KEY *ecKey = OpensslEcKeyDup(privateKey->ecKey); in NewPKeyByEccPriKey() local
64 if (ecKey in NewPKeyByEccPriKey()
[all...]
/base/security/crypto_framework/plugin/openssl_plugin/common/src/
H A Decc_openssl_common.c26 EC_KEY *ecKey = OpensslEcKeyNewByCurveName(curveId); in NewEcKeyPair() local
27 if (ecKey == NULL) { in NewEcKeyPair()
31 if (OpensslEcKeyGenerateKey(ecKey) <= 0) { in NewEcKeyPair()
33 OpensslEcKeyFree(ecKey); in NewEcKeyPair()
36 if (OpensslEcKeyCheckKey(ecKey) <= 0) { in NewEcKeyPair()
38 OpensslEcKeyFree(ecKey); in NewEcKeyPair()
41 *returnEcKey = ecKey; in NewEcKeyPair()
167 static HcfResult InitEcKeyByPubKey(const HcfPoint *pubKey, EC_KEY *ecKey) in InitEcKeyByPubKey() argument
169 const EC_GROUP *group = OpensslEcKeyGet0Group(ecKey); in InitEcKeyByPubKey()
171 LOGD("[error] Not find group from ecKey in InitEcKeyByPubKey()
211 InitEcKeyByPriKey(const HcfBigInteger *priKey, EC_KEY *ecKey) InitEcKeyByPriKey() argument
228 SetEcPubKeyFromPriKey(const HcfBigInteger *priKey, EC_KEY *ecKey) SetEcPubKeyFromPriKey() argument
263 SetEcKey(const HcfPoint *pubKey, const HcfBigInteger *priKey, EC_KEY *ecKey) SetEcKey() argument
[all...]
/base/security/crypto_framework/plugin/openssl_plugin/common/inc/
H A Dopenssl_class.h34 EC_KEY *ecKey; member
45 EC_KEY *ecKey; member
127 EC_KEY *ecKey; member
138 EC_KEY *ecKey; member
H A Decc_openssl_common.h29 HcfResult SetEcKey(const HcfPoint *pubKey, const HcfBigInteger *priKey, EC_KEY *ecKey);
H A Dopenssl_adapter.h66 int OpensslEcKeyGenerateKey(EC_KEY *ecKey);
78 void OpensslEcKeySetEncFlags(EC_KEY *ecKey, unsigned int flags);
90 EC_KEY *OpensslEcKeyDup(const EC_KEY *ecKey);
/base/update/updater/services/package/pkg_algorithm/
H A 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()
H A Dpkg_algo_sign.h40 EC_KEY *ecKey; member
/base/security/crypto_framework/plugin/openssl_plugin/crypto_operation/signature/src/
H A Decdsa_openssl.c137 // dup will check if ecKey is NULL in EngineSignInit()
138 EC_KEY *ecKey = OpensslEcKeyDup(((HcfOpensslEccPriKey *)privateKey)->ecKey); in EngineSignInit() local
139 if (ecKey == NULL) { in EngineSignInit()
141 LOGD("[error] Dup ecKey failed."); in EngineSignInit()
148 OpensslEcKeyFree(ecKey); in EngineSignInit()
151 if (OpensslEvpPkeyAssignEcKey(pKey, ecKey) != HCF_OPENSSL_SUCCESS) { in EngineSignInit()
154 OpensslEcKeyFree(ecKey); in EngineSignInit()
259 EC_KEY *ecKey = OpensslEcKeyDup(((HcfOpensslEccPubKey *)publicKey)->ecKey); in EngineVerifyInit() local
[all...]
H A Dsm2_openssl.c195 EC_KEY *ecKey = OpensslEcKeyDup(((HcfOpensslSm2PriKey *)privateKey)->ecKey); in EngineSignInit() local
196 if (ecKey == NULL) { in EngineSignInit()
198 LOGD("[error] Dup ecKey failed."); in EngineSignInit()
205 OpensslEcKeyFree(ecKey); in EngineSignInit()
208 if (OpensslEvpPkeyAssignEcKey(pKey, ecKey) != HCF_OPENSSL_SUCCESS) { in EngineSignInit()
211 OpensslEcKeyFree(ecKey); in EngineSignInit()
332 EC_KEY *ecKey = OpensslEcKeyDup(((HcfOpensslSm2PubKey *)publicKey)->ecKey); in EngineVerifyInit() local
333 if (ecKey in EngineVerifyInit()
[all...]
/base/security/huks/utils/crypto_adapter/
H A Dhks_client_service_adapter.c155 EC_KEY *ecKey = NULL; in EccToX509PublicKey() local
161 ecKey = EC_KEY_new_by_curve_name(nid); in EccToX509PublicKey()
162 HKS_IF_NULL_LOGE_BREAK(ecKey, in EccToX509PublicKey()
172 if (EC_KEY_set_public_key_affine_coordinates(ecKey, ecX, ecY) == 0) { in EccToX509PublicKey()
178 EC_KEY_set_conv_form(ecKey, POINT_CONVERSION_UNCOMPRESSED); in EccToX509PublicKey()
182 if (EVP_PKEY_set1_EC_KEY(pkey, ecKey) == 0) { in EccToX509PublicKey()
190 SELF_FREE_PTR(ecKey, EC_KEY_free) in EccToX509PublicKey()
489 static int32_t EcKeyToPublicKey(const uint32_t alg, const EC_KEY *ecKey, struct HksBlob *eccPublicKey) in EcKeyToPublicKey() argument
501 if (EC_POINT_get_affine_coordinates_GFp(EC_KEY_get0_group(ecKey), EC_KEY_get0_public_key(ecKey), in EcKeyToPublicKey()
546 const EC_KEY *ecKey = EVP_PKEY_get0_EC_KEY(pkey); X509PublicKeyToEcc() local
[all...]
/base/security/huks/test/unittest/huks_standard_test/interface_inner_test/alg_module_test/src/
H A Dopenssl_ecc_helper.c453 static int32_t EcKeyToPublicKey(const EC_KEY *ecKey, struct HksBlob *eccPublicKey) in EcKeyToPublicKey() argument
464 if (EC_POINT_get_affine_coordinates_GFp(EC_KEY_get0_group(ecKey), EC_KEY_get0_public_key(ecKey), x, y, NULL) == in EcKeyToPublicKey()
469 uint32_t keyLen = (uint32_t)EC_GROUP_order_bits(EC_KEY_get0_group(ecKey)); in EcKeyToPublicKey()
520 const EC_KEY *ecKey = EVP_PKEY_get0_EC_KEY(pkey); in X509ToHksBlob() local
521 if (ecKey == NULL) { in X509ToHksBlob()
526 if (EcKeyToPublicKey(ecKey, publicKey) != ECC_SUCCESS) { in X509ToHksBlob()
/base/security/crypto_framework/plugin/openssl_plugin/crypto_operation/cipher/src/
H A Dcipher_sm2_openssl.c70 impl->sm2Key = OpensslEcKeyDup(((HcfOpensslSm2PubKey *)key)->ecKey); in InitSm2Key()
72 // dup will check if ecKey is NULL in InitSm2Key()
73 impl->sm2Key = OpensslEcKeyDup(((HcfOpensslSm2PriKey *)key)->ecKey); in InitSm2Key()
/base/security/huks/test/unittest/huks_standard_test/three_stage_test/src/
H A Dhks_chipset_platform_encrypt_test.cpp238 auto ecKey = std::unique_ptr<EC_KEY, void(*)(EC_KEY *&)>( in ConvertRawEcPubKeyToX509Key() local
239 EC_KEY_new_by_curve_name(NID_X9_62_prime256v1), [](EC_KEY *&ecKey) { in ConvertRawEcPubKeyToX509Key()
240 SELF_FREE_PTR(ecKey, EC_KEY_free) in ConvertRawEcPubKeyToX509Key()
242 EXPECT_NE(ecKey, nullptr); in ConvertRawEcPubKeyToX509Key()
252 EXPECT_EQ(EC_KEY_set_public_key_affine_coordinates(ecKey.get(), ecX.get(), ecY.get()), HKS_OPENSSL_SUCCESS); in ConvertRawEcPubKeyToX509Key()
253 EC_KEY_set_conv_form(ecKey.get(), POINT_CONVERSION_UNCOMPRESSED); in ConvertRawEcPubKeyToX509Key()
258 EXPECT_EQ(EVP_PKEY_set1_EC_KEY(pkey.get(), ecKey.get()), HKS_OPENSSL_SUCCESS); in ConvertRawEcPubKeyToX509Key()
/base/security/crypto_framework/test/unittest/src/
H A Dopenssl_adapter_mock.c296 EC_KEY *OpensslEcKeyDup(const EC_KEY *ecKey) in OpensslEcKeyDup() argument
301 return EC_KEY_dup(ecKey); in OpensslEcKeyDup()

Completed in 19 milliseconds