/base/security/huks/test/reliability/src/ |
H A D | api_pressure_test.cpp | 123 void AESModeRandForCiper(struct HksParamSet *paramInSet) in AESModeRandForCiper() argument 140 HksAddParams(paramInSet, paramMode[indexOfMode], 1); in AESModeRandForCiper() 143 HksAddParams(paramInSet, &tagIv, 1); in AESModeRandForCiper() 144 HksAddParams(paramInSet, paramPadding[GetRandom() % countOfPadding], 1); in AESModeRandForCiper() 146 HksAddParams(paramInSet, &g_PARAM_PADDING_NONE, 1); in AESModeRandForCiper() 148 HksAddParams(paramInSet, &tagIv, 1); in AESModeRandForCiper() 151 HksAddParams(paramInSet, &tagIv, 1); in AESModeRandForCiper() 153 HksAddParams(paramInSet, paramPadding[GetRandom() % countOfPadding], 1); in AESModeRandForCiper() 155 HksAddParams(paramInSet, &g_PARAM_PADDING_NONE, 1); in AESModeRandForCiper() 158 HksAddParams(paramInSet, in AESModeRandForCiper() 167 ParamForAESCipher(struct HksParamSet *paramInSet) ParamForAESCipher() argument 179 RSAKeySizeRand(struct HksParamSet *paramInSet) RSAKeySizeRand() argument 193 RSAKeySizeWithout512(struct HksParamSet *paramInSet) RSAKeySizeWithout512() argument 206 RSAKeySizeWithout768(struct HksParamSet *paramInSet) RSAKeySizeWithout768() argument 218 OaepSha512KeySize(struct HksParamSet *paramInSet) OaepSha512KeySize() argument 229 ParamForRSACipher(struct HksParamSet *paramInSet) ParamForRSACipher() argument 269 ParamForCipher(struct HksParamSet *paramInSet) ParamForCipher() argument 286 ShaForPkcs1(struct HksParamSet *paramInSet) ShaForPkcs1() argument 308 ShaForPss(struct HksParamSet *paramInSet) ShaForPss() argument 339 ParamForRSASign(struct HksParamSet *paramInSet) ParamForRSASign() argument 355 ParamForECCSign(struct HksParamSet *paramInSet) ParamForECCSign() argument 378 ParamForDSASign(struct HksParamSet *paramInSet) ParamForDSASign() argument 393 ParamForSign(struct HksParamSet *paramInSet) ParamForSign() argument 545 struct HksParamSet *paramInSet = nullptr; GenerateKeyTest() local 557 ImportKeyTest(const struct HksBlob *authId, const struct HksParamSet *paramInSet) ImportKeyTest() argument 572 ExportPublicKeyTest(const struct HksBlob *authId, const struct HksParamSet *paramInSet) ExportPublicKeyTest() argument 595 struct HksParamSet *paramInSet = nullptr; DeleteKeyTest() local 608 GetKeyParamSetTest(const struct HksBlob *authId, const struct HksParamSet *paramInSet) GetKeyParamSetTest() argument 629 KeyExistTest(const struct HksBlob *authId, const struct HksParamSet *paramInSet) KeyExistTest() argument 643 struct HksParamSet *paramInSet = nullptr; GenerateRandomTest() local 663 SignTest( const struct HksBlob *authId, const struct HksParamSet *paramInSet, const struct HksBlob *message) SignTest() argument 677 VerifyTest(const struct HksBlob *authId, const struct HksParamSet *paramInSet, const struct HksBlob *message, const struct HksBlob *signature) VerifyTest() argument 688 EncryptTest(const struct HksBlob *authId, const struct HksParamSet *paramInSet) EncryptTest() argument 705 DecryptTest(const struct HksBlob *authId, const struct HksParamSet *paramInSet, const struct HksBlob *cipherText, uint32_t *inLen) DecryptTest() argument 724 struct HksParamSet *paramInSet = nullptr; AgreeKeyTest() local 749 DeriveKeyTest(const struct HksBlob *authId, const struct HksParamSet *paramInSet) DeriveKeyTest() argument 762 MacTest(const struct HksBlob *authId, const struct HksParamSet *paramInSet) MacTest() argument 780 struct HksParamSet *paramInSet = nullptr; HashTest() local 808 struct HksParamSet *paramInSet = nullptr; CipherScene() local 853 struct HksParamSet *paramInSet = nullptr; SignScene() local 1012 struct HksParamSet *paramInSet = nullptr; HWTEST_F() local 1042 struct HksParamSet *paramInSet = nullptr; HWTEST_F() local 1093 struct HksParamSet *paramInSet = nullptr; HWTEST_F() local 1123 struct HksParamSet *paramInSet = nullptr; HWTEST_F() local 1174 struct HksParamSet *paramInSet = nullptr; HWTEST_F() local 1213 struct HksParamSet *paramInSet = nullptr; HWTEST_F() local 1257 struct HksParamSet *paramInSet = nullptr; HWTEST_F() local 1300 struct HksParamSet *paramInSet = nullptr; HWTEST_F() local 1352 struct HksParamSet *paramInSet = nullptr; HWTEST_F() local 1388 struct HksParamSet *paramInSet = nullptr; HWTEST_F() local 1437 struct HksParamSet *paramInSet = nullptr; HWTEST_F() local [all...] |
H A D | pressure_test.cpp | 188 struct HksParamSet *paramInSet = nullptr; in HWTEST_F() local 189 HksInitParamSet(¶mInSet); in HWTEST_F() 195 HksAddParams(paramInSet, tmpParams, sizeof(tmpParams) / sizeof(tmpParams[0])); in HWTEST_F() 196 HksBuildParamSet(¶mInSet); in HWTEST_F() 199 int32_t ret = HksGenerateKey(&authId, paramInSet, NULL); in HWTEST_F() 204 HksDeleteKey(&authId, paramInSet); in HWTEST_F() 205 HksFreeParamSet(¶mInSet); in HWTEST_F() 220 struct HksParamSet *paramInSet = nullptr; in HWTEST_F() local 221 HksInitParamSet(¶mInSet); in HWTEST_F() 227 HksAddParams(paramInSet, tmpParam in HWTEST_F() 261 struct HksParamSet *paramInSet = nullptr; HWTEST_F() local 301 struct HksParamSet *paramInSet = nullptr; HWTEST_F() local 333 struct HksParamSet *paramInSet = nullptr; HWTEST_F() local 378 struct HksParamSet *paramInSet = nullptr; HWTEST_F() local 412 struct HksParamSet *paramInSet = nullptr; HWTEST_F() local 449 struct HksParamSet *paramInSet = nullptr; HWTEST_F() local 497 struct HksParamSet *paramInSet = nullptr; HWTEST_F() local 546 struct HksParamSet *paramInSet = nullptr; HWTEST_F() local 604 struct HksParamSet *paramInSet = nullptr; HWTEST_F() local 668 struct HksParamSet *paramInSet = nullptr; HWTEST_F() local 727 struct HksParamSet *paramInSet = nullptr; HWTEST_F() local 787 struct HksParamSet *paramInSet = nullptr; HWTEST_F() local 833 struct HksParamSet *paramInSet = nullptr; HWTEST_F() local 869 struct HksParamSet *paramInSet = nullptr; HWTEST_F() local 916 struct HksParamSet *paramInSet = nullptr; HWTEST_F() local 972 struct HksParamSet *paramInSet = nullptr; HWTEST_F() local 1028 struct HksParamSet *paramInSet = nullptr; HWTEST_F() local 1088 struct HksParamSet *paramInSet = nullptr; HWTEST_F() local 1155 struct HksParamSet *paramInSet = nullptr; HWTEST_F() local 1215 struct HksParamSet *paramInSet = nullptr; HWTEST_F() local 1258 struct HksParamSet *paramInSet = nullptr; HWTEST_F() local [all...] |
/base/security/huks/test/unittest/huks_standard_test/interface_inner_test/alg_module_test/src/ |
H A D | hks_rsa_common_mt.cpp | 38 struct HksParamSet *paramInSet = NULL; in GenerateKeyTestCase() local 39 HksInitParamSet(¶mInSet); in GenerateKeyTestCase() 40 ASSERT_NE(paramInSet, nullptr); in GenerateKeyTestCase() 47 EXPECT_EQ(HksAddParams(paramInSet, testCaseParams.params.data(), testCaseParams.params.size()), HKS_SUCCESS); in GenerateKeyTestCase() 48 EXPECT_EQ(HksBuildParamSet(¶mInSet), HKS_SUCCESS); in GenerateKeyTestCase() 49 EXPECT_EQ(HksGenerateKey(NULL, paramInSet, paramSetOut), testCaseParams.generateKeyResult); in GenerateKeyTestCase() 71 HksGetParam(paramInSet, HKS_TAG_KEY_SIZE, &cipherLenBit); in GenerateKeyTestCase() 95 HksFreeParamSet(¶mInSet); in GenerateKeyTestCase() 100 struct HksParamSet *paramInSet = NULL; in EncryptLocalTestCase() local 101 HksInitParamSet(¶mInSet); in EncryptLocalTestCase() 171 struct HksParamSet *paramInSet = NULL; EncryptServiceTestCase() local 231 struct HksParamSet *paramInSet = NULL; DecryptLocalTestCase() local 298 struct HksParamSet *paramInSet = NULL; DecryptServiceTestCase() local 423 struct HksParamSet *paramInSet = NULL; SignServiceTestCase() local 482 struct HksParamSet *paramInSet = NULL; VerifyLocalTestCase() local 547 struct HksParamSet *paramInSet = NULL; VerifyServiceTestCase() local [all...] |
H A D | hks_hmac_mt.cpp | 294 struct HksParamSet *paramInSet = nullptr; in LocalHmacScenario() local 295 HksInitParamSet(¶mInSet); in LocalHmacScenario() 296 HksAddParams(paramInSet, testCaseParams.params.data(), testCaseParams.params.size()); in LocalHmacScenario() 297 HksBuildParamSet(¶mInSet); in LocalHmacScenario() 310 EXPECT_EQ(HksGenerateKey(authId, paramInSet, paramOutSet), testCaseParams.generateKeyResult); in LocalHmacScenario() 324 EXPECT_EQ(HksMac(&key, paramInSet, message, macForHuks), testCaseParams.hmacResult); in LocalHmacScenario() 331 HksFreeParamSet(¶mInSet); in LocalHmacScenario() 342 struct HksParamSet *paramInSet = nullptr; in RunTestCase() local 343 HksInitParamSet(¶mInSet); in RunTestCase() 344 HksAddParams(paramInSet, testCaseParam in RunTestCase() [all...] |
H A D | hks_dsa_mt.cpp | 706 struct HksParamSet *paramInSet = nullptr; in SignLocalTestCase() local 707 HksInitParamSet(¶mInSet); in SignLocalTestCase() 708 ASSERT_NE(paramInSet, nullptr); in SignLocalTestCase() 721 EXPECT_EQ(HksAddParams(paramInSet, testCaseParams.params.data(), testCaseParams.params.size()), HKS_SUCCESS); in SignLocalTestCase() 723 EXPECT_EQ(HksBuildParamSet(¶mInSet), HKS_SUCCESS); in SignLocalTestCase() 725 EXPECT_EQ(HksGenerateKey(NULL, paramInSet, paramSetOut), testCaseParams.generateKeyResult); in SignLocalTestCase() 752 EXPECT_EQ(HksSign(&privateKey, paramInSet, &plainText, &signData), testCaseParams.signResult); in SignLocalTestCase() 763 HksFreeParamSet(¶mInSet); in SignLocalTestCase() 769 struct HksParamSet *paramInSet = nullptr; in SignServiceTestCase() local 770 HksInitParamSet(¶mInSet); in SignServiceTestCase() 828 struct HksParamSet *paramInSet = nullptr; VerifyLocalTestCase() local 894 struct HksParamSet *paramInSet = nullptr; VerifyServiceTestCase() local [all...] |
H A D | hks_aes_cipher_mt.cpp | 441 struct HksParamSet *paramInSet = nullptr; in RunTestCase() local 442 HksInitParamSet(¶mInSet); in RunTestCase() 444 HksAddParams(paramInSet, testCaseParams.params.data(), testCaseParams.params.size()); in RunTestCase() 445 HksBuildParamSet(¶mInSet); in RunTestCase() 447 EXPECT_EQ(HksGenerateKey(&authId, paramInSet, nullptr), testCaseParams.generateKeyResult); in RunTestCase() 457 EXPECT_EQ(HksEncrypt(&authId, paramInSet, &plainText, &cipherText), testCaseParams.encryptResult); in RunTestCase() 461 EXPECT_EQ(HksDecrypt(&authId, paramInSet, &cipherText, &plainTextDecrypt), testCaseParams.decryptResult); in RunTestCase() 469 HksFreeParamSet(¶mInSet); in RunTestCase()
|
H A D | hks_aes_key_mt.cpp | 433 struct HksParamSet *paramInSet = nullptr; in RunTestCase() local 434 HksInitParamSet(¶mInSet); in RunTestCase() 436 HksAddParams(paramInSet, testCaseParams.params.data(), testCaseParams.params.size()); in RunTestCase() 437 HksBuildParamSet(¶mInSet); in RunTestCase() 446 EXPECT_EQ(HksGenerateKey(&authId, paramInSet, paramSetOut), testCaseParams.generateKeyResult); in RunTestCase() 471 EXPECT_EQ(AesGcmEncrypt(paramInSet, &plainText, &cipherText, &symmetricKey, &tagAead), in RunTestCase() 473 EXPECT_EQ(AesGcmDecrypt(paramInSet, &cipherText, &plainTextDecrypt, &symmetricKey, &tagAead), in RunTestCase() 477 EXPECT_EQ(AesEncrypt(paramInSet, &plainText, &cipherText, &symmetricKey), testCaseParams.encryptResult); in RunTestCase() 479 AesDecrypt(paramInSet, &cipherText, &plainTextDecrypt, &symmetricKey), testCaseParams.decryptResult); in RunTestCase() 488 HksFreeParamSet(¶mInSet); in RunTestCase() [all...] |
H A D | hks_agree_mt.cpp | 658 void DhLocalAgreeScenario(const TestCaseParams &testCaseParams, const struct HksParamSet *paramInSet, in DhLocalAgreeScenario() argument 673 EXPECT_EQ(LocalHksGenerate(keySize, &alise, paramInSet, &priKeyAlise, &pubKeyAlise), in DhLocalAgreeScenario() 675 EXPECT_EQ(LocalHksGenerate(keySize, &bob, paramInSet, &priKeyBob, &pubKeyBob), in DhLocalAgreeScenario() 691 EXPECT_EQ(HksAgreeKey(paramInSet, &alise, &pubKeyBob, agreeKeyAlise), testCaseParams.agreeResult); in DhLocalAgreeScenario() 692 EXPECT_EQ(HksAgreeKey(paramInSet, &bob, &pubKeyAlise, agreeKeyBob), testCaseParams.agreeResult); in DhLocalAgreeScenario() 702 struct HksParamSet *paramInSet = NULL; in DhRunTestCase() local 703 HksInitParamSet(¶mInSet); in DhRunTestCase() 704 HksAddParams(paramInSet, testCaseParams.agreeKeyParams.data(), testCaseParams.agreeKeyParams.size()); in DhRunTestCase() 705 HksBuildParamSet(¶mInSet); in DhRunTestCase() 715 DhLocalAgreeScenario(testCaseParams, paramInSet, in DhRunTestCase() [all...] |
H A D | hks_ecc_key_mt.cpp | 451 struct HksParamSet *paramInSet = nullptr; in RunTestCase() local 452 HksInitParamSet(¶mInSet); in RunTestCase() 454 HksAddParams(paramInSet, testCaseParams.params.data(), testCaseParams.params.size()); in RunTestCase() 455 HksBuildParamSet(¶mInSet); in RunTestCase() 473 EXPECT_EQ(HksGenerateKey(&authId, paramInSet, paramOutSet), testCaseParams.generateKeyResult); in RunTestCase() 497 HksFreeParamSet(¶mInSet); in RunTestCase()
|
H A D | hks_aes_encrypt_mt.cpp | 448 struct HksParamSet *paramInSet = nullptr; in RunTestCase() local 449 HksInitParamSet(¶mInSet); in RunTestCase() 451 HksAddParams(paramInSet, testCaseParams.params.data(), testCaseParams.params.size()); in RunTestCase() 452 HksBuildParamSet(¶mInSet); in RunTestCase() 469 EXPECT_EQ(HksEncrypt(&authId, paramInSet, &plainText, &cipherText), testCaseParams.encryptResult); in RunTestCase() 476 EXPECT_EQ(AesGcmDecrypt(paramInSet, &cipherText, &plainTextDecrypt, &authId, &tagAead), in RunTestCase() 481 AesDecrypt(paramInSet, &cipherText, &plainTextDecrypt, &authId), testCaseParams.decryptResult); in RunTestCase() 490 HksFreeParamSet(¶mInSet); in RunTestCase()
|
H A D | hks_aes_decrypt_mt.cpp | 484 struct HksParamSet *paramInSet = nullptr; in RunTestCase() local 488 HksInitParamSet(¶mInSet); in RunTestCase() 490 HksAddParams(paramInSet, testCaseParams.params.data(), testCaseParams.params.size()); in RunTestCase() 491 HksBuildParamSet(¶mInSet); in RunTestCase() 512 AesGcmEncrypt(paramInSet, &plainText, &cipherText, &authId, &tagAead), testCaseParams.encryptResult); in RunTestCase() 517 EXPECT_EQ(AesEncrypt(paramInSet, &plainText, &cipherText, &authId), testCaseParams.encryptResult); in RunTestCase() 519 EXPECT_EQ(HksDecrypt(&authId, paramInSet, &cipherText, &plainTextDecrypt), testCaseParams.decryptResult); in RunTestCase() 528 HksFreeParamSet(¶mInSet); in RunTestCase()
|
H A D | hks_ecc_sign_mt.cpp | 845 struct HksParamSet *paramInSet = nullptr; in RunTestCase() local 846 HksInitParamSet(¶mInSet); in RunTestCase() 848 HksAddParams(paramInSet, testCaseParams.params.data(), testCaseParams.params.size()); in RunTestCase() 849 HksBuildParamSet(¶mInSet); in RunTestCase() 868 EXPECT_EQ(HksGenerateKey(&authId, paramInSet, NULL), testCaseParams.generateKeyResult); in RunTestCase() 869 EXPECT_EQ(HksExportPublicKey(&authId, paramInSet, &x509Key), HKS_SUCCESS); in RunTestCase() 883 EXPECT_EQ(HksGetParam(paramInSet, HKS_TAG_PURPOSE, ¶mPurpose), HKS_SUCCESS); in RunTestCase() 885 EXPECT_EQ(HksSign(&authId, paramInSet, &message, &signature), testCaseParams.signResult); in RunTestCase() 896 HksFreeParamSet(¶mInSet); in RunTestCase()
|
H A D | hks_ecc_verify_mt.cpp | 846 struct HksParamSet *paramInSet = nullptr; in RunTestCase() local 847 HksInitParamSet(¶mInSet); in RunTestCase() 849 HksAddParams(paramInSet, testCaseParams.params.data(), testCaseParams.params.size()); in RunTestCase() 850 HksBuildParamSet(¶mInSet); in RunTestCase() 876 EXPECT_EQ(HksVerify(&pubKey, paramInSet, &message, &signature), testCaseParams.verifyResult); in RunTestCase() 882 EXPECT_EQ(HksImportKey(&pubId, paramInSet, &x509Key), HKS_SUCCESS); in RunTestCase() 883 EXPECT_EQ(HksVerify(&pubId, paramInSet, &message, &signature), testCaseParams.verifyResult); in RunTestCase() 889 HksFreeParamSet(¶mInSet); in RunTestCase()
|
/base/security/huks/test/unittest/huks_standard_test/three_stage_test/src/asymmetric_alg_test/ |
H A D | hks_export_test_mt.cpp | 46 struct HksParamSet *paramInSet = nullptr;
in RunTestCase() local 47 int32_t ret = InitParamSet(¶mInSet, testCaseParams.params.data(), testCaseParams.params.size());
in RunTestCase() 48 if (paramInSet == nullptr) {
in RunTestCase() 51 ret = HksGenerateKeyForDe(&authId, paramInSet, nullptr);
in RunTestCase() 53 HksFreeParamSet(¶mInSet);
in RunTestCase()
|
H A D | hks_export_test.cpp | 53 struct HksParamSet *paramInSet = nullptr;
in RunTestCase() local 54 int32_t ret = InitParamSet(¶mInSet, testCaseParams.params.data(), testCaseParams.params.size());
in RunTestCase() 59 ret = HksGenerateKeyForDe(&authId, paramInSet, nullptr);
in RunTestCase() 60 HksFreeParamSet(¶mInSet);
in RunTestCase()
|