Home
last modified time | relevance | path

Searched refs:generator (Results 1 – 25 of 63) sorted by relevance

123

/base/security/crypto_framework/test/unittest/src/
Dcrypto_ecc_asy_key_generator_test.cpp154 HcfAsyKeyGenerator *generator = nullptr; variable
155 int32_t res = HcfAsyKeyGeneratorCreate("ECC224", &generator);
158 ASSERT_NE(generator, nullptr);
160 HcfObjDestroy(generator);
165 HcfAsyKeyGenerator *generator = nullptr; variable
166 int32_t res = HcfAsyKeyGeneratorCreate("ECC256", &generator);
169 ASSERT_NE(generator, nullptr);
171 HcfObjDestroy(generator);
176 HcfAsyKeyGenerator *generator = nullptr; variable
177 int32_t res = HcfAsyKeyGeneratorCreate("ECC384", &generator);
[all …]
Dcrypto_dsa_asy_key_generator_by_spec_test.cpp269 HcfAsyKeyGeneratorBySpec *generator = nullptr; variable
270 …cfAsyKeyGeneratorBySpecCreate(reinterpret_cast<HcfAsyKeyParamsSpec *>(&dsaCommonSpec), &generator);
273 ASSERT_NE(generator, nullptr);
275 HcfObjDestroy(generator);
280 HcfAsyKeyGeneratorBySpec *generator = nullptr; variable
281 … = HcfAsyKeyGeneratorBySpecCreate(reinterpret_cast<HcfAsyKeyParamsSpec *>(&dsaPkSpec), &generator);
284 ASSERT_NE(generator, nullptr);
286 HcfObjDestroy(generator);
291 HcfAsyKeyGeneratorBySpec *generator = nullptr; variable
293 &generator);
[all …]
Dcrypto_sm2_asy_key_generator_test.cpp84 HcfAsyKeyGenerator *generator = nullptr; variable
85 int32_t res = HcfAsyKeyGeneratorCreate("SM2_256", &generator);
88 ASSERT_NE(generator, nullptr);
90 HcfObjDestroy(generator);
95 HcfAsyKeyGenerator *generator = nullptr; variable
96 int32_t res = HcfAsyKeyGeneratorCreate(nullptr, &generator);
99 ASSERT_EQ(generator, nullptr);
104 HcfAsyKeyGenerator *generator = nullptr; variable
106 "ABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCD", &generator);
109 ASSERT_EQ(generator, nullptr);
[all …]
Dcrypto_sm4_generator_test.cpp58 HcfSymKeyGenerator *generator = nullptr; in GenerateSymKey() local
60 int32_t ret = HcfSymKeyGeneratorCreate(algoName, &generator); in GenerateSymKey()
66 ret = generator->generateSymKey(generator, key); in GenerateSymKey()
70 HcfObjDestroy((HcfObjectBase *)generator); in GenerateSymKey()
77 HcfSymKeyGenerator *generator = nullptr; variable
82 ret = HcfSymKeyGeneratorCreate(inputAlgoName, &generator);
87 ret = generator->generateSymKey(generator, &key);
94 generatorAlgoName = generator->getAlgoName(generator);
107 HcfObjDestroy(generator);
114 HcfSymKeyGenerator *generator = nullptr; variable
[all …]
Dcrypto_rsa_asy_key_generator_by_spec_test.cpp816 static bool CheckGeneratorBySpecKeyFunc(HcfAsyKeyGeneratorBySpec *generator) in CheckGeneratorBySpecKeyFunc() argument
818 if (generator->generateKeyPair == nullptr || generator->generatePriKey == nullptr || in CheckGeneratorBySpecKeyFunc()
819 generator->generatePubKey == nullptr) { in CheckGeneratorBySpecKeyFunc()
832 HcfAsyKeyGeneratorBySpec *generator = nullptr; variable
833 … HcfAsyKeyGeneratorBySpecCreate(reinterpret_cast<HcfAsyKeyParamsSpec *>(&rsaCommSpec), &generator);
835 EXPECT_EQ(generator, nullptr);
837 HcfObjDestroy(generator);
847 HcfAsyKeyGeneratorBySpec *generator = nullptr; variable
848 …cfAsyKeyGeneratorBySpecCreate(reinterpret_cast<HcfAsyKeyParamsSpec *>(&rsaPubKeySpec), &generator);
850 EXPECT_NE(generator, nullptr);
[all …]
Dcrypto_dsa_asy_key_generator_test.cpp48 HcfAsyKeyGenerator *generator = nullptr; in GenerateDsa1024KeyPair() local
49 HcfResult ret = HcfAsyKeyGeneratorCreate("DSA1024", &generator); in GenerateDsa1024KeyPair()
54 ret = generator->generateKeyPair(generator, nullptr, &keyPair); in GenerateDsa1024KeyPair()
55 HcfObjDestroy(generator); in GenerateDsa1024KeyPair()
65 HcfAsyKeyGenerator *generator = nullptr; in GenerateDsa2048KeyPair() local
66 HcfResult ret = HcfAsyKeyGeneratorCreate("DSA2048", &generator); in GenerateDsa2048KeyPair()
71 ret = generator->generateKeyPair(generator, nullptr, &keyPair); in GenerateDsa2048KeyPair()
72 HcfObjDestroy(generator); in GenerateDsa2048KeyPair()
82 HcfAsyKeyGenerator *generator = nullptr; in GenerateDsa3072KeyPair() local
83 HcfResult ret = HcfAsyKeyGeneratorCreate("DSA3072", &generator); in GenerateDsa3072KeyPair()
[all …]
Dcrypto_ecc_asy_key_generator_by_spec_test.cpp701 HcfAsyKeyGeneratorBySpec *generator = nullptr; variable
702 res = HcfAsyKeyGeneratorBySpecCreate(paramSpec, &generator);
705 ASSERT_NE(generator, nullptr);
707 HcfObjDestroy(generator);
717 HcfAsyKeyGeneratorBySpec *generator = nullptr; variable
718 res = HcfAsyKeyGeneratorBySpecCreate(paramSpec, &generator);
721 ASSERT_NE(generator, nullptr);
723 HcfObjDestroy(generator);
733 HcfAsyKeyGeneratorBySpec *generator = nullptr; variable
734 res = HcfAsyKeyGeneratorBySpecCreate(paramSpec, &generator);
[all …]
Dcrypto_rsa_asy_key_generator_test.cpp81 HcfAsyKeyGenerator *generator = nullptr; variable
82 HcfResult res = HcfAsyKeyGeneratorCreate("RSA512", &generator);
84 EXPECT_NE(generator, nullptr);
85 EXPECT_NE(generator->base.getClass(), nullptr);
86 EXPECT_NE(generator->base.destroy, nullptr);
87 EXPECT_NE(generator->generateKeyPair, nullptr);
88 EXPECT_NE(generator->getAlgoName, nullptr);
89 HcfObjDestroy(generator);
94 HcfAsyKeyGenerator *generator = nullptr; variable
95 HcfResult res = HcfAsyKeyGeneratorCreate("RSA768", &generator);
[all …]
Dcrypto_asy_key_generator_cov_test.cpp700 HcfAsyKeyGeneratorBySpec *generator = nullptr; variable
702 &generator);
704 EXPECT_EQ(generator, nullptr);
709 HcfAsyKeyGeneratorBySpec *generator = nullptr; variable
711 &generator);
713 EXPECT_EQ(generator, nullptr);
718 HcfAsyKeyGeneratorBySpec *generator = nullptr; variable
720 &generator);
722 EXPECT_EQ(generator, nullptr);
727 HcfAsyKeyGeneratorBySpec *generator = nullptr; variable
[all …]
Dcrypto_rsa_sign_test.cpp353 HcfAsyKeyGenerator *generator = nullptr; variable
354 res = HcfAsyKeyGeneratorCreate("RSA768|PRIMES_2", &generator);
356 res = generator->generateKeyPair(generator, nullptr, &keyPair);
369 HcfObjDestroy(generator);
411 HcfAsyKeyGenerator *generator = nullptr; variable
412 res = HcfAsyKeyGeneratorCreate("RSA1024|PRIMES_2", &generator);
414 res = generator->generateKeyPair(generator, nullptr, &keyPair);
421 res = sign->init((HcfSign *)generator, nullptr, keyPair->priKey);
425 HcfObjDestroy(generator);
433 HcfAsyKeyGenerator *generator = nullptr; variable
[all …]
Dcrypto_rsa_verify_test.cpp189 HcfAsyKeyGenerator *generator = nullptr; variable
190 HcfResult res = HcfAsyKeyGeneratorCreate("RSA2048|PRIMES_2", &generator);
192 res = generator->generateKeyPair(generator, nullptr, &keyPair);
202 HcfObjDestroy(generator);
209 HcfAsyKeyGenerator *generator = nullptr; variable
210 HcfResult res = HcfAsyKeyGeneratorCreate("RSA2048|PRIMES_2", &generator);
212 res = generator->generateKeyPair(generator, nullptr, &keyPair);
218 res = verify->init((HcfVerify *)generator, nullptr, keyPair->pubKey);
222 HcfObjDestroy(generator);
230 HcfAsyKeyGenerator *generator = nullptr; variable
[all …]
Dcrypto_sm2_cipher_test.cpp44 HcfAsyKeyGenerator *generator = nullptr; in SetUpTestCase() local
45 int32_t res = HcfAsyKeyGeneratorCreate("SM2_256", &generator); in SetUpTestCase()
47 ASSERT_NE(generator, nullptr); in SetUpTestCase()
50 res = generator->generateKeyPair(generator, nullptr, &keyPair); in SetUpTestCase()
56 HcfObjDestroy(generator); in SetUpTestCase()
141 HcfAsyKeyGenerator *generator = nullptr; variable
142 res = HcfAsyKeyGeneratorCreate("SM2_256", &generator);
145 res = generator->generateKeyPair(generator, nullptr, &keyPair);
155 HcfObjDestroy(generator);
162 HcfAsyKeyGenerator *generator = nullptr; variable
[all …]
Dcrypto_sm3_mac_test.cpp145 HcfSymKeyGenerator *generator = nullptr; variable
146 ret = HcfSymKeyGeneratorCreate("AES128", &generator);
153 generator->convertSymKey(generator, &keyMaterialBlob, &key);
159 HcfObjDestroy(generator);
185 HcfSymKeyGenerator *generator = nullptr; variable
186 ret = HcfSymKeyGeneratorCreate("AES128", &generator);
193 generator->convertSymKey(generator, &keyMaterialBlob, &key);
203 HcfObjDestroy(generator);
213 HcfSymKeyGenerator *generator = nullptr; variable
214 ret = HcfSymKeyGeneratorCreate("AES128", &generator);
[all …]
Dcrypto_3des_cipher_test.cpp57 HcfSymKeyGenerator *generator = nullptr; in GenerateDesSymKey() local
59 HcfResult ret = HcfSymKeyGeneratorCreate("3DES192", &generator); in GenerateDesSymKey()
65 ret = generator->generateSymKey(generator, key); in GenerateDesSymKey()
69 HcfObjDestroy(generator); in GenerateDesSymKey()
233 HcfSymKeyGenerator *generator = nullptr; variable
237 ret = HcfSymKeyGeneratorCreate("3DES192", &generator);
243 ret = generator->generateSymKey(generator, &key);
270 HcfObjDestroy((HcfObjectBase *)generator);
280 HcfSymKeyGenerator *generator = nullptr; variable
284 ret = HcfSymKeyGeneratorCreate("3DES192", &generator);
[all …]
Dcrypto_mac_test.cpp149 HcfSymKeyGenerator *generator = nullptr; variable
150 ret = HcfSymKeyGeneratorCreate("AES128", &generator);
157 generator->convertSymKey(generator, &keyMaterialBlob, &key);
163 HcfObjDestroy(generator);
189 HcfSymKeyGenerator *generator = nullptr; variable
190 ret = HcfSymKeyGeneratorCreate("AES128", &generator);
197 generator->convertSymKey(generator, &keyMaterialBlob, &key);
207 HcfObjDestroy(generator);
217 HcfSymKeyGenerator *generator = nullptr; variable
218 ret = HcfSymKeyGeneratorCreate("AES128", &generator);
[all …]
Dcrypto_sm4_cipher_test.cpp60 HcfSymKeyGenerator *generator = nullptr; in GenerateSm4SymKey() local
62 HcfResult ret = HcfSymKeyGeneratorCreate("SM4_128", &generator); in GenerateSm4SymKey()
68 ret = generator->generateSymKey(generator, key); in GenerateSm4SymKey()
72 HcfObjDestroy(generator); in GenerateSm4SymKey()
78 HcfSymKeyGenerator *generator = nullptr; in GenerateSymKey() local
80 int32_t ret = HcfSymKeyGeneratorCreate(algoName, &generator); in GenerateSymKey()
86 ret = generator->generateSymKey(generator, key); in GenerateSymKey()
90 HcfObjDestroy((HcfObjectBase *)generator); in GenerateSymKey()
335 HcfSymKeyGenerator *generator = nullptr; variable
339 ret = HcfSymKeyGeneratorCreate("SM4_128", &generator);
[all …]
Dcrypto_rsa_cipher_test.cpp550 HcfAsyKeyGenerator *generator = nullptr; variable
551 res = HcfAsyKeyGeneratorCreate("RSA1024|PRIMES_2", &generator);
554 res = generator->generateKeyPair(generator, nullptr, &keyPair);
564 HcfObjDestroy(generator);
571 HcfAsyKeyGenerator *generator = nullptr; variable
572 res = HcfAsyKeyGeneratorCreate("RSA1024|PRIMES_2", &generator);
575 res = generator->generateKeyPair(generator, nullptr, &keyPair);
585 HcfObjDestroy(generator);
592 HcfAsyKeyGenerator *generator = nullptr; variable
593 res = HcfAsyKeyGeneratorCreate("RSA1024|PRIMES_2", &generator);
[all …]
Dcrypto_aes_cipher_test.cpp85 HcfSymKeyGenerator *generator = nullptr; in GenerateSymKey() local
87 int32_t ret = HcfSymKeyGeneratorCreate(algoName, &generator); in GenerateSymKey()
93 ret = generator->generateSymKey(generator, key); in GenerateSymKey()
97 HcfObjDestroy((HcfObjectBase *)generator); in GenerateSymKey()
103 HcfSymKeyGenerator *generator = nullptr; in ConvertSymKey() local
110 int32_t ret = HcfSymKeyGeneratorCreate(algoName, &generator); in ConvertSymKey()
116 ret = generator->convertSymKey(generator, &keyTmpBlob, key); in ConvertSymKey()
121 HcfObjDestroy((HcfObjectBase *)generator); in ConvertSymKey()
564 HcfSymKeyGenerator *generator = nullptr; variable
568 ret = HcfSymKeyGeneratorCreate("AES128", &generator);
[all …]
Dcrypto_rsa_asy_key_generator_by_spec_cov_test.cpp590 HcfAsyKeyGeneratorBySpec *generator = nullptr; variable
591 … HcfAsyKeyGeneratorBySpecCreate(reinterpret_cast<HcfAsyKeyParamsSpec *>(&rsaPairSpec), &generator);
593 EXPECT_NE(generator, nullptr);
596 res = generator->generateKeyPair(generator, &keyPair);
603 HcfObjDestroy(generator);
614 HcfAsyKeyGeneratorBySpec *generator = nullptr; variable
615 … HcfAsyKeyGeneratorBySpecCreate(reinterpret_cast<HcfAsyKeyParamsSpec *>(&rsaPairSpec), &generator);
617 EXPECT_NE(generator, nullptr);
620 res = generator->generateKeyPair(generator, &keyPair);
627 HcfObjDestroy(generator);
[all …]
/base/security/crypto_framework/test/fuzztest/key/asykeygenerator_fuzzer/
Dasykeygenerator_fuzzer.cpp532 HcfAsyKeyGenerator *generator = nullptr; in TestEccKey() local
533 int32_t res = HcfAsyKeyGeneratorCreate("ECC224", &generator); in TestEccKey()
537 (void)generator->getAlgoName(generator); in TestEccKey()
539 res = generator->generateKeyPair(generator, nullptr, &keyPair); in TestEccKey()
541 HcfObjDestroy(generator); in TestEccKey()
554 …(void)generator->convertKey(generator, nullptr, &mockEcc224PubKeyBlob, &mockEcc224PriKeyBlob, &con… in TestEccKey()
556 HcfObjDestroy(generator); in TestEccKey()
562 HcfAsyKeyGenerator *generator = nullptr; in TestRsaKey() local
563 HcfResult res = HcfAsyKeyGeneratorCreate("RSA1024", &generator); in TestRsaKey()
568 res = generator->generateKeyPair(generator, nullptr, &keyPair); in TestRsaKey()
[all …]
/base/security/crypto_framework/test/fuzztest/key/symkeygenerator_fuzzer/
Dsymkeygenerator_fuzzer.cpp30 HcfSymKeyGenerator *generator = nullptr; in SymKeyGeneratorFuzzTest() local
33 ret = HcfSymKeyGeneratorCreate(algoName.c_str(), &generator); in SymKeyGeneratorFuzzTest()
38 ret = generator->generateSymKey(generator, &key); in SymKeyGeneratorFuzzTest()
40 HcfObjDestroy(generator); in SymKeyGeneratorFuzzTest()
44 HcfObjDestroy(generator); in SymKeyGeneratorFuzzTest()
/base/security/crypto_framework/test/fuzztest/crypto_operation/hcfciphercreate_fuzzer/
Dhcfciphercreate_fuzzer.cpp120 HcfSymKeyGenerator *generator = nullptr; in TestAesCipher() local
123 ret = HcfSymKeyGeneratorCreate("AES128", &generator); in TestAesCipher()
127 ret = generator->generateSymKey(generator, &key); in TestAesCipher()
129 HcfObjDestroy(generator); in TestAesCipher()
134 HcfObjDestroy(generator); in TestAesCipher()
141 HcfObjDestroy(generator); in TestAesCipher()
150 HcfAsyKeyGenerator *generator = nullptr; in TestRsaCipher() local
151 res = HcfAsyKeyGeneratorCreate("RSA1024|PRIMES_2", &generator); in TestRsaCipher()
156 res = generator->generateKeyPair(generator, nullptr, &keyPair); in TestRsaCipher()
158 HcfObjDestroy(generator); in TestRsaCipher()
[all …]
/base/security/crypto_framework/test/fuzztest/crypto_operation/hcfsigncreate_fuzzer/
Dhcfsigncreate_fuzzer.cpp33 HcfAsyKeyGenerator *generator = nullptr; in TestSign() local
34 HcfResult res = HcfAsyKeyGeneratorCreate("ECC384", &generator); in TestSign()
40 res = generator->generateKeyPair(generator, nullptr, &ecc384KeyPair); in TestSign()
41 HcfObjDestroy(generator); in TestSign()
/base/security/crypto_framework/test/fuzztest/crypto_operation/hcfmaccreate_fuzzer/
Dhcfmaccreate_fuzzer.cpp38 HcfSymKeyGenerator *generator = nullptr; in TestMac() local
39 (void)HcfSymKeyGeneratorCreate("AES128", &generator); in TestMac()
44 generator->convertSymKey(generator, &keyMaterialBlob, &key); in TestMac()
58 HcfObjDestroy(generator); in TestMac()
/base/security/crypto_framework/test/fuzztest/crypto_operation/hcfverifycreate_fuzzer/
Dhcfverifycreate_fuzzer.cpp33 HcfAsyKeyGenerator *generator = nullptr; in TestVerify() local
34 HcfResult res = HcfAsyKeyGeneratorCreate("ECC224", &generator); in TestVerify()
40 res = generator->generateKeyPair(generator, nullptr, &ecc224KeyPair); in TestVerify()
41 HcfObjDestroy(generator); in TestVerify()

123