Home
last modified time | relevance | path

Searched refs:keyPair (Results 1 – 25 of 44) sorted by relevance

12

/base/security/crypto_framework/test/unittest/src/
Dcrypto_ecc_asy_key_generator_test.cpp335 HcfKeyPair *keyPair = nullptr; variable
336 res = generator->generateKeyPair(generator, nullptr, &keyPair);
339 ASSERT_NE(keyPair, nullptr);
341 HcfObjDestroy(keyPair);
353 HcfKeyPair *keyPair = nullptr; variable
354 res = generator->generateKeyPair(generator, nullptr, &keyPair);
357 ASSERT_NE(keyPair, nullptr);
359 HcfObjDestroy(keyPair);
371 HcfKeyPair *keyPair = nullptr; variable
372 res = generator->generateKeyPair(generator, nullptr, &keyPair);
[all …]
Dcrypto_sm2_asy_key_generator_test.cpp232 HcfKeyPair *keyPair = nullptr; variable
233 res = generator->generateKeyPair(generator, nullptr, &keyPair);
236 ASSERT_NE(keyPair, nullptr);
238 HcfObjDestroy(keyPair);
250 HcfKeyPair *keyPair = nullptr; variable
251 res = generator->generateKeyPair(nullptr, nullptr, &keyPair);
254 ASSERT_EQ(keyPair, nullptr);
267 HcfKeyPair *keyPair = nullptr; variable
268 res = generator->generateKeyPair((HcfAsyKeyGenerator *)&g_obj, nullptr, &keyPair);
271 ASSERT_EQ(keyPair, nullptr);
[all …]
Dcrypto_dsa_asy_key_generator_by_spec_test.cpp346 HcfKeyPair *keyPair = nullptr; variable
347 ret = generator->generateKeyPair(generator, &keyPair);
350 ASSERT_NE(keyPair, nullptr);
352 keyPair->priKey->clearMem(keyPair->priKey);
353 HcfObjDestroy(keyPair);
364 HcfKeyPair *keyPair = nullptr; variable
365 ret = generator->generateKeyPair(generator, &keyPair);
368 ASSERT_NE(keyPair, nullptr);
370 keyPair->priKey->clearMem(keyPair->priKey);
371 HcfObjDestroy(keyPair);
[all …]
Dcrypto_ecc_asy_key_generator_by_spec_test.cpp982 HcfKeyPair *keyPair = nullptr; variable
983 res = generator->generateKeyPair(generator, &keyPair);
986 ASSERT_NE(keyPair, nullptr);
988 HcfObjDestroy(keyPair);
1212 HcfKeyPair *keyPair = nullptr; variable
1213 res = generator->generateKeyPair(generator, &keyPair);
1216 ASSERT_NE(keyPair, nullptr);
1218 HcfObjDestroy(keyPair);
1281 HcfKeyPair *keyPair = nullptr; variable
1282 res = generator->generateKeyPair(generator, &keyPair);
[all …]
Dcrypto_sm2_cipher_test.cpp49 HcfKeyPair *keyPair = nullptr; in SetUpTestCase() local
50 res = generator->generateKeyPair(generator, nullptr, &keyPair); in SetUpTestCase()
52 ASSERT_NE(keyPair, nullptr); in SetUpTestCase()
54 sm2256KeyPair_ = keyPair; in SetUpTestCase()
144 HcfKeyPair *keyPair = nullptr; variable
145 res = generator->generateKeyPair(generator, nullptr, &keyPair);
151 res = cipher->init(cipher, ENCRYPT_MODE, (HcfKey *)keyPair->pubKey, nullptr);
154 HcfObjDestroy(keyPair);
165 HcfKeyPair *keyPair = nullptr; variable
166 res = generator->generateKeyPair(generator, nullptr, &keyPair);
[all …]
Dcrypto_rsa_verify_test.cpp191 HcfKeyPair *keyPair = nullptr; variable
192 res = generator->generateKeyPair(generator, nullptr, &keyPair);
198 res = verify->init(verify, nullptr, (HcfPubKey *)keyPair->priKey);
201 HcfObjDestroy(keyPair);
211 HcfKeyPair *keyPair = nullptr; variable
212 res = generator->generateKeyPair(generator, nullptr, &keyPair);
218 res = verify->init((HcfVerify *)generator, nullptr, keyPair->pubKey);
221 HcfObjDestroy(keyPair);
304 HcfKeyPair *keyPair = nullptr; variable
305 res = generator->generateKeyPair(generator, nullptr, &keyPair);
[all …]
Dcrypto_rsa_asy_key_generator_by_spec_cov_test.cpp213 HcfKeyPair *keyPair = nullptr; variable
214 res = spiObj->engineGenerateKeyPairBySpec(spiObj, nullptr, &keyPair);
216 EXPECT_EQ(keyPair, nullptr);
241 HcfKeyPair *keyPair = nullptr; variable
242 …gineGenerateKeyPairBySpec(spiObj, reinterpret_cast<HcfAsyKeyParamsSpec *>(&rsaPairSpec), &keyPair);
244 EXPECT_EQ(keyPair, nullptr);
269 HcfKeyPair *keyPair = nullptr; variable
270 …gineGenerateKeyPairBySpec(spiObj, reinterpret_cast<HcfAsyKeyParamsSpec *>(&rsaPairSpec), &keyPair);
272 EXPECT_EQ(keyPair, nullptr);
296 HcfKeyPair *keyPair = nullptr; variable
[all …]
Dcrypto_rsa_asy_key_generator_test.cpp395 HcfKeyPair *keyPair = nullptr; variable
396 res = generator->generateKeyPair(generator, nullptr, &keyPair);
399 EXPECT_NE(keyPair, nullptr);
400 EXPECT_NE(keyPair->priKey, nullptr);
401 EXPECT_NE(keyPair->pubKey, nullptr);
402 EXPECT_NE(keyPair->base.getClass(), nullptr);
403 EXPECT_NE(keyPair->base.destroy, nullptr);
405 HcfPubKey *pubkey = keyPair->pubKey;
411 HcfPriKey *prikey = keyPair->priKey;
418 HcfObjDestroy(keyPair);
[all …]
Dcrypto_rsa_sign_test.cpp355 HcfKeyPair *keyPair = nullptr; variable
356 res = generator->generateKeyPair(generator, nullptr, &keyPair);
363 HcfPubKey *pubKey = keyPair->pubKey;
370 HcfObjDestroy(keyPair);
413 HcfKeyPair *keyPair = nullptr; variable
414 res = generator->generateKeyPair(generator, nullptr, &keyPair);
421 res = sign->init((HcfSign *)generator, nullptr, keyPair->priKey);
426 HcfObjDestroy(keyPair);
435 HcfKeyPair *keyPair = nullptr; variable
436 res = generator->generateKeyPair(generator, nullptr, &keyPair);
[all …]
Dcrypto_rsa_cipher_test.cpp553 HcfKeyPair *keyPair = nullptr; variable
554 res = generator->generateKeyPair(generator, nullptr, &keyPair);
560 res = cipher->init(cipher, ENCRYPT_MODE, (HcfKey *)keyPair->pubKey, nullptr);
563 HcfObjDestroy(keyPair);
574 HcfKeyPair *keyPair = nullptr; variable
575 res = generator->generateKeyPair(generator, nullptr, &keyPair);
581 res = cipher->init(cipher, (enum HcfCryptoMode)123, (HcfKey *)keyPair->pubKey, nullptr);
584 HcfObjDestroy(keyPair);
595 HcfKeyPair *keyPair = nullptr; variable
596 res = generator->generateKeyPair(generator, nullptr, &keyPair);
[all …]
Dcrypto_rsa_asy_key_generator_by_spec_test.cpp956 HcfKeyPair *keyPair = nullptr; variable
957 res = generator->generateKeyPair(generator, &keyPair);
959 EXPECT_EQ(keyPair, nullptr);
961 HcfObjDestroy(keyPair);
1024 HcfKeyPair *keyPair = nullptr; variable
1025 res = generator->generateKeyPair(generator, &keyPair);
1027 EXPECT_NE(keyPair, nullptr);
1029 HcfObjDestroy(keyPair);
1094 HcfKeyPair *keyPair = nullptr; variable
1095 res = generator->generateKeyPair(generator, &keyPair);
[all …]
Dcrypto_sm2_sign_test.cpp60 HcfKeyPair *keyPair = nullptr; in SetUpTestCase() local
61 res = generator->generateKeyPair(generator, nullptr, &keyPair); in SetUpTestCase()
63 ASSERT_NE(keyPair, nullptr); in SetUpTestCase()
65 sm2256KeyPair_ = keyPair; in SetUpTestCase()
687 HcfKeyPair *keyPair = nullptr; variable
688 res = generator->generateKeyPair(generator, nullptr, &keyPair);
690 ASSERT_NE(keyPair, nullptr);
700 res = sign->init(sign, &params, keyPair->priKey);
726 HcfKeyPair *keyPair = nullptr; variable
727 res = generator->generateKeyPair(generator, nullptr, &keyPair);
[all …]
Dcrypto_dsa_asy_key_generator_test.cpp53 HcfKeyPair *keyPair = nullptr; in GenerateDsa1024KeyPair() local
54 ret = generator->generateKeyPair(generator, nullptr, &keyPair); in GenerateDsa1024KeyPair()
59 *returnKeyPair = keyPair; in GenerateDsa1024KeyPair()
70 HcfKeyPair *keyPair = nullptr; in GenerateDsa2048KeyPair() local
71 ret = generator->generateKeyPair(generator, nullptr, &keyPair); in GenerateDsa2048KeyPair()
76 *returnKeyPair = keyPair; in GenerateDsa2048KeyPair()
87 HcfKeyPair *keyPair = nullptr; in GenerateDsa3072KeyPair() local
88 ret = generator->generateKeyPair(generator, nullptr, &keyPair); in GenerateDsa3072KeyPair()
93 *returnKeyPair = keyPair; in GenerateDsa3072KeyPair()
133 static HcfResult GetKeyEncodedTest(HcfKeyPair *keyPair, HcfBlob *pkBlob, HcfBlob *skBlob) in GetKeyEncodedTest() argument
[all …]
Dcrypto_dsa_exception_test.cpp289 HcfKeyPair *keyPair = nullptr; variable
290 HcfResult ret = CreateDsaKeyPairByCommSpec(&dsaCommonSpecException, &keyPair);
304 HcfKeyPair *keyPair = nullptr; variable
305 HcfResult ret = EngineGenerateDsaKeyPair((HcfAsyKeyGeneratorSpi *)&g_obj, &keyPair);
320 HcfKeyPair *keyPair = nullptr; variable
321 ret = EngineConvertDsaKey((HcfAsyKeyGeneratorSpi *)&g_obj, nullptr, nullptr, nullptr, &keyPair);
336 HcfKeyPair *keyPair = nullptr; variable
337 …= EngineGenerateDsaKeyPairBySpec((const HcfAsyKeyGeneratorSpi *)&g_obj, &asySpecKeyPair, &keyPair);
/base/security/certificate_manager/services/cert_manager_standard/cert_manager_engine/main/core/src/
Dcert_manager_app_cert_process.c230 struct CmBlob keyPair = { 0, NULL }; in ImportRsaKey() local
241 ret = SaveKeyMaterialRsa(rsa, keySize, &keyPair); in ImportRsaKey()
253 ret = CmKeyOpImportKey(keyUri, &props, &keyPair); in ImportRsaKey()
259 if (keyPair.data != NULL) { in ImportRsaKey()
260 (void)memset_s(keyPair.data, keyPair.size, 0, keyPair.size); in ImportRsaKey()
261 CMFree(keyPair.data); in ImportRsaKey()
268 struct CmBlob keyPair = { 0, NULL }; in ImportEccKey() local
279 ret = SaveKeyMaterialEcc(eccKey, keyLen, &keyPair); in ImportEccKey()
291 ret = CmKeyOpImportKey(keyUri, &props, &keyPair); in ImportEccKey()
297 if (keyPair.data != NULL) { in ImportEccKey()
[all …]
/base/security/device_auth/deps_adapter/key_management_adapter/impl/src/standard/
Dmbedtls_ec_adapter.c160 static int EcKeyAgreementLog(mbedtls_ecp_keypair *keyPair, mbedtls_ecp_point *p, mbedtls_ctr_drbg_c… in EcKeyAgreementLog() argument
162 …return mbedtls_ecp_mul_restartable(&keyPair->MBEDTLS_PRIVATE(grp), p, &keyPair->MBEDTLS_PRIVATE(d), in EcKeyAgreementLog()
163 &keyPair->MBEDTLS_PRIVATE(Q), mbedtls_ctr_drbg_random, ctrDrbg, NULL); in EcKeyAgreementLog()
174 mbedtls_ecp_keypair *keyPair = HcMalloc(sizeof(mbedtls_ecp_keypair), 0); in EcKeyAgreement() local
177 if ((secret == NULL) || (keyPair == NULL) || (entropy == NULL) || (ctrDrbg == NULL)) { in EcKeyAgreement()
180 HcFree(keyPair); in EcKeyAgreement()
186 mbedtls_ecp_keypair_init(keyPair); in EcKeyAgreement()
191 int32_t ret = ReadEcPublicKey(&keyPair->MBEDTLS_PRIVATE(Q), publicKey); in EcKeyAgreement()
193 ret = mbedtls_ecp_group_load(&keyPair->MBEDTLS_PRIVATE(grp), MBEDTLS_ECP_DP_SECP256R1); in EcKeyAgreement()
195 …ret = mbedtls_mpi_read_binary(&keyPair->MBEDTLS_PRIVATE(d), privateKey->data, privateKey->dataSize… in EcKeyAgreement()
[all …]
/base/security/crypto_framework/test/fuzztest/key/asykeygenerator_fuzzer/
Dasykeygenerator_fuzzer.cpp538 HcfKeyPair *keyPair = nullptr; in TestEccKey() local
539 res = generator->generateKeyPair(generator, nullptr, &keyPair); in TestEccKey()
555 HcfObjDestroy(keyPair); in TestEccKey()
567 HcfKeyPair *keyPair = nullptr; in TestRsaKey() local
568 res = generator->generateKeyPair(generator, nullptr, &keyPair); in TestRsaKey()
575 (void)keyPair->pubKey->base.getEncoded(&(keyPair->pubKey->base), &pubKeyBlob); in TestRsaKey()
576 (void)keyPair->priKey->base.getEncoded(&(keyPair->priKey->base), &priKeyBlob); in TestRsaKey()
588 HcfObjDestroy(keyPair); in TestRsaKey()
599 HcfKeyPair *keyPair = nullptr; in TestDsaKey() local
600 res = generator->generateKeyPair(generator, nullptr, &keyPair); in TestDsaKey()
[all …]
/base/hiviewdfx/hiview/base/event_store/store/include/
Dsys_event_doc_lru_cache.h47 size_t operator() (const std::pair<std::string, std::string>& keyPair) const in operator()
49 … return std::hash<std::string>()(keyPair.first) ^ std::hash<std::string>()(keyPair.second); in operator()
/base/security/crypto_framework/test/fuzztest/crypto_operation/hcfciphercreate_fuzzer/
Dhcfciphercreate_fuzzer.cpp155 HcfKeyPair *keyPair = nullptr; in TestRsaCipher() local
156 res = generator->generateKeyPair(generator, nullptr, &keyPair); in TestRsaCipher()
168 HcfObjDestroy(keyPair); in TestRsaCipher()
172 … (void)cipher->init(cipher, ENCRYPT_MODE, reinterpret_cast<HcfKey *>(keyPair->pubKey), nullptr); in TestRsaCipher()
181 HcfObjDestroy(keyPair); in TestRsaCipher()
184 … (void)cipher->init(cipher, DECRYPT_MODE, reinterpret_cast<HcfKey *>(keyPair->priKey), nullptr); in TestRsaCipher()
189 HcfObjDestroy(keyPair); in TestRsaCipher()
/base/security/huks/frameworks/huks_standard/main/crypto_engine/openssl/include/
Dhks_openssl_sm2.h49 int32_t HksOpensslSm2Encrypt(const struct HksBlob *keyPair, const struct HksUsageSpec *usageSpec,
51 int32_t HksOpensslSm2Decrypt(const struct HksBlob *keyPair, const struct HksUsageSpec *usageSpec,
/base/security/huks/frameworks/huks_standard/main/crypto_engine/openssl/src/
Dhks_openssl_sm2.c171 static int32_t PushPubKeyToParam(const uint8_t *keyPair, const struct KeyMaterialEcc *size, in PushPubKeyToParam() argument
185 keyPair + sizeof(struct KeyMaterialEcc), size->xSize); in PushPubKeyToParam()
191 keyPair + sizeof(struct KeyMaterialEcc) + size->xSize, size->ySize); in PushPubKeyToParam()
208 uint8_t *keyPair, const struct KeyMaterialEcc *size, enum HksKeyPurpose keyPurpose) in ConstructSm2ParamsFromRawKey() argument
231 ret = PushPubKeyToParam(keyPair, size, fullSize, uncompressedPublicKey, paramBld); in ConstructSm2ParamsFromRawKey()
241 priBn = BN_bin2bn(keyPair + sizeof(struct KeyMaterialEcc) + size->xSize + size->ySize, in ConstructSm2ParamsFromRawKey()
264 uint8_t *keyPair = keyBlob->data; in Sm2InitKey() local
272 OSSL_PARAM *params = ConstructSm2ParamsFromRawKey(keyPair, &keyMaterial, keyPurpose); in Sm2InitKey()
456 int HksOpensslSm2Encrypt(const struct HksBlob *keyPair, const struct HksUsageSpec *usageSpec, in HksOpensslSm2Encrypt() argument
460 EVP_PKEY_CTX *ctx = InitSm2Ctx(keyPair, usageSpec->digest, HKS_KEY_PURPOSE_ENCRYPT, NULL); in HksOpensslSm2Encrypt()
[all …]
/base/security/huks/test/unittest/huks_standard_test/module_test/service_test/huks_engine/core/src/
Dhks_core_service_test.cpp336 struct Hks25519KeyPair keyPair = { .publicBufferSize = 0, .privateBufferSize = tooBigger }; variable
337 struct HksBlob key = { .size = sizeof(keyPair), .data = (uint8_t *)&keyPair };
351 struct Hks25519KeyPair keyPair = { .publicBufferSize = tooBigger, .privateBufferSize = 0 }; variable
352 struct HksBlob key = { .size = sizeof(keyPair), .data = (uint8_t *)&keyPair };
388 struct Hks25519KeyPair keyPair = { .publicBufferSize = tooBigger, .privateBufferSize = 0 }; variable
389 struct HksBlob key = { .size = sizeof(keyPair), .data = (uint8_t *)&keyPair };
/base/security/huks/test/unittest/huks_standard_test/interface_inner_test/alg_module_test/src/
Dopenssl_ecc_helper.c170 static int32_t EccInitPublicKey(EC_KEY *eccKey, const uint8_t *keyPair, uint32_t xSize, uint32_t yS… in EccInitPublicKey() argument
180 BIGNUM *pubX = BN_bin2bn(keyPair + offset, xSize, NULL); in EccInitPublicKey()
182 BIGNUM *pubY = BN_bin2bn(keyPair + offset, ySize, NULL); in EccInitPublicKey()
218 uint8_t *keyPair = keyBlob->data; in EccInitKey() local
224 if (GetEccModules(keyPair, &keySize, &publicXSize, &publicYSize, &privateSize) != 0) { in EccInitKey()
238 if (EccInitPublicKey(eccKey, keyPair, publicXSize, publicYSize) != ECC_SUCCESS) { in EccInitKey()
244 …BIGNUM *pri = BN_bin2bn(keyPair + sizeof(struct KeyMaterialEcc) + publicXSize + publicYSize, priva… in EccInitKey()
537 uint8_t *keyPair = key->data; in HksBlobToX509() local
543 if (GetEccModules(keyPair, &keySize, &publicXSize, &publicYSize, &privateSize) != 0) { in HksBlobToX509()
557 if (EccInitPublicKey(eccKey, keyPair, publicXSize, publicYSize) != ECC_SUCCESS) { in HksBlobToX509()
/base/security/crypto_framework/frameworks/js/napi/crypto/inc/
Dnapi_key_pair.h29 explicit NapiKeyPair(HcfKeyPair *keyPair);
/base/security/crypto_framework/frameworks/js/napi/crypto/src/
Dnapi_key_pair.cpp29 NapiKeyPair::NapiKeyPair(HcfKeyPair *keyPair) in NapiKeyPair() argument
31 this->keyPair_ = keyPair; in NapiKeyPair()

12