Lines Matching refs:authId
475 void ImportKeyTest(const struct HksBlob *authId, const struct HksParamSet *paramInSet);
476 void ExportPublicKeyTest(const struct HksBlob *authId, const struct HksParamSet *paramInSet);
478 void GetKeyParamSetTest(const struct HksBlob *authId, const struct HksParamSet *paramInSet);
479 void KeyExistTest(const struct HksBlob *authId, const struct HksParamSet *paramInSet);
481 void SignTest(const struct HksBlob *authId, const struct HksParamSet *paramInSet, const struct HksBlob *message);
482 void VerifyTest(const struct HksBlob *authId, const struct HksParamSet *paramInSet, const struct HksBlob *message,
484 void EncryptTest(const struct HksBlob *authId, const struct HksParamSet *paramInSet);
485 void DecryptTest(const struct HksBlob *authId, const struct HksParamSet *paramInSet,
487 void AgreeKeyTest(const struct HksBlob *authId);
488 void DeriveKeyTest(const struct HksBlob *authId, const struct HksParamSet *paramInSet);
489 void MacTest(const struct HksBlob *authId, const struct HksParamSet *paramInSet);
544 struct HksBlob authId = { (uint32_t)strlen(GENERATE_KEY), (uint8_t *)GENERATE_KEY };
552 EXPECT_EQ(HksGenerateKey(&authId, paramInSet, NULL), HKS_SUCCESS);
557 void ApiPressureTest::ImportKeyTest(const struct HksBlob *authId, const struct HksParamSet *paramInSet)
561 HksExportPublicKey(authId, paramInSet, &pubKey);
572 void ApiPressureTest::ExportPublicKeyTest(const struct HksBlob *authId, const struct HksParamSet *paramInSet)
581 EXPECT_EQ(HksExportPublicKey(authId, paramInSet, &pubKey), HKS_SUCCESS);
594 struct HksBlob authId = { .size = (uint32_t)key.length(), .data = (uint8_t *)&key[0] };
602 HksGenerateKey(&authId, paramInSet, NULL);
603 EXPECT_EQ(HksDeleteKey(&authId, paramInSet), HKS_SUCCESS);
608 void ApiPressureTest::GetKeyParamSetTest(const struct HksBlob *authId, const struct HksParamSet *paramInSet)
623 EXPECT_EQ(HksGetKeyParamSet(authId, paramInSet, paramOutSet), HKS_SUCCESS);
629 void ApiPressureTest::KeyExistTest(const struct HksBlob *authId, const struct HksParamSet *paramInSet)
635 EXPECT_EQ(HksKeyExist(authId, paramInSet), HKS_SUCCESS);
641 struct HksBlob authId = { .size = RANDOM_KEY_SIZE, .data = (uint8_t *)HksMalloc(RANDOM_KEY_SIZE) };
642 ASSERT_NE(authId.data, nullptr);
657 EXPECT_EQ(HksGenerateRandom(paramInSet, &authId), HKS_SUCCESS);
659 HKS_FREE(authId.data);
664 const struct HksBlob *authId, const struct HksParamSet *paramInSet, const struct HksBlob *message)
672 EXPECT_EQ(HksSign(authId, paramInSet, message, &signature), HKS_SUCCESS);
677 void ApiPressureTest::VerifyTest(const struct HksBlob *authId, const struct HksParamSet *paramInSet,
684 EXPECT_EQ(HksVerify(authId, paramInSet, message, signature), HKS_SUCCESS);
688 void ApiPressureTest::EncryptTest(const struct HksBlob *authId, const struct HksParamSet *paramInSet)
700 EXPECT_EQ(HksEncrypt(authId, paramInSet, &plainText, &cipherText), HKS_SUCCESS);
705 void ApiPressureTest::DecryptTest(const struct HksBlob *authId, const struct HksParamSet *paramInSet,
714 EXPECT_EQ(HksDecrypt(authId, paramInSet, cipherText, &plainTextDecrypt), HKS_SUCCESS);
719 void ApiPressureTest::AgreeKeyTest(const struct HksBlob *authId)
723 HksExportPublicKey(authId, NULL, &pubKey);
742 EXPECT_EQ(HksAgreeKey(paramInSet, authId, &pubKey, &agreeKey), HKS_SUCCESS);
749 void ApiPressureTest::DeriveKeyTest(const struct HksBlob *authId, const struct HksParamSet *paramInSet)
757 EXPECT_EQ(HksDeriveKey(paramInSet, authId, &derivedKey), HKS_SUCCESS);
762 void ApiPressureTest::MacTest(const struct HksBlob *authId, const struct HksParamSet *paramInSet)
773 EXPECT_EQ(HksMac(authId, paramInSet, &message, &macMessage), HKS_SUCCESS);
803 struct HksBlob authId = { .size = (uint32_t)key.length(), .data = (uint8_t *)&key[0] };
813 HksGenerateKey(&authId, paramInSet, NULL);
834 HksEncrypt(&authId, paramInSet, &plainText, &cipherText);
837 EXPECT_EQ(HksDecrypt(&authId, paramInSet, &cipherText, &plainTextDecrypt), HKS_SUCCESS);
838 (void)HksDeleteKey(&authId, nullptr);
848 struct HksBlob authId = { .size = (uint32_t)key.length(), .data = (uint8_t *)&key[0] };
864 HksGenerateKey(&authId, paramInSet, NULL);
870 HksSign(&authId, paramInSet, &message, &signature);
871 EXPECT_EQ(HksVerify(&authId, paramInSet, &message, &signature), HKS_SUCCESS);
872 (void)HksDeleteKey(&authId, nullptr);
881 struct HksBlob authId = { .size = (uint32_t)key.length(), .data = (uint8_t *)&key[0] };
901 HksGenerateKey(&authId, generateKeyParam, NULL);
904 HksExportPublicKey(&authId, generateKeyParam, &pubKey);
907 EXPECT_EQ(HksAgreeKey(agreeKeyParam, &authId, &pubKey, &agreeKey), HKS_SUCCESS);
908 (void)HksDeleteKey(&authId, nullptr);
997 struct HksBlob authId = { (uint32_t)strlen(GENERATE_KEY), (uint8_t *)GENERATE_KEY };
998 (void)HksDeleteKey(&authId, nullptr);
1011 struct HksBlob authId = { (uint32_t)strlen(GENERATE_KEY), (uint8_t *)GENERATE_KEY };
1019 HksGenerateKey(&authId, paramInSet, NULL);
1022 threads.emplace_back(std::thread(&ApiPressureTest::ImportKeyTest, this, &authId, paramInSet));
1029 (void)HksDeleteKey(&authId, nullptr);
1041 struct HksBlob authId = { (uint32_t)strlen(GENERATE_KEY), (uint8_t *)GENERATE_KEY };
1049 HksGenerateKey(&authId, paramInSet, NULL);
1052 threads.emplace_back(std::thread(&ApiPressureTest::ExportPublicKeyTest, this, &authId, paramInSet));
1059 (void)HksDeleteKey(&authId, nullptr);
1092 struct HksBlob authId = { (uint32_t)strlen(GENERATE_KEY), (uint8_t *)GENERATE_KEY };
1100 HksGenerateKey(&authId, paramInSet, NULL);
1103 threads.emplace_back(std::thread(&ApiPressureTest::GetKeyParamSetTest, this, &authId, paramInSet));
1110 (void)HksDeleteKey(&authId, nullptr);
1122 struct HksBlob authId = { (uint32_t)strlen(GENERATE_KEY), (uint8_t *)GENERATE_KEY };
1130 HksGenerateKey(&authId, paramInSet, NULL);
1133 threads.emplace_back(std::thread(&ApiPressureTest::KeyExistTest, this, &authId, paramInSet));
1140 (void)HksDeleteKey(&authId, nullptr);
1173 struct HksBlob authId = { (uint32_t)strlen(GENERATE_KEY), (uint8_t *)GENERATE_KEY };
1187 HksGenerateKey(&authId, paramInSet, NULL);
1193 threads.emplace_back(std::thread(&ApiPressureTest::SignTest, this, &authId, paramInSet, &message));
1200 (void)HksDeleteKey(&authId, nullptr);
1212 struct HksBlob authId = { (uint32_t)strlen(GENERATE_KEY), (uint8_t *)GENERATE_KEY };
1226 HksGenerateKey(&authId, paramInSet, NULL);
1232 HksSign(&authId, paramInSet, &message, &signature);
1236 std::thread(&ApiPressureTest::VerifyTest, this, &authId, paramInSet, &message, &signature));
1243 (void)HksDeleteKey(&authId, nullptr);
1256 struct HksBlob authId = { (uint32_t)strlen(GENERATE_KEY), (uint8_t *)GENERATE_KEY };
1277 HksGenerateKey(&authId, paramInSet, NULL);
1280 threads.emplace_back(std::thread(&ApiPressureTest::EncryptTest, this, &authId, paramInSet));
1287 (void)HksDeleteKey(&authId, nullptr);
1299 struct HksBlob authId = { (uint32_t)strlen(GENERATE_KEY), (uint8_t *)GENERATE_KEY };
1320 HksGenerateKey(&authId, paramInSet, NULL);
1327 HksEncrypt(&authId, paramInSet, &plainText, &cipherText);
1331 std::thread(&ApiPressureTest::DecryptTest, this, &authId, paramInSet, &cipherText, &inLen));
1338 (void)HksDeleteKey(&authId, nullptr);
1351 struct HksBlob authId = { (uint32_t)strlen(GENERATE_KEY), (uint8_t *)GENERATE_KEY };
1365 HksGenerateKey(&authId, paramInSet, NULL);
1368 threads.emplace_back(std::thread(&ApiPressureTest::AgreeKeyTest, this, &authId));
1375 (void)HksDeleteKey(&authId, nullptr);
1387 struct HksBlob authId = { (uint32_t)strlen(GENERATE_KEY), (uint8_t *)GENERATE_KEY };
1401 HksGenerateKey(&authId, paramInSet, NULL);
1416 threads.emplace_back(std::thread(&ApiPressureTest::DeriveKeyTest, this, &authId, paramInSetHkdf));
1423 (void)HksDeleteKey(&authId, nullptr);
1436 struct HksBlob authId = { (uint32_t)strlen(GENERATE_KEY), (uint8_t *)GENERATE_KEY };
1450 HksGenerateKey(&authId, paramInSet, NULL);
1453 threads.emplace_back(std::thread(&ApiPressureTest::MacTest, this, &authId, paramInSet));
1460 (void)HksDeleteKey(&authId, nullptr);