/base/security/huks/test/unittest/huks_lite_test/liteos_a_adapter/ |
H A D | hks_agreement_test.cpp | 79 static int32_t AgreeKey(const struct HksTestAgreeParamSet *agreeParamSetParams, struct HksBlob *privateKey, in AgreeKey() argument 93 ret = HksAgreeKeyRun(agreeParamSetTest, privateKey, peerPublicKey, agreedKey, 1); in AgreeKey() 106 struct HksBlob *privateKey = NULL; in HWTEST_F() local 113 ret = GenerateLocalX25519Key(&privateKey, NULL, &g_testAgreeParams[0].localPrivateKeyParams, NULL); in HWTEST_F() 127 ret = AgreeKey(&g_testAgreeParams[0].agreeParamSetParams, privateKey, peerPublicKey, agreeKey); in HWTEST_F() 135 ret = HksDeleteKeyForDe(privateKey, NULL); in HWTEST_F() 140 TestFreeBlob(&privateKey); in HWTEST_F() 155 struct HksBlob *privateKey = NULL; in HWTEST_F() local 164 ret = GenerateLocalX25519Key(&privateKey, &peerPublicKey, &g_testAgreeParams[0].localPrivateKeyParams, \ in HWTEST_F() 184 ret = AgreeKey(&g_testAgreeParams[0].agreeParamSetParams, privateKey, peerPublicKey in HWTEST_F() [all...] |
/base/security/huks/test/unittest/huks_lite_test/liteos_m_adapter/ |
H A D | hks_agreement_test.c | 81 static int32_t AgreeKey(const struct HksTestAgreeParamSet *agreeParamSetParams, struct HksBlob *privateKey, in AgreeKey() argument 95 ret = HksAgreeKeyRun(agreeParamSet, privateKey, peerPublicKey, agreedKey, 1); in AgreeKey() 108 struct HksBlob *privateKey = NULL; in LITE_TEST_CASE() local 115 ret = GenerateLocalX25519Key(&privateKey, NULL, &g_testAgreeParams[0].localPrivateKeyParams, NULL); in LITE_TEST_CASE() 129 ret = AgreeKey(&g_testAgreeParams[0].agreeParamSetParams, privateKey, peerPublicKey, agreeKey); in LITE_TEST_CASE() 137 ret = HksDeleteKeyForDe(privateKey, NULL); in LITE_TEST_CASE() 142 TestFreeBlob(&privateKey); in LITE_TEST_CASE() 158 struct HksBlob *privateKey = NULL; in LITE_TEST_CASE() local 168 ret = GenerateLocalX25519Key(&privateKey, &peerPublicKey, &g_testAgreeParams[0].localPrivateKeyParams, \ in LITE_TEST_CASE() 182 ret = AgreeKey(&g_testAgreeParams[0].agreeParamSetParams, privateKey, peerPublicKey in LITE_TEST_CASE() [all...] |
/base/security/huks/test/unittest/huks_standard_test/interface_inner_test/sdk_test/src/ |
H A D | hks_agreement_test.cpp | 79 static int32_t AgreeKey(const struct HksTestAgreeParamSet *agreeParamSetParams, struct HksBlob *privateKey, in AgreeKey() argument 93 ret = HksAgreeKeyRun(agreeParamSetTest, privateKey, peerPublicKey, agreedKey, 1); in AgreeKey() 106 struct HksBlob *privateKey = NULL; in HWTEST_F() local 113 ret = GenerateLocalX25519Key(&privateKey, NULL, &g_testAgreeParams[0].localPrivateKeyParams, NULL); in HWTEST_F() 127 ret = AgreeKey(&g_testAgreeParams[0].agreeParamSetParams, privateKey, peerPublicKeyTest, agreeKey); in HWTEST_F() 135 ret = HksDeleteKeyForDe(privateKey, NULL); in HWTEST_F() 140 TestFreeBlob(&privateKey); in HWTEST_F()
|
/base/security/huks/test/unittest/huks_standard_test/interface_inner_test/alg_module_test/src/ |
H A D | hks_rsa_common_mt.cpp | 60 HksBlob privateKey = { .size = priKeyExport->blob.size, .data = in GenerateKeyTestCase() local 62 ASSERT_NE(privateKey.data, nullptr); in GenerateKeyTestCase() 63 (void)memcpy_s(privateKey.data, priKeyExport->blob.size, priKeyExport->blob.data, priKeyExport->blob.size); in GenerateKeyTestCase() 84 DecryptRsa(&cipherText, &decryptedText, &privateKey, testCaseParams.padding, testCaseParams.keyDigest), in GenerateKeyTestCase() 92 HKS_FREE(privateKey.data); in GenerateKeyTestCase() 126 HksBlob privateKey = { .size = priKeyExport->blob.size, in EncryptLocalTestCase() local 128 ASSERT_NE(privateKey.data, nullptr); in EncryptLocalTestCase() 129 static_cast<void>(memcpy_s(privateKey.data, priKeyExport->blob.size, in EncryptLocalTestCase() 150 DecryptRsa(&cipherText, &decryptedText, &privateKey, testCaseParams.padding, testCaseParams.keyDigest), in EncryptLocalTestCase() 159 HKS_FREE(privateKey in EncryptLocalTestCase() 257 HksBlob privateKey = { .size = priKeyExport->blob.size, .data = DecryptLocalTestCase() local 373 HksBlob privateKey = { .size = priKeyExportTest->blob.size, SignLocalTestCase() local 500 HksBlob privateKey = { .size = priKeyExport->blob.size, VerifyLocalTestCase() local [all...] |
H A D | hks_dsa_mt.cpp | 674 HksBlob privateKey = { in GenerateKeyTestCase() local 678 ASSERT_NE(privateKey.data, nullptr); in GenerateKeyTestCase() 679 (void)memcpy_s(privateKey.data, priKeyExport01->blob.size, in GenerateKeyTestCase() 689 EXPECT_EQ(OpensslSignDsa(&plainText, &signData, &privateKey, testCaseParams.keyDigest), in GenerateKeyTestCase() 696 HKS_FREE(privateKey.data); in GenerateKeyTestCase() 738 HksBlob privateKey = { in SignLocalTestCase() local 742 ASSERT_NE(privateKey.data, nullptr); in SignLocalTestCase() 743 (void)memcpy_s(privateKey.data, priKeyExport->blob.size, priKeyExport->blob.data, priKeyExport->blob.size); in SignLocalTestCase() 752 EXPECT_EQ(HksSign(&privateKey, paramInSet, &plainText, &signData), testCaseParams.signResult); in SignLocalTestCase() 758 HKS_FREE(privateKey in SignLocalTestCase() 862 HksBlob privateKey = { VerifyLocalTestCase() local [all...] |
/base/security/huks/test/fuzz_test/innerapi_fuzzer/hksagreekey_fuzzer/ |
H A D | hksagreekey_fuzzer.cpp | 38 struct HksBlob privateKey = { sizeof(uint32_t), ReadData<uint8_t *>(data, size, sizeof(uint32_t)) }; in DoSomethingInterestingWithMyAPI() local 44 [[maybe_unused]] int ret = HksAgreeKey(ps.s, &privateKey, &peerPublicKey, &agreedKey); in DoSomethingInterestingWithMyAPI()
|
/base/security/huks/frameworks/crypto_lite/cipher/src/ |
H A D | cipher_rsa.c | 47 char *privateKey = malloc(keyFinalLen); in RsaMallocPrivateKey() local 48 if (privateKey == NULL) { in RsaMallocPrivateKey() 52 (void)memset_s(privateKey, keyFinalLen, 0, keyFinalLen); in RsaMallocPrivateKey() 53 ret = memcpy_s(privateKey, keyFinalLen, start, startLen); in RsaMallocPrivateKey() 56 free(privateKey); in RsaMallocPrivateKey() 60 ret = memcpy_s(privateKey + startLen, keyFinalLen - startLen, key, *keyLen); in RsaMallocPrivateKey() 63 free(privateKey); in RsaMallocPrivateKey() 67 ret = memcpy_s(privateKey + startLen + *keyLen, keyFinalLen - startLen - *keyLen, end, endLen); in RsaMallocPrivateKey() 70 (void)memset_s(privateKey, keyFinalLen, 0, keyFinalLen); in RsaMallocPrivateKey() 71 free(privateKey); in RsaMallocPrivateKey() [all...] |
/base/security/huks/interfaces/inner_api/huks_standard/source/ |
H A D | hks_api_adapter.h | 30 int32_t HksAgreeKeyAdapter(const struct HksParamSet *paramSet, const struct HksBlob *privateKey,
|
H A D | hks_api_adapter.c | 69 int32_t HksAgreeKeyAdapter(const struct HksParamSet *paramSet, const struct HksBlob *privateKey, in HksAgreeKeyAdapter() argument 79 ret = HksClientAgreeKey(paramSet, privateKey, &publicKey, agreedKey); in HksAgreeKeyAdapter()
|
/base/security/huks/frameworks/huks_standard/main/os_dependency/ipc/src/ |
H A D | hks_ipc_check.c | 150 int32_t HksCheckIpcAgreeKey(const struct HksParamSet *paramSet, const struct HksBlob *privateKey,
in HksCheckIpcAgreeKey() argument 153 int32_t ret = HksCheckBlob3AndParamSet(privateKey, peerPublicKey, agreedKey, paramSet);
in HksCheckIpcAgreeKey() 156 if ((privateKey->size > MAX_PROCESS_SIZE) || (peerPublicKey->size > MAX_PROCESS_SIZE)) {
in HksCheckIpcAgreeKey() 159 if ((ALIGN_SIZE(paramSet->paramSetSize) + sizeof(privateKey->size) + ALIGN_SIZE(privateKey->size) +
in HksCheckIpcAgreeKey()
|
/base/security/crypto_framework/plugin/openssl_plugin/crypto_operation/signature/src/ |
H A D | dsa_openssl.c | 64 static bool IsSignInitInputValid(HcfSignSpi *self, HcfPriKey *privateKey) in IsSignInitInputValid() argument 66 if ((self == NULL) || (privateKey == NULL)) { in IsSignInitInputValid() 71 (!HcfIsClassMatch((HcfObjectBase *)privateKey, OPENSSL_DSA_PRIKEY_CLASS))) { in IsSignInitInputValid() 188 static HcfResult EngineDsaSignInit(HcfSignSpi *self, HcfParamsSpec *params, HcfPriKey *privateKey) in EngineDsaSignInit() argument 191 if (!IsSignInitInputValid(self, privateKey)) { in EngineDsaSignInit() 194 EVP_PKEY *pKey = CreateDsaEvpKeyByDsa((HcfKey *)privateKey, true); in EngineDsaSignInit() 211 static HcfResult EngineDsaSignWithoutDigestInit(HcfSignSpi *self, HcfParamsSpec *params, HcfPriKey *privateKey) in EngineDsaSignWithoutDigestInit() argument 214 if (!IsSignInitInputValid(self, privateKey)) { in EngineDsaSignWithoutDigestInit() 217 EVP_PKEY *pKey = CreateDsaEvpKeyByDsa((HcfKey *)privateKey, true); in EngineDsaSignWithoutDigestInit()
|
H A D | ed25519_openssl.c | 96 static HcfResult EngineSignInit(HcfSignSpi *self, HcfParamsSpec *params, HcfPriKey *privateKey) in EngineSignInit() argument 99 if ((self == NULL) || (privateKey == NULL)) { in EngineSignInit() 104 (!HcfIsClassMatch((HcfObjectBase *)privateKey, OPENSSL_ALG25519_PRIKEY_CLASS))) { in EngineSignInit() 116 ((HcfOpensslAlg25519PriKey *)privateKey)->pkey) != HCF_OPENSSL_SUCCESS) { in EngineSignInit()
|
H A D | signature_rsa_openssl.c | 197 static HcfResult SetOnlySignParams(HcfSignSpiRsaOpensslImpl *impl, HcfPriKey *privateKey) in SetOnlySignParams() argument 199 EVP_PKEY *dupKey = InitRsaEvpKey((HcfKey *)privateKey, true); in SetOnlySignParams() 236 static HcfResult SetSignParams(HcfSignSpiRsaOpensslImpl *impl, HcfPriKey *privateKey) in SetSignParams() argument 239 return SetOnlySignParams(impl, privateKey); in SetSignParams() 241 EVP_PKEY *dupKey = InitRsaEvpKey((HcfKey *)privateKey, true); in SetSignParams() 274 static HcfResult EngineSignInit(HcfSignSpi *self, HcfParamsSpec *params, HcfPriKey *privateKey) in EngineSignInit() argument 277 if (self == NULL || privateKey == NULL) { in EngineSignInit() 290 if (CheckInitKeyType((HcfKey *)privateKey, true) != HCF_SUCCESS) { in EngineSignInit() 295 HcfResult ret = SetSignParams(impl, privateKey); in EngineSignInit()
|
H A D | sm2_openssl.c | 169 static bool IsSm2SignInitInputValid(HcfSignSpi *self, HcfPriKey *privateKey) in IsSm2SignInitInputValid() argument 171 if ((self == NULL) || (privateKey == NULL)) { in IsSm2SignInitInputValid() 176 (!HcfIsClassMatch((HcfObjectBase *)privateKey, HCF_OPENSSL_SM2_PRI_KEY_CLASS))) { in IsSm2SignInitInputValid() 188 static HcfResult EngineSignInit(HcfSignSpi *self, HcfParamsSpec *params, HcfPriKey *privateKey) in EngineSignInit() argument 191 if (!IsSm2SignInitInputValid(self, privateKey)) { in EngineSignInit() 195 EC_KEY *ecKey = OpensslEcKeyDup(((HcfOpensslSm2PriKey *)privateKey)->ecKey); in EngineSignInit()
|
/base/security/crypto_framework/plugin/openssl_plugin/crypto_operation/key_agreement/src/ |
H A D | ecdh_openssl.c | 61 static EVP_PKEY *NewPKeyByEccPriKey(HcfOpensslEccPriKey *privateKey) in NewPKeyByEccPriKey() argument 63 EC_KEY *ecKey = OpensslEcKeyDup(privateKey->ecKey); in NewPKeyByEccPriKey()
|
/base/security/huks/services/huks_standard/huks_service/main/os_dependency/ca/ |
H A D | hks_ca_access.c | 83 int32_t HksAccessAgreeKey(const struct HksParamSet *paramSet, const struct HksBlob *privateKey, in HksAccessAgreeKey() argument 86 return HksTeeAgreeKey(paramSet, privateKey, peerPublicKey, agreedKey); in HksAccessAgreeKey()
|
/base/security/huks/frameworks/huks_standard/main/core/include/ |
H A D | hks_local_engine.h | 42 int32_t HksLocalAgreeKey(const struct HksParamSet *paramSet, const struct HksBlob *privateKey,
|
/base/security/huks/services/huks_standard/huks_engine/main/core/include/ |
H A D | hks_core_service_key_operate_one_stage.h | 45 int32_t HksCoreAgreeKey(const struct HksParamSet *paramSet, const struct HksBlob *privateKey,
|
/base/security/huks/test/unittest/huks_standard_test/module_test/mock/idl/src/ |
H A D | huks_access_mock.c | 138 ENABLE_CFI(int32_t HuksAccessAgreeKey(const struct HksParamSet *paramSet, const struct HksBlob *privateKey, in HuksAccessAgreeKey() argument 141 return HksCoreAgreeKey(paramSet, privateKey, peerPublicKey, agreedKey); in HuksAccessAgreeKey()
|
/base/security/crypto_framework/frameworks/spi/ |
H A D | signature_spi.h | 35 HcfResult (*engineInit)(HcfSignSpi *self, HcfParamsSpec *params, HcfPriKey *privateKey);
|
/base/security/crypto_framework/interfaces/inner_api/crypto_operation/ |
H A D | signature.h | 39 HcfResult (*init)(HcfSign *self, HcfParamsSpec *params, HcfPriKey *privateKey);
|
/base/security/huks/frameworks/huks_standard/main/common/include/ |
H A D | hks_check_paramset.h | 43 int32_t HksCoreCheckAgreeKeyParams(const struct HksParamSet *paramSet, const struct HksBlob *privateKey,
|
/base/security/huks/test/unittest/huks_common_test/include/ |
H A D | hks_test_common_c.h | 71 int32_t GenerateLocalX25519Key(struct HksBlob **privateKey, struct HksBlob **publicKey,
|
/base/security/huks/frameworks/huks_standard/main/os_dependency/ipc/include/ |
H A D | hks_ipc_check.h | 46 int32_t HksCheckIpcAgreeKey(const struct HksParamSet *paramSet, const struct HksBlob *privateKey,
|
/base/security/huks/test/unittest/huks_common_test/src/ |
H A D | hks_test_common_func.cpp | 620 int32_t GenerateLocalX25519Key(struct HksBlob **privateKey, struct HksBlob **publicKey, in GenerateLocalX25519Key() argument 624 if ((privateKey != NULL) && (localPrivateKeyParams != NULL)) { in GenerateLocalX25519Key() 625 ret = TestConstuctBlob(privateKey, in GenerateLocalX25519Key() 666 if ((privateKey != NULL) && ((*privateKey) != NULL) && (localPrivateKeyParams != NULL) && in GenerateLocalX25519Key() 669 ret = memcpy_s((*privateKey)->data, (*privateKey)->size, in GenerateLocalX25519Key()
|