/ohos5.0/base/security/huks/frameworks/huks_standard/main/crypto_engine/rkc/src/ |
H A D | hks_rkc_rw.c | 175 if (ksfDataRkc == NULL) { in ExtractKsfDataRkc() 189 sizeof(ksfDataRkc->rkMaterial1)); in ExtractKsfDataRkc() 194 sizeof(ksfDataRkc->rkMaterial2)); in ExtractKsfDataRkc() 202 …ret = ExtractFieldFromBuffer(ksfFromFile, ksfBufOffset, ksfDataRkc->rmkSalt, sizeof(ksfDataRkc->rm… in ExtractKsfDataRkc() 210 …return ExtractFieldFromBuffer(ksfFromFile, ksfBufOffset, ksfDataRkc->rkRsv, sizeof(ksfDataRkc->rkR… in ExtractKsfDataRkc() 382 …ret = FillFieldToBuffer(ksfDataRkc->rkMaterial1, sizeof(ksfDataRkc->rkMaterial1), ksfBuf, ksfBufOf… in FillKsfDataRkc() 386 …ret = FillFieldToBuffer(ksfDataRkc->rkMaterial2, sizeof(ksfDataRkc->rkMaterial2), ksfBuf, ksfBufOf… in FillKsfDataRkc() 390 …ret = FillFieldToBuffer(&(ksfDataRkc->rmkIter), sizeof(ksfDataRkc->rmkIter), ksfBuf, ksfBufOffset); in FillKsfDataRkc() 394 ret = FillFieldToBuffer(ksfDataRkc->rmkSalt, sizeof(ksfDataRkc->rmkSalt), ksfBuf, ksfBufOffset); in FillKsfDataRkc() 398 …ret = FillFieldToBuffer(&(ksfDataRkc->rmkHashAlg), sizeof(ksfDataRkc->rmkHashAlg), ksfBuf, ksfBufO… in FillKsfDataRkc() [all …]
|
H A D | hks_rkc_v1.c | 41 ret = ExtractKsfDataRkc(ksfFromFile, &ksfBufOffset, &(ksfData->ksfDataRkc)); in RkcExtractKsfBufV1() 113 static int32_t RkcGetRmkRawKeyV1(const struct HksKsfDataRkc *ksfDataRkc, struct HksBlob *rawKey) in RkcGetRmkRawKeyV1() argument 124 … rawKey->data[i] = ksfDataRkc->rkMaterial1[i] ^ ksfDataRkc->rkMaterial2[i] ^ material3.data[i]; in RkcGetRmkRawKeyV1() 149 static int32_t RkcDeriveRmkV1(const struct HksKsfDataRkc *ksfDataRkc, struct HksBlob *rmk) in RkcDeriveRmkV1() argument 161 ret = RkcGetRmkRawKeyV1(ksfDataRkc, &rawKey); in RkcDeriveRmkV1() 165 const struct HksBlob salt = { HKS_RKC_SALT_LEN, (uint8_t *)(ksfDataRkc->rmkSalt) }; in RkcDeriveRmkV1() 166 ret = RkcPbkdf2Hmac(ksfDataRkc->rmkHashAlg, &rawKey, &salt, ksfDataRkc->rmkIter, rmk); in RkcDeriveRmkV1() 187 ret = RkcDeriveRmkV1(&(ksfData->ksfDataRkc), &rmk); in RkcMkCryptV1() 212 … RkcRecoverRkTime(validKsfData->ksfDataRkc.rkCreatedTime, validKsfData->ksfDataRkc.rkExpiredTime); in RkcLoadKsfV1() 277 …ret = RkcMkCrypt(&(newKsfDataRkcWithVer->ksfDataRkc), &(newKsfDataMkWithVer->ksfDataMk), &tempMkBl… in UpgradeV1ToV2()
|
H A D | hks_rkc.c | 134 rawKey->data[i] = ksfDataRkc->rkMaterial1[i] ^ ksfDataRkc->rkMaterial2[i] ^ udid[i]; in RkcGetRmkRawKey() 178 ret = RkcGetRmkRawKey(ksfDataRkc, &rawKey); in RkcDeriveRmk() 183 ret = RkcHkdfHmac(ksfDataRkc->rmkHashAlg, &rawKey, &salt, ksfDataRkc->rmkIter, rmk); in RkcDeriveRmk() 204 static int32_t RkcMakeRandomMaterial(struct HksKsfDataRkc *ksfDataRkc) in RkcMakeRandomMaterial() argument 207 struct HksBlob random1 = { HKS_RKC_MATERIAL_LEN, ksfDataRkc->rkMaterial1 }; in RkcMakeRandomMaterial() 279 ret = RkcDeriveRmk(ksfDataRkc, &rmk); in RkcMkCrypt() 424 RkcRecoverRkTime(validKsfDataRkcWithVer->ksfDataRkc.rkCreatedTime, in RkcLoadKsf() 425 validKsfDataRkcWithVer->ksfDataRkc.rkExpiredTime); in RkcLoadKsf() 452 ksfDataRkcWithVer->ksfDataRkc.rmkIter = g_hksRkcCfg.rmkIter; in FillKsfDataRkcWithVer() 453 ksfDataRkcWithVer->ksfDataRkc.rmkHashAlg = g_hksRkcCfg.rmkHashAlg; in FillKsfDataRkcWithVer() [all …]
|
/ohos5.0/base/security/huks/frameworks/huks_standard/main/crypto_engine/rkc/include/ |
H A D | hks_rkc_rw.h | 93 struct HksKsfDataRkc ksfDataRkc; /* fields of root key */ member 114 …taRkc(const struct HksBlob *ksfFromFile, uint32_t *ksfBufOffset, struct HksKsfDataRkc *ksfDataRkc); 122 int32_t HksReadKsfRkc(const char *ksfName, struct HksKsfDataRkcWithVer *ksfDataRkc); 126 int32_t HksWriteKsfRkc(const char *ksfName, const struct HksKsfDataRkcWithVer *ksfDataRkc);
|
H A D | hks_rkc_v1.h | 25 struct HksKsfDataRkc ksfDataRkc; /* fields of root key */ member
|
H A D | hks_rkc.h | 71 int32_t RkcMkCrypt(const struct HksKsfDataRkc *ksfDataRkc, const struct HksKsfDataMk *ksfDataMk,
|
/ohos5.0/base/security/huks/test/fuzz_test/innerapi_fuzzer/hksrkc_fuzzer/ |
H A D | hksrkc_fuzzer.cpp | 62 ret = RkcMkCrypt(&(newRkc.ksfDataRkc), &(newMk.ksfDataMk), &tempMkBlob, &cipherTextBlob, true); in TestStoreNewKsfFile() 83 ret = RkcMkCrypt(&newRkc.ksfDataRkc, &newMk.ksfDataMk, &tempMkBlob, &cipherTextBlob, false); in TestGetMkFromNewKsfFile()
|
/ohos5.0/base/security/huks/test/unittest/huks_lite_test/liteos_a_adapter/upgrade_test/version_two/ |
H A D | hks_upgrade_rkc_test.cpp | 94 ret = RkcMkCrypt(&(newRkc.ksfDataRkc), &(newMk.ksfDataMk), &tempMkBlob, &cipherTextBlob, true); in TestStoreNewKsfFile() 121 ret = RkcMkCrypt(&newRkc.ksfDataRkc, &newMk.ksfDataMk, &tempMkBlob, &cipherTextBlob, false); in TestGetMkFromNewKsfFile()
|