/base/security/huks/interfaces/kits/cj/src/ |
H A D | cj_huks_ffi.c | 28 int32_t FfiOHOSInitSession(const char *keyAlias, const struct HksParamSet *paramSet, in FfiOHOSInitSession() argument 31 struct HksBlob keyAliasBlob = {strlen(keyAlias), (uint8_t *)keyAlias}; in FfiOHOSInitSession() 52 int32_t FfiOHOSIsKeyExist(const char *keyAlias, const struct HksParamSet *paramSet) in FfiOHOSIsKeyExist() argument 54 struct HksBlob keyAliasBlob = {strlen(keyAlias), (uint8_t *)keyAlias}; in FfiOHOSIsKeyExist() 58 int32_t FfiOHOSGetKeyItemProperties(const char *keyAlias, in FfiOHOSGetKeyItemProperties() argument 61 struct HksBlob keyAliasBlob = {strlen(keyAlias), (uint8_t *)keyAlias}; in FfiOHOSGetKeyItemProperties() 65 int32_t FfiOHOSHAttestKey(const char *keyAlias, cons argument 72 FfiOHOSHAnonAttestKey(const char *keyAlias, const struct HksParamSet *paramSet, struct HksCertChain *certChain) FfiOHOSHAnonAttestKey() argument 79 FfiOHOSExportKey(const char *keyAlias, const struct HksParamSet *paramSet, struct HksBlob *key) FfiOHOSExportKey() argument 86 FfiOHOSImportWrappedKey(const char *keyAlias, const char *wrappingKeyAlias, const struct HksParamSet *paramSet, const struct HksBlob *wrappedKeyData) FfiOHOSImportWrappedKey() argument 94 FfiOHOSGenerateKey(const char *keyAlias, const struct HksParamSet *paramSetIn, struct HksParamSet *paramSetOut) FfiOHOSGenerateKey() argument 101 FfiOHOSDeleteKey(const char *keyAlias, const struct HksParamSet *paramSet) FfiOHOSDeleteKey() argument 107 FfiOHOSImportKey(const char *keyAlias, const struct HksParamSet *paramSet, struct HksBlob *key) FfiOHOSImportKey() argument [all...] |
/base/security/huks/frameworks/huks_standard/main/os_dependency/ipc/src/ |
H A D | hks_ipc_check.c | 29 int32_t HksCheckIpcGenerateKey(const struct HksBlob *keyAlias, const struct HksParamSet *paramSetIn)
in HksCheckIpcGenerateKey() argument 31 int32_t ret = HksCheckBlobAndParamSet(keyAlias, paramSetIn);
in HksCheckIpcGenerateKey() 32 HKS_IF_NOT_SUCC_LOGE_RETURN(ret, ret, "check keyAlias or paramSetIn failed")
in HksCheckIpcGenerateKey() 34 if ((keyAlias->size > MAX_PROCESS_SIZE) ||
in HksCheckIpcGenerateKey() 35 ((sizeof(keyAlias->size) + ALIGN_SIZE(keyAlias->size) + ALIGN_SIZE(paramSetIn->paramSetSize) +
in HksCheckIpcGenerateKey() 44 int32_t HksCheckIpcImportKey(const struct HksBlob *keyAlias, const struct HksParamSet *paramSet,
in HksCheckIpcImportKey() argument 47 int32_t ret = HksCheckBlob2AndParamSet(keyAlias, key, paramSet);
in HksCheckIpcImportKey() 48 HKS_IF_NOT_SUCC_LOGE_RETURN(ret, ret, "check keyAlias or key or paramSetIn failed")
in HksCheckIpcImportKey() 50 if ((keyAlias in HksCheckIpcImportKey() 60 HksCheckIpcImportWrappedKey(const struct HksBlob *keyAlias, const struct HksBlob *wrappingKeyAlias, const struct HksParamSet *paramSet, const struct HksBlob *wrappedKeyData) HksCheckIpcImportWrappedKey() argument 79 HksCheckIpcDeleteKey(const struct HksBlob *keyAlias, const struct HksParamSet *paramSet) HksCheckIpcDeleteKey() argument 96 HksCheckIpcExportPublicKey(const struct HksBlob *keyAlias, const struct HksParamSet *paramSet, const struct HksBlob *key) HksCheckIpcExportPublicKey() argument 113 HksCheckIpcGetKeyParamSet(const struct HksBlob *keyAlias, const struct HksParamSet *paramSetIn, struct HksParamSet *paramSetOut) HksCheckIpcGetKeyParamSet() argument 133 HksCheckIpcKeyExist(const struct HksBlob *keyAlias, const struct HksParamSet *paramSet) HksCheckIpcKeyExist() argument 230 HksCheckIpcCertificateChain(const struct HksBlob *keyAlias, const struct HksParamSet *paramSet, const struct HksCertChain *certChain) HksCheckIpcCertificateChain() argument 286 HksCheckIpcChangeStorageLevel(const struct HksBlob *keyAlias, const struct HksParamSet *srcParamSet, const struct HksParamSet *destParamSet) HksCheckIpcChangeStorageLevel() argument [all...] |
/base/security/huks/interfaces/kits/c/src/ |
H A D | native_huks_api.c | 34 struct OH_Huks_Result OH_Huks_GenerateKeyItem(const struct OH_Huks_Blob *keyAlias,
in OH_Huks_GenerateKeyItem() argument 37 int32_t result = HksGenerateKey((const struct HksBlob *) keyAlias,
in OH_Huks_GenerateKeyItem() 42 struct OH_Huks_Result OH_Huks_ImportKeyItem(const struct OH_Huks_Blob *keyAlias,
in OH_Huks_ImportKeyItem() argument 45 int32_t result = HksImportKey((const struct HksBlob *) keyAlias,
in OH_Huks_ImportKeyItem() 50 struct OH_Huks_Result OH_Huks_ImportWrappedKeyItem(const struct OH_Huks_Blob *keyAlias,
in OH_Huks_ImportWrappedKeyItem() argument 54 int32_t result = HksImportWrappedKey((const struct HksBlob *) keyAlias,
in OH_Huks_ImportWrappedKeyItem() 60 struct OH_Huks_Result OH_Huks_ExportPublicKeyItem(const struct OH_Huks_Blob *keyAlias,
in OH_Huks_ExportPublicKeyItem() argument 63 int32_t result = HksExportPublicKey((const struct HksBlob *) keyAlias,
in OH_Huks_ExportPublicKeyItem() 68 struct OH_Huks_Result OH_Huks_DeleteKeyItem(const struct OH_Huks_Blob *keyAlias,
in OH_Huks_DeleteKeyItem() argument 71 int32_t result = HksDeleteKey((const struct HksBlob *) keyAlias, (cons in OH_Huks_DeleteKeyItem() 75 OH_Huks_GetKeyItemParamSet(const struct OH_Huks_Blob *keyAlias, const struct OH_Huks_ParamSet *paramSetIn, struct OH_Huks_ParamSet *paramSetOut) OH_Huks_GetKeyItemParamSet() argument 83 OH_Huks_IsKeyItemExist(const struct OH_Huks_Blob *keyAlias, const struct OH_Huks_ParamSet *paramSet) OH_Huks_IsKeyItemExist() argument 90 OH_Huks_AttestKeyItem(const struct OH_Huks_Blob *keyAlias, const struct OH_Huks_ParamSet *paramSet, struct OH_Huks_CertChain *certChain) OH_Huks_AttestKeyItem() argument 97 OH_Huks_AnonAttestKeyItem(const struct OH_Huks_Blob *keyAlias, const struct OH_Huks_ParamSet *paramSet, struct OH_Huks_CertChain *certChain) OH_Huks_AnonAttestKeyItem() argument 104 OH_Huks_InitSession(const struct OH_Huks_Blob *keyAlias, const struct OH_Huks_ParamSet *paramSet, struct OH_Huks_Blob *handle, struct OH_Huks_Blob *token) OH_Huks_InitSession() argument [all...] |
/base/security/huks/test/unittest/huks_standard_test/three_stage_test/include/symmetric_alg_test/ |
H A D | hks_aes_cipher_test_common.h | 38 int32_t HksAesCipherTestEncrypt(const struct HksBlob *keyAlias, const struct HksParamSet *encryptParamSet, 40 int32_t HksAesCipherTestDecrypt(const struct HksBlob *keyAlias, const struct HksParamSet *decryptParamSet, 42 int32_t HksAesCipherTestCaseOther(const struct HksBlob *keyAlias, struct HksParamSet *genParamSet, 44 int32_t HksAesCipherTestCaseGcm1(const struct HksBlob *keyAlias, struct HksParamSet *genParamSet, 46 int32_t HksAesCipherTestCaseGcm2(const struct HksBlob *keyAlias, struct HksParamSet *genParamSet, 48 int32_t HksAesCipherTestCaseGcm3(const struct HksBlob *keyAlias, struct HksParamSet *genParamSet, 50 int32_t HksAesCipherTestCaseGcm4(const struct HksBlob *keyAlias, struct HksParamSet *genParamSet, 52 int32_t HksAesCipherTestParamAbsentCase(const struct HksBlob *keyAlias, struct HksParamSet *genParamSet, 54 int32_t HksAesEncryptThreeStage(const struct HksBlob *keyAlias, struct HksParamSet *encryptParamSet, 56 int32_t HksAesDecryptThreeStage(const struct HksBlob *keyAlias, struc [all...] |
/base/security/huks/test/unittest/huks_standard_test/three_stage_test/include/asymmetric_alg_test/ |
H A D | hks_rsa_sign_verify_test_common.h | 28 int32_t HksRsaSignVerifyTestNormalCase(struct HksBlob keyAlias, struct HksParamSet *genParamSet, 31 int32_t HksRsaSignVerifyTestNormalAnotherCase(struct HksBlob keyAlias, 34 int32_t HksRsaSignVerifyTestParamAbsentCase(struct HksBlob keyAlias, 37 int32_t HksRSASignVerifyTestAbnormalCase(struct HksBlob keyAlias, struct HksParamSet *genParamSet, 39 int32_t HksRSASignVerifyTestAbnormalCaseNoPadding(struct HksBlob keyAlias, 41 int32_t HksTestSignVerify(struct HksBlob *keyAlias, struct HksParamSet *paramSet, const struct HksBlob *inData, 43 int32_t HksRsaSignVerifyTestParamPSSaltLenFailureCase(struct HksBlob keyAlias, struct HksParamSet *genParamSet,
|
/base/security/huks/interfaces/kits/cj/include/ |
H A D | cj_huks_ffi.h | 26 FFI_EXPORT int32_t FfiOHOSInitSession(const char *keyAlias, const struct HksParamSet *paramSet, 37 FFI_EXPORT int32_t FfiOHOSIsKeyExist(const char *keyAlias, const struct HksParamSet *paramSet); 39 FFI_EXPORT int32_t FfiOHOSGetKeyItemProperties(const char *keyAlias, 42 FFI_EXPORT int32_t FfiOHOSHAttestKey(const char *keyAlias, const struct HksParamSet *paramSet, 45 FFI_EXPORT int32_t FfiOHOSHAnonAttestKey(const char *keyAlias, const struct HksParamSet *paramSet, 48 FFI_EXPORT int32_t FfiOHOSExportKey(const char *keyAlias, const struct HksParamSet *paramSet, struct HksBlob *key); 50 FFI_EXPORT int32_t FfiOHOSImportWrappedKey(const char *keyAlias, const char *wrappingKeyAlias, 53 FFI_EXPORT int32_t FfiOHOSGenerateKey(const char *keyAlias, const struct HksParamSet *paramSetIn, 56 FFI_EXPORT int32_t FfiOHOSDeleteKey(const char *keyAlias, const struct HksParamSet *paramSet); 58 FFI_EXPORT int32_t FfiOHOSImportKey(const char *keyAlias, cons [all...] |
/base/security/huks/interfaces/kits/c/include/ |
H A D | native_huks_api.h | 64 * @param keyAlias Indicates the pointer to the alias of the key to generate.
70 * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_ILLEGAL_ARGUMENT} 401 - If keyAlias or paramSetIn or
88 struct OH_Huks_Result OH_Huks_GenerateKeyItem(const struct OH_Huks_Blob *keyAlias,
94 * @param keyAlias Indicates the pointer to the alias of the key to import.
100 * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_ILLEGAL_ARGUMENT} 401 - If keyAlias or paramSet or key is invalid.
113 struct OH_Huks_Result OH_Huks_ImportKeyItem(const struct OH_Huks_Blob *keyAlias,
119 * @param keyAlias Indicates the pointer to the alias of the key to import.
127 * {@link OH_Huks_ErrCode#OH_HUKS_ERR_CODE_ILLEGAL_ARGUMENT} 401 - If keyAlias or wrappingKeyAlias or
142 struct OH_Huks_Result OH_Huks_ImportWrappedKeyItem(const struct OH_Huks_Blob *keyAlias,
149 * @param keyAlias Indicate [all...] |
/base/security/huks/test/unittest/huks_lite_test/liteos_a_adapter/upgrade_test/version_one/ |
H A D | hks_compatibility_test.cpp | 140 static int32_t HksServiceGenerateKeyForDe(const struct HksProcessInfo *processInfo, const struct HksBlob *keyAlias, in HksServiceGenerateKeyForDe() argument 157 ret = HksServiceGenerateKey(processInfo, keyAlias, newParamSet, keyOut); in HksServiceGenerateKeyForDe() 162 static int32_t HksServiceDeleteKeyForDe(const struct HksProcessInfo *processInfo, const struct HksBlob *keyAlias, in HksServiceDeleteKeyForDe() argument 179 ret = HksServiceDeleteKey(processInfo, keyAlias, newParamSet); in HksServiceDeleteKeyForDe() 192 struct HksBlob keyAlias = { .size = strlen(KEY_ALIAS), .data = (uint8_t *)KEY_ALIAS }; in HWTEST_F() local 193 (void)HksDeleteKeyForDe(&keyAlias, nullptr); in HWTEST_F() 207 ret = HksEncryptForDe(&keyAlias, paramSet, &plainBlob, &cipherBlob); in HWTEST_F() 212 static int32_t TestGenerateOldkey(const struct HksBlob *keyAlias, const struct HksParam *genParams, in TestGenerateOldkey() argument 223 ret = HksTestGenerateOldKey(keyAlias, genParamSet, &OLD_PROCESS_INFO); in TestGenerateOldkey() 230 static int32_t TestGenerateNewkey(const struct HksBlob *keyAlias, cons argument 248 TestDoEncrypt(const struct HksBlob *keyAlias, const struct HksParam *encParams, uint32_t encParamsCnt, struct HksBlob *plainBlob, struct HksBlob *cipherBlob) TestDoEncrypt() argument 265 TestDoDecrypt(const struct HksBlob *keyAlias, const struct HksParam *decParams, uint32_t decParamsCnt, struct HksBlob *cipherBlob, struct HksBlob *decryptedBlob) TestDoDecrypt() argument 290 struct HksBlob keyAlias = { .size = strlen(KEY_ALIAS), .data = (uint8_t *)KEY_ALIAS }; HWTEST_F() local 333 struct HksBlob keyAlias = { .size = strlen(KEY_ALIAS), .data = (uint8_t *)KEY_ALIAS }; HWTEST_F() local 354 struct HksBlob keyAlias = { .size = strlen(KEY_ALIAS), .data = (uint8_t *)KEY_ALIAS }; HWTEST_F() local 376 TestGenerateNewKeyInOldPath(const struct HksBlob *keyAlias, const struct HksParam *genParams, uint32_t genParamsCnt) TestGenerateNewKeyInOldPath() argument 394 HksTestDeleteNewKeyInOldPath(const struct HksBlob *keyAlias) HksTestDeleteNewKeyInOldPath() argument 407 struct HksBlob keyAlias = { .size = strlen(KEY_ALIAS), .data = (uint8_t *)KEY_ALIAS }; HWTEST_F() local 435 struct HksBlob keyAlias = { .size = strlen(KEY_ALIAS), .data = (uint8_t *)KEY_ALIAS }; HWTEST_F() local 469 struct HksBlob keyAlias = { .size = strlen(KEY_ALIAS), .data = (uint8_t *)KEY_ALIAS }; HWTEST_F() local 496 struct HksBlob keyAlias = { .size = strlen(KEY_ALIAS), .data = (uint8_t *)KEY_ALIAS }; HWTEST_F() local 726 struct HksBlob keyAlias = { .size = strlen(KEY_ALIAS), .data = (uint8_t *)KEY_ALIAS }; HWTEST_F() local [all...] |
/base/security/huks/services/huks_standard/huks_service/main/core/include/ |
H A D | hks_client_check.h | 33 int32_t HksCheckProcessNameAndKeyAlias(const struct HksBlob *processName, const struct HksBlob *keyAlias); 35 int32_t HksCheckGenAndImportKeyParams(const struct HksBlob *processName, const struct HksBlob *keyAlias, 38 int32_t HksCheckImportWrappedKeyParams(const struct HksBlob *processName, const struct HksBlob *keyAlias, 41 int32_t HksCheckAllParams(const struct HksBlob *processName, const struct HksBlob *keyAlias, 44 int32_t HksCheckGetKeyParamSetParams(const struct HksBlob *processName, const struct HksBlob *keyAlias, 49 int32_t HksCheckExportPublicKeyParams(const struct HksBlob *processName, const struct HksBlob *keyAlias, 59 int32_t HksCheckAttestKeyParams(const struct HksBlob *processName, const struct HksBlob *keyAlias, 63 int32_t HksCheckServiceInitParams(const struct HksBlob *processName, const struct HksBlob *keyAlias, 86 int32_t HksCheckChangeStorageLevelParams(const struct HksBlob *processName, const struct HksBlob *keyAlias,
|
H A D | hks_client_service.h | 36 int32_t HksServiceGenerateKey(const struct HksProcessInfo *processInfo, const struct HksBlob *keyAlias,
39 int32_t HksServiceSign(const struct HksProcessInfo *processInfo, const struct HksBlob *keyAlias,
42 int32_t HksServiceVerify(const struct HksProcessInfo *processInfo, const struct HksBlob *keyAlias,
45 int32_t HksServiceEncrypt(const struct HksProcessInfo *processInfo, const struct HksBlob *keyAlias,
48 int32_t HksServiceDecrypt(const struct HksProcessInfo *processInfo, const struct HksBlob *keyAlias,
51 int32_t HksServiceDeleteKey(const struct HksProcessInfo *processInfo, const struct HksBlob *keyAlias,
54 int32_t HksServiceKeyExist(const struct HksProcessInfo *processInfo, const struct HksBlob *keyAlias,
57 int32_t HksServiceGetKeyParamSet(const struct HksProcessInfo *processInfo, const struct HksBlob *keyAlias,
62 int32_t HksServiceImportKey(const struct HksProcessInfo *processInfo, const struct HksBlob *keyAlias,
65 int32_t HksServiceExportPublicKey(const struct HksProcessInfo *processInfo, const struct HksBlob *keyAlias,
[all...] |
/base/security/huks/frameworks/huks_standard/main/os_dependency/ipc/include/ |
H A D | hks_ipc_check.h | 28 int32_t HksCheckIpcGenerateKey(const struct HksBlob *keyAlias, const struct HksParamSet *paramSetIn);
30 int32_t HksCheckIpcImportKey(const struct HksBlob *keyAlias, const struct HksParamSet *paramSet,
33 int32_t HksCheckIpcImportWrappedKey(const struct HksBlob *keyAlias, const struct HksBlob *wrappingKeyAlias,
36 int32_t HksCheckIpcDeleteKey(const struct HksBlob *keyAlias, const struct HksParamSet *paramSet);
38 int32_t HksCheckIpcExportPublicKey(const struct HksBlob *keyAlias, const struct HksParamSet *paramSet,
41 int32_t HksCheckIpcGetKeyParamSet(const struct HksBlob *keyAlias, const struct HksParamSet *paramSetIn,
44 int32_t HksCheckIpcKeyExist(const struct HksBlob *keyAlias, const struct HksParamSet *paramSet);
55 int32_t HksCheckIpcCertificateChain(const struct HksBlob *keyAlias, const struct HksParamSet *paramSet,
63 int32_t HksCheckIpcChangeStorageLevel(const struct HksBlob *keyAlias, const struct HksParamSet *srcParamSet,
|
/base/security/huks/test/unittest/huks_standard_test/three_stage_test/src/ |
H A D | hks_rename_part1_test.cpp | 58 static int32_t TestGenerateKey(const struct HksBlob *keyAlias, uint32_t storageLevel) in TestGenerateKey() argument 92 ret = HksGenerateKey(keyAlias, paramSet, nullptr); in TestGenerateKey() 158 struct HksBlob keyAlias = { strlen(alias), (uint8_t *)alias }; in HWTEST_F() local 160 int32_t ret = TestGenerateKey(&keyAlias, HKS_AUTH_STORAGE_LEVEL_DE); in HWTEST_F() 167 ret = HksKeyExist(&keyAlias, paramSet); in HWTEST_F() 179 ret = HksRenameKeyAlias(&keyAlias, renameParamSet, &newKeyAlias); in HWTEST_F() 182 ret = HksKeyExist(&keyAlias, paramSet); in HWTEST_F() 188 ret = HksDeleteKey(&keyAlias, paramSet); in HWTEST_F() 207 struct HksBlob keyAlias = { strlen(alias), (uint8_t *)alias }; in HWTEST_F() local 209 int32_t ret = TestGenerateKey(&keyAlias, HKS_AUTH_STORAGE_LEVEL_D in HWTEST_F() 254 struct HksBlob keyAlias = { strlen(alias), (uint8_t *)alias }; HWTEST_F() local 304 struct HksBlob keyAlias = { strlen(alias), (uint8_t *)alias }; HWTEST_F() local 353 struct HksBlob keyAlias = { strlen(alias), (uint8_t *)alias }; HWTEST_F() local 399 struct HksBlob keyAlias = { strlen(alias), (uint8_t *)alias }; HWTEST_F() local 442 struct HksBlob keyAlias = { strlen(alias), (uint8_t *)alias }; HWTEST_F() local 482 struct HksBlob keyAlias = { strlen(alias), (uint8_t *)alias }; HWTEST_F() local 525 struct HksBlob keyAlias = { strlen(alias), (uint8_t *)alias }; HWTEST_F() local 566 struct HksBlob keyAlias = { strlen(alias), (uint8_t *)alias }; HWTEST_F() local 605 struct HksBlob keyAlias = { strlen(alias), (uint8_t *)alias }; HWTEST_F() local 645 struct HksBlob keyAlias = { strlen(alias), (uint8_t *)alias }; HWTEST_F() local [all...] |
H A D | hks_change_storage_level_part1_test.cpp | 205 static int32_t HksAesCipherTestEncrypt(const struct HksBlob *keyAlias, const struct HksParamSet *encryptParamSet, in HksAesCipherTestEncrypt() argument 210 int32_t ret = HksInit(keyAlias, encryptParamSet, &handleEncrypt, nullptr); in HksAesCipherTestEncrypt() 226 static int32_t HksAesCipherTestDecrypt(const struct HksBlob *keyAlias, const struct HksParamSet *decryptParamSet, in HksAesCipherTestDecrypt() argument 231 int32_t ret = HksInit(keyAlias, decryptParamSet, &handleDecrypt, nullptr); in HksAesCipherTestDecrypt() 263 const struct HksBlob keyAlias = { strlen(tmpKeyAlias), (uint8_t *)tmpKeyAlias }; in HWTEST_F() local 268 ret = HksGenerateKey(&keyAlias, srcParamSet, nullptr); in HWTEST_F() 281 ret = HksAesCipherTestEncrypt(&keyAlias, encryptParamSet, &plainText, &cipherText); in HWTEST_F() 288 ret = HksChangeStorageLevel(&keyAlias, srcParamSet, desParamSet); in HWTEST_F() 291 ret = HksKeyExist(&keyAlias, desParamSet); in HWTEST_F() 300 ret = HksAesCipherTestDecrypt(&keyAlias, decryptParamSe in HWTEST_F() 328 const struct HksBlob keyAlias = { strlen(tmpKeyAlias), (uint8_t *)tmpKeyAlias }; HWTEST_F() local 366 const struct HksBlob keyAlias = { strlen(tmpKeyAlias), (uint8_t *)tmpKeyAlias }; HWTEST_F() local 404 const struct HksBlob keyAlias = { strlen(tmpKeyAlias), (uint8_t *)tmpKeyAlias }; HWTEST_F() local 442 const struct HksBlob keyAlias = { strlen(tmpKeyAlias), (uint8_t *)tmpKeyAlias }; HWTEST_F() local 480 const struct HksBlob keyAlias = { strlen(tmpKeyAlias), (uint8_t *)tmpKeyAlias }; HWTEST_F() local 518 const struct HksBlob keyAlias = { strlen(tmpKeyAlias), (uint8_t *)tmpKeyAlias }; HWTEST_F() local 556 const struct HksBlob keyAlias = { strlen(tmpKeyAlias), (uint8_t *)tmpKeyAlias }; HWTEST_F() local 594 const struct HksBlob keyAlias = { strlen(tmpKeyAlias), (uint8_t *)tmpKeyAlias }; HWTEST_F() local 632 const struct HksBlob keyAlias = { strlen(tmpKeyAlias), (uint8_t *)tmpKeyAlias }; HWTEST_F() local 670 const struct HksBlob keyAlias = { strlen(tmpKeyAlias), (uint8_t *)tmpKeyAlias }; HWTEST_F() local 708 const struct HksBlob keyAlias = { strlen(tmpKeyAlias), (uint8_t *)tmpKeyAlias }; HWTEST_F() local 746 const struct HksBlob keyAlias = { strlen(tmpKeyAlias), (uint8_t *)tmpKeyAlias }; HWTEST_F() local 784 const struct HksBlob keyAlias = { strlen(tmpKeyAlias), (uint8_t *)tmpKeyAlias }; HWTEST_F() local 824 const struct HksBlob keyAlias = { strlen(tmpKeyAlias), (uint8_t *)tmpKeyAlias }; HWTEST_F() local 863 const struct HksBlob keyAlias = { strlen(tmpKeyAlias), (uint8_t *)tmpKeyAlias }; HWTEST_F() local 901 const struct HksBlob keyAlias = { strlen(tmpKeyAlias), (uint8_t *)tmpKeyAlias }; HWTEST_F() local 937 const struct HksBlob keyAlias = { strlen(tmpKeyAlias), (uint8_t *)tmpKeyAlias }; HWTEST_F() local 974 const struct HksBlob keyAlias = { strlen(tmpKeyAlias), (uint8_t *)tmpKeyAlias }; HWTEST_F() local 1020 struct HksBlob keyAlias = { strlen(tmpKeyAlias), (uint8_t *)tmpKeyAlias }; HWTEST_F() local [all...] |
H A D | hks_hkdf_derive_part2_test.cpp | 563 struct HksBlob keyAlias = { (uint32_t)strlen("HksHKDFDeriveKeyAliasTest0010"), (uint8_t *)"HksHKDFDeriveKeyAliasTest0010" }; in HWTEST_F() local 582 HksHkdfDeriveTestCmpCase(keyAlias, genParamSet, hkdfParamSet, hkdfFinishParamSet); in HWTEST_F() 584 HksHkdfDeriveTestNormalCase(keyAlias, genParamSet, hkdfParamSet, hkdfFinishParamSet, HKS_SUCCESS); in HWTEST_F() 587 ret = HksDeleteKeyForDe(&keyAlias, genParamSet); in HWTEST_F() 601 struct HksBlob keyAlias = { (uint32_t)strlen("HksHKDFDeriveKeyAliasTest0011"), (uint8_t *)"HksHKDFDeriveKeyAliasTest0011" }; in HWTEST_F() local 620 HksHkdfDeriveTestCmpCase(keyAlias, genParamSet, hkdfParamSet, hkdfFinishParamSet); in HWTEST_F() 622 HksHkdfDeriveTestNormalCase(keyAlias, genParamSet, hkdfParamSet, hkdfFinishParamSet, HKS_SUCCESS); in HWTEST_F() 625 ret = HksDeleteKeyForDe(&keyAlias, genParamSet); in HWTEST_F() 638 struct HksBlob keyAlias = { (uint32_t)strlen("HksHKDFDeriveKeyAliasTest0012"), (uint8_t *)"HksHKDFDeriveKeyAliasTest0012" }; in HWTEST_F() local 657 HksHkdfDeriveTestCmpCase(keyAlias, genParamSe in HWTEST_F() 677 struct HksBlob keyAlias = { (uint32_t)strlen("HksHKDFDeriveKeyAliasTest0013"), (uint8_t *)"HksHKDFDeriveKeyAliasTest0013" }; HWTEST_F() local 717 struct HksBlob keyAlias = { (uint32_t)strlen("HksHKDFDeriveKeyAliasTest0014"), (uint8_t *)"HksHKDFDeriveKeyAliasTest0014" }; HWTEST_F() local 755 struct HksBlob keyAlias = { (uint32_t)strlen("HksHKDFDeriveKeyAliasTest0015"), (uint8_t *)"HksHKDFDeriveKeyAliasTest0015" }; HWTEST_F() local 794 struct HksBlob keyAlias = { (uint32_t)strlen("HksHKDFDeriveKeyAliasTest0016"), (uint8_t *)"HksHKDFDeriveKeyAliasTest0016" }; HWTEST_F() local 832 struct HksBlob keyAlias = { (uint32_t)strlen("HksHKDFDeriveKeyAliasTest0017"), (uint8_t *)"HksHKDFDeriveKeyAliasTest0017" }; HWTEST_F() local 870 struct HksBlob keyAlias = { (uint32_t)strlen("HksHKDFDeriveKeyAliasTest0018"), (uint8_t *)"HksHKDFDeriveKeyAliasTest0018" }; HWTEST_F() local 908 struct HksBlob keyAlias = { (uint32_t)strlen("HksHKDFDeriveKeyAliasTest0019"), (uint8_t *)"HksHKDFDeriveKeyAliasTest0019" }; HWTEST_F() local 960 struct HksBlob keyAlias = { (uint32_t)strlen("HksHKDFDeriveKeyAliasTest0020"), (uint8_t *)"HksHKDFDeriveKeyAliasTest0020" }; HWTEST_F() local 999 struct HksBlob keyAlias = { (uint32_t)strlen("HksHKDFDeriveKeyAliasTest021"), (uint8_t *)"HksHKDFDeriveKeyAliasTest021" }; HWTEST_F() local 1040 struct HksBlob keyAlias = { (uint32_t)strlen("HksHKDFDeriveKeyAliasTest022"), (uint8_t *)"HksHKDFDeriveKeyAliasTest022" }; HWTEST_F() local 1077 struct HksBlob keyAlias = { (uint32_t)strlen("HksHKDFDeriveKeyAliasTest023"), (uint8_t *)"HksHKDFDeriveKeyAliasTest023" }; HWTEST_F() local 1116 struct HksBlob keyAlias = { (uint32_t)strlen("HksHKDFDeriveKeyAliasTest024"), (uint8_t *)"HksHKDFDeriveKeyAliasTest024" }; HWTEST_F() local [all...] |
H A D | hks_sm4_cipher_test_common.cpp | 24 static int32_t HksSm4CipherTestEncrypt(const struct HksBlob *keyAlias, in HksSm4CipherTestEncrypt() argument 29 int32_t ret = HksInitForDe(keyAlias, encryptParamSet, &handleEncrypt, nullptr); in HksSm4CipherTestEncrypt() 45 static int32_t HksSm4CipherTestDecrypt(const struct HksBlob *keyAlias, in HksSm4CipherTestDecrypt() argument 51 int32_t ret = HksInitForDe(keyAlias, decryptParamSet, &handleDecrypt, nullptr); in HksSm4CipherTestDecrypt() 66 int32_t HksSm4CipherTestCaseOther(const struct HksBlob *keyAlias, struct HksParamSet *genParamSet, in HksSm4CipherTestCaseOther() argument 83 ret = HksGenerateKeyForDe(keyAlias, genParamSet, nullptr); in HksSm4CipherTestCaseOther() 92 ret = HksSm4CipherTestEncrypt(keyAlias, encryptParamSet, &inData, &cipherText); in HksSm4CipherTestCaseOther() 98 ret = HksSm4CipherTestDecrypt(keyAlias, decryptParamSet, &cipherText, &plainText, &inData); in HksSm4CipherTestCaseOther() 102 EXPECT_EQ(HksDeleteKeyForDe(keyAlias, genParamSet), HKS_SUCCESS) << "DeleteKey failed."; in HksSm4CipherTestCaseOther() 107 int32_t HksSm4CipherTestCaseGcm(const struct HksBlob *keyAlias, struc argument [all...] |
/base/security/huks/test/unittest/huks_lite_test/liteos_m_adapter/ |
H A D | hks_exist_test.c | 75 struct HksBlob *keyAlias = NULL; in LITE_TEST_CASE() local 77 TEST_ASSERT_TRUE(TestGenDefaultKeyAndGetAlias(&keyAlias) == 0); in LITE_TEST_CASE() 78 ret = HksKeyExistRun(keyAlias, 1); in LITE_TEST_CASE() 80 TEST_ASSERT_TRUE(HksDeleteKeyForDe(keyAlias, NULL) == HKS_SUCCESS); in LITE_TEST_CASE() 82 ret = TestConstuctBlob(&keyAlias, in LITE_TEST_CASE() 88 ret = HksKeyExistRun(keyAlias, 1); in LITE_TEST_CASE() 94 TestFreeBlob(&keyAlias); in LITE_TEST_CASE()
|
/base/security/huks/test/unittest/huks_standard_test/interface_inner_test/sdk_test/src/ |
H A D | hks_exist_test.cpp | 71 struct HksBlob *keyAlias = NULL; in HWTEST_F() local 73 EXPECT_TRUE(TestGenDefaultKeyAndGetAlias(&keyAlias) == 0); in HWTEST_F() 74 ret = HksKeyExistRun(keyAlias, 1); in HWTEST_F() 76 EXPECT_TRUE(HksDeleteKeyForDe(keyAlias, NULL) == HKS_SUCCESS); in HWTEST_F() 78 ret = TestConstuctBlob(&keyAlias, in HWTEST_F() 84 ret = HksKeyExistRun(keyAlias, 1); in HWTEST_F() 90 TestFreeBlob(&keyAlias); in HWTEST_F()
|
H A D | hks_modify_key_test.cpp | 65 static int32_t ModifyKey(struct HksBlob *keyAlias) in ModifyKey() argument 67 uint32_t sizeOne = HksFileSize(g_storePath, (char *)keyAlias->data); in ModifyKey() 74 int32_t ret = HksFileRead(g_storePath, (char *)keyAlias->data, 0, &blobOne, &sizeRead); in ModifyKey() 77 ret = HksFileWrite(g_storePath, (char *)keyAlias->data, 0, bufOne, sizeOne); in ModifyKey() 84 int32_t BaseTestCipher(struct HksBlob *keyAlias, uint32_t index) in BaseTestCipher() argument 98 keyAlias, &g_testCipherParams[index].encryptParamSetParams, in BaseTestCipher() 107 keyAlias, &g_testCipherParams[index], cipherData, in BaseTestCipher() 139 struct HksBlob keyAlias = { strlen(g_testName), (uint8_t *)g_testName }; in HWTEST_F() local 140 int32_t ret = GenerateKeyTwo(&keyAlias, &g_testCipherParams[index].keyAliasParams, in HWTEST_F() 144 ret = BaseTestCipher(&keyAlias, in HWTEST_F() [all...] |
/base/security/huks/test/unittest/huks_lite_test/liteos_a_adapter/ |
H A D | hks_exist_test.cpp | 72 struct HksBlob *keyAlias = NULL; in HWTEST_F() local 74 HKS_TEST_ASSERT(TestGenDefaultKeyAndGetAlias(&keyAlias) == 0); in HWTEST_F() 75 ret = HksKeyExistRun(keyAlias, 1); in HWTEST_F() 77 HKS_TEST_ASSERT(HksDeleteKeyForDe(keyAlias, NULL) == HKS_SUCCESS); in HWTEST_F() 79 ret = TestConstuctBlob(&keyAlias, in HWTEST_F() 85 ret = HksKeyExistRun(keyAlias, 1); in HWTEST_F() 91 TestFreeBlob(&keyAlias); in HWTEST_F()
|
/base/security/huks/test/unittest/huks_standard_test/three_stage_test/src/asymmetric_alg_test/ |
H A D | hks_rsa_cipher_test_common.cpp | 21 int32_t Unittest::RsaCipher::HksRsaCipherTestEncryptAbnormal(const struct HksBlob *keyAlias, in HksRsaCipherTestEncryptAbnormal() argument 26 int32_t ret = HksInitForDe(keyAlias, encryptParamSet, &handleEncrypt, nullptr); in HksRsaCipherTestEncryptAbnormal() 43 ret = HksEncryptForDe(keyAlias, encryptParamSet, inData, &outData); in HksRsaCipherTestEncryptAbnormal() 53 int32_t Unittest::RsaCipher::HksRsaCipherTestEncrypt(const struct HksBlob *keyAlias, in HksRsaCipherTestEncrypt() argument 58 int32_t ret = HksInitForDe(keyAlias, encryptParamSet, &handleEncrypt, nullptr); in HksRsaCipherTestEncrypt() 73 ret = HksEncryptForDe(keyAlias, encryptParamSet, inData, &outData); in HksRsaCipherTestEncrypt() 82 int32_t Unittest::RsaCipher::HksRsaCipherTestDecrypt(const struct HksBlob *keyAlias, in HksRsaCipherTestDecrypt() argument 88 int32_t ret = HksInitForDe(keyAlias, decryptParamSet, &handleDecrypt, nullptr); in HksRsaCipherTestDecrypt() 103 ret = HksDecryptForDe(keyAlias, decryptParamSet, cipherText, &outData); in HksRsaCipherTestDecrypt() 113 int32_t Unittest::RsaCipher::HksRsaCipherTestCase(const struct HksBlob *keyAlias, struc argument 148 HksRsaCipherTestCaseAbnormal(const struct HksBlob *keyAlias, struct HksParamSet *genParamSet, struct HksParamSet *encryptParamSet, struct HksParamSet *decryptParamSet, const struct HksBlob *inData) HksRsaCipherTestCaseAbnormal() argument [all...] |
H A D | hks_ecc_sign_verify_test_common.cpp | 23 int32_t HksTestSignVerify(struct HksBlob *keyAlias, struct HksParamSet *paramSet, in HksTestSignVerify() argument 28 int32_t ret = HksInitForDe(keyAlias, paramSet, &handle, nullptr); in HksTestSignVerify() 50 ret = HksSignForDe(keyAlias, paramSet, inData, &outData1); in HksTestSignVerify() 53 ret = HksVerifyForDe(keyAlias, paramSet, inData, outData); in HksTestSignVerify() 60 int32_t HksEccSignVerifyTestNormalCase(struct HksBlob keyAlias, struct HksParamSet *genParamSet, in HksEccSignVerifyTestNormalCase() argument 79 ret = HksGenerateKeyForDe(&keyAlias, genParamSet, nullptr); in HksEccSignVerifyTestNormalCase() 85 ret = HksTestSignVerify(&keyAlias, signParamSet, &inData, &outDataSign, true); in HksEccSignVerifyTestNormalCase() 91 ret = HksExportPublicKeyForDe(&keyAlias, genParamSet, &publicKey); in HksEccSignVerifyTestNormalCase() 111 int32_t HksTestSignVerifyParamAbsent(struct HksBlob keyAlias, struct HksParamSet *genParamSet, in HksTestSignVerifyParamAbsent() argument 115 uint32_t ret = HksGenerateKeyForDe(&keyAlias, genParamSe in HksTestSignVerifyParamAbsent() [all...] |
H A D | hks_ed25519_sign_verify_test.cpp | 62 int32_t HksTestSignVerify(struct HksBlob *keyAlias, struct HksParamSet *paramSet, const struct HksBlob *inData, in HksTestSignVerify() argument 68 int32_t ret = HksInitForDe(keyAlias, paramSet, &handleTest, nullptr); in HksTestSignVerify() 89 ret = HksSignForDe(keyAlias, paramSet, inData, &outData1); in HksTestSignVerify() 92 ret = HksVerifyForDe(keyAlias, paramSet, inData, outData); in HksTestSignVerify() 99 static int32_t HksEd25519SignVerifyTestNormalCase(struct HksBlob keyAlias, struct HksParamSet *genParamSet, in HksEd25519SignVerifyTestNormalCase() argument 117 ret = HksGenerateKeyForDe(&keyAlias, genParamSet, nullptr); in HksEd25519SignVerifyTestNormalCase() 123 ret = HksTestSignVerify(&keyAlias, signParamSet, &inData, &outDataSign, true); in HksEd25519SignVerifyTestNormalCase() 129 ret = HksExportPublicKeyForDe(&keyAlias, genParamSet, &publicKey); in HksEd25519SignVerifyTestNormalCase() 171 struct HksBlob keyAlias = { (uint32_t)strlen(keyAliasString), (uint8_t *)keyAliasString }; in HWTEST_F() local 174 ret = HksGenerateKeyForDe(&keyAlias, genParamSe in HWTEST_F() 217 struct HksBlob keyAlias = { (uint32_t)strlen(keyAliasString), (uint8_t *)keyAliasString }; HWTEST_F() local 291 struct HksBlob keyAlias = { (uint32_t)strlen(keyAliasString), (uint8_t *)keyAliasString }; HWTEST_F() local 336 struct HksBlob keyAlias = { (uint32_t)strlen(keyAliasString), (uint8_t *)keyAliasString }; HWTEST_F() local 392 struct HksBlob keyAlias = { (uint32_t)strlen(keyAliasString), (uint8_t *)keyAliasString }; HWTEST_F() local 428 struct HksBlob keyAlias = { (uint32_t)strlen(keyAliasString), (uint8_t *)keyAliasString }; HWTEST_F() local 461 struct HksBlob keyAlias = { (uint32_t)strlen(keyAliasString), (uint8_t *)keyAliasString }; HWTEST_F() local [all...] |
/base/security/huks/interfaces/inner_api/huks_standard/main/include/ |
H A D | hks_api.h | 54 * @param keyAlias key alias 59 HKS_API_EXPORT int32_t HksGenerateKey(const struct HksBlob *keyAlias, 64 * @param keyAlias key alias 69 HKS_API_EXPORT int32_t HksImportKey(const struct HksBlob *keyAlias, 74 * @param keyAlias key alias 80 HKS_API_EXPORT int32_t HksImportWrappedKey(const struct HksBlob *keyAlias, const struct HksBlob *wrappingKeyAlias, 85 * @param keyAlias key alias 90 HKS_API_EXPORT int32_t HksExportPublicKey(const struct HksBlob *keyAlias, 95 * @param keyAlias key alias 99 HKS_API_EXPORT int32_t HksDeleteKey(const struct HksBlob *keyAlias, cons [all...] |
/base/security/huks/test/unittest/huks_lite_test/liteos_a_adapter/upgrade_test/version_one/module_test/src/ |
H A D | hks_compatibility_module_test.cpp | 139 static int32_t HksServiceGenerateKeyForDe(const struct HksProcessInfo *processInfo, const struct HksBlob *keyAlias, in HksServiceGenerateKeyForDe() argument 156 ret = HksServiceGenerateKey(processInfo, keyAlias, newParamSet, keyOut); in HksServiceGenerateKeyForDe() 161 static int32_t HksServiceDeleteKeyForDe(const struct HksProcessInfo *processInfo, const struct HksBlob *keyAlias, in HksServiceDeleteKeyForDe() argument 178 ret = HksServiceDeleteKey(processInfo, keyAlias, newParamSet); in HksServiceDeleteKeyForDe() 183 static int32_t HksServiceKeyExistForDe(const struct HksProcessInfo *processInfo, const struct HksBlob *keyAlias, in HksServiceKeyExistForDe() argument 200 ret = HksServiceKeyExist(processInfo, keyAlias, newParamSet); in HksServiceKeyExistForDe() 205 static int32_t HksServiceEncryptForDe(const struct HksProcessInfo *processInfo, const struct HksBlob *keyAlias, in HksServiceEncryptForDe() argument 222 ret = HksServiceEncrypt(processInfo, keyAlias, newParamSet, plainText, cipherText); in HksServiceEncryptForDe() 227 static int32_t HksServiceDecryptForDe(const struct HksProcessInfo *processInfo, const struct HksBlob *keyAlias, in HksServiceDecryptForDe() argument 244 ret = HksServiceDecrypt(processInfo, keyAlias, newParamSe in HksServiceDecryptForDe() 271 TestGenerateOldkey(const struct HksBlob *keyAlias, const struct HksParam *genParams, uint32_t genParamsCnt) TestGenerateOldkey() argument 289 TestGenerateNewKeyWithProcessInfo(const struct HksBlob *keyAlias, const struct HksParam *genParams, uint32_t genParamsCnt, struct HksProcessInfo *processInfo) TestGenerateNewKeyWithProcessInfo() argument 308 TestDoServiceEncryptWithOtherUid(const struct HksBlob *keyAlias, const struct HksParam *encParams, uint32_t encParamsCnt, struct HksBlob *plainBlob, struct HksBlob *cipherBlob) TestDoServiceEncryptWithOtherUid() argument 338 TestDoServiceDecryptWithOtherUid(const struct HksBlob *keyAlias, const struct HksParam *decParams, uint32_t decParamsCnt, struct HksBlob *cipherBlob, struct HksBlob *decryptedBlob) TestDoServiceDecryptWithOtherUid() argument 375 struct HksBlob keyAlias = { .size = (uint32_t)strlen(KEY_ALIAS), .data = (uint8_t *)KEY_ALIAS }; HWTEST_F() local 426 struct HksBlob keyAlias = { .size = (uint32_t)strlen(KEY_ALIAS), .data = (uint8_t *)KEY_ALIAS }; HWTEST_F() local 464 struct HksBlob keyAlias = { .size = (uint32_t)strlen(KEY_ALIAS), .data = (uint8_t *)KEY_ALIAS }; HWTEST_F() local 538 struct HksBlob keyAlias = { .size = (uint32_t)strlen(KEY_ALIAS), .data = (uint8_t *)KEY_ALIAS }; HWTEST_F() local [all...] |
/base/security/huks/test/unittest/huks_common_test/include/ |
H A D | hks_test_adapt_for_de.h | 29 int32_t HksGenerateKeyForDe(const struct HksBlob *keyAlias, 32 int32_t HksImportKeyForDe(const struct HksBlob *keyAlias, 35 int32_t HksImportWrappedKeyForDe(const struct HksBlob *keyAlias, const struct HksBlob *wrappingKeyAlias, 38 int32_t HksExportPublicKeyForDe(const struct HksBlob *keyAlias, 41 int32_t HksDeleteKeyForDe(const struct HksBlob *keyAlias, const struct HksParamSet *paramSet); 43 int32_t HksGetKeyParamSetForDe(const struct HksBlob *keyAlias, 46 int32_t HksKeyExistForDe(const struct HksBlob *keyAlias, const struct HksParamSet *paramSet); 72 int32_t HksAttestKeyForDe(const struct HksBlob *keyAlias, const struct HksParamSet *paramSet, 75 int32_t HksAnonAttestKeyForDe(const struct HksBlob *keyAlias, const struct HksParamSet *paramSet, 78 int32_t HksInitForDe(const struct HksBlob *keyAlias, cons [all...] |