Home
last modified time | relevance | path

Searched refs:salt (Results 1 - 17 of 17) sorted by relevance

/drivers/peripheral/user_auth/hdi_service/key_mgr/src/
H A Dhmac_key.c43 Buffer *salt = NULL; in GenerateHmacKey() local
45 salt = MergeBuffers(&localUdidBuf, peerUdid); in GenerateHmacKey()
47 salt = MergeBuffers(peerUdid, &localUdidBuf); in GenerateHmacKey()
49 if (!IsBufferValid(salt)) { in GenerateHmacKey()
50 LOG_ERROR("generate salt failed"); in GenerateHmacKey()
54 ResultCode result = (ResultCode)GetDistributeKey(peerUdid, salt, &key); in GenerateHmacKey()
55 DestoryBuffer(salt); in GenerateHmacKey()
/drivers/peripheral/pin_auth/test/unittest/pin_auth/database/src/
H A Dpin_db_test.cpp59 (void)memset_s(pinEnrollParam->salt, CONST_SALT_LEN, 1, CONST_SALT_LEN); in HWTEST_F()
120 std::vector<uint8_t> salt(CONST_SALT_LEN, 1); in HWTEST_F()
122 (void)memcpy_s(&(pinEnrollParam->salt[0]), CONST_SALT_LEN, &salt[0], CONST_SALT_LEN); in HWTEST_F()
169 std::vector<uint8_t> salt(CONST_SALT_LEN, 1); in HWTEST_F()
171 (void)memcpy_s(&(pinEnrollParam->salt[0]), CONST_SALT_LEN, &salt[0], CONST_SALT_LEN); in HWTEST_F()
212 std::vector<uint8_t> salt(CONST_SALT_LEN, 1); in HWTEST_F()
214 (void)memcpy_s(&(pinEnrollParam->salt[0]), CONST_SALT_LEN, &salt[ in HWTEST_F()
[all...]
/drivers/peripheral/pin_auth/test/unittest/pin_auth/adaptor/src/
H A Dadaptor_algorithm_test.cpp258 Buffer *salt = CreateBufferBySize(HKDF_SALT_SIZE); in HWTEST_F() local
259 ASSERT_NE(salt, nullptr); in HWTEST_F()
260 (void)SecureRandom(salt->buf, salt->maxSize); in HWTEST_F()
261 salt->contentSize = salt->maxSize; in HWTEST_F()
266 Buffer *key = Hkdf(salt, rootKey); in HWTEST_F()
269 DestroyBuffer(salt); in HWTEST_F()
/drivers/peripheral/pin_auth/hdi_service/main/src/
H A Dverifier_func.c41 Buffer *salt; member
113 DestroyBuffer(g_verifierSchedule->salt); in DestroyVerifierSchedule()
162 if (g_verifierSchedule->salt != NULL) { in SetVerifyAckDataSalt()
163 LOG_ERROR("get non null salt!"); in SetVerifyAckDataSalt()
166 g_verifierSchedule->salt = CreateBufferBySize(CONST_KEK_SALT_SIZE); in SetVerifyAckDataSalt()
167 if (g_verifierSchedule->salt == NULL) { in SetVerifyAckDataSalt()
168 LOG_ERROR("create salt fail!"); in SetVerifyAckDataSalt()
171 int32_t result = SecureRandom(g_verifierSchedule->salt->buf, g_verifierSchedule->salt->maxSize); in SetVerifyAckDataSalt()
173 LOG_ERROR("random salt fai in SetVerifyAckDataSalt()
[all...]
H A Dcollector_func.c39 Buffer *salt; member
112 DestroyBuffer(g_collectorSchedule->salt); in DestroyCollectorSchedule()
287 g_collectorSchedule->salt = GetBufferFromAttribute(data, PIN_ATTR_KEK_SALT, CONST_KEK_SALT_SIZE); in DoSendMessageToCollector()
288 if (g_collectorSchedule->salt == NULL) { in DoSendMessageToCollector()
289 LOG_ERROR("get kek salt fail"); in DoSendMessageToCollector()
335 if (GetDistributeKey(g_collectorSchedule->peerUdid, g_collectorSchedule->salt, &(aesGcmParam->key)) != in GetAesGcmParam()
H A Dpin_auth.cpp105 int32_t PinAuth::EnrollPin(uint64_t scheduleId, uint64_t subType, std::vector<uint8_t> &salt, in EnrollPin() argument
110 if (salt.size() != CONST_SALT_LEN || pinData.size() != CONST_PIN_DATA_LEN) { in EnrollPin()
117 if (memcpy_s(&(pinEnrollParam.salt[0]), CONST_SALT_LEN, salt.data(), CONST_SALT_LEN) != EOK) { in EnrollPin()
118 LOG_ERROR("copy salt to pinEnrollParam fail!"); in EnrollPin()
/drivers/peripheral/pin_auth/hdi_service/adaptor/src/
H A Dadaptor_algorithm.c300 Buffer *Hkdf(const Buffer *salt, const Buffer *rootKey) in Hkdf() argument
302 if (!IsBufferValid(salt) || salt->contentSize != HKDF_SALT_SIZE || in Hkdf()
321 EVP_PKEY_CTX_set1_hkdf_salt(ctx, salt->buf, salt->contentSize) != OPENSSL_SUCCESS || in Hkdf()
359 int32_t GetDistributeKey(const Buffer *peerUdid, const Buffer *salt, Buffer **key) in GetDistributeKey() argument
361 if (!IsBufferValid(peerUdid) || !IsBufferValid(salt) || (key == NULL)) { in GetDistributeKey()
365 Buffer *keyData = CreateBufferBySize(salt->contentSize + REMOTE_PIN_DISTRIBUTE_DEVICE_KEY_SIZE); in GetDistributeKey()
378 keyData->maxSize - keyData->contentSize, salt->buf, salt in GetDistributeKey()
[all...]
/drivers/peripheral/pin_auth/hdi_service/adaptor/inc/
H A Dadaptor_algorithm.h60 Buffer *Hkdf(const Buffer *salt, const Buffer *rootKey);
69 int32_t GetDistributeKey(const Buffer *peerUdid, const Buffer *salt, Buffer **key);
/drivers/peripheral/pin_auth/hdi_service/database/inc/
H A Dpin_db.h36 uint8_t salt[CONST_SALT_LEN]; member
44 ResultCode DoGetAlgoParameter(uint64_t templateId, uint8_t *salt, uint32_t *saltLen, uint32_t *algoVersion);
/drivers/peripheral/pin_auth/test/unittest/pin_auth/main/src/
H A Dall_in_one_func_test.cpp58 std::vector<uint8_t> salt(CONST_SALT_LEN, 1); in HWTEST_F()
60 (void)memcpy_s(&(pinEnrollParam->salt[0]), CONST_SALT_LEN, &salt[0], CONST_SALT_LEN); in HWTEST_F()
H A Dpin_auth_test.cpp67 std::vector<uint8_t> salt(30, 1); in HWTEST_F()
71 int32_t result = pinAuth->EnrollPin(0, 10010, salt, pinData, resultTlv); in HWTEST_F()
88 std::vector<uint8_t> salt; in HWTEST_F() local
262 std::vector<uint8_t> salt(CONST_SALT_LEN, 1); in HWTEST_F()
264 result = pinAuth->EnrollPin(0, 10010, salt, pinData, resultTlv); in HWTEST_F()
317 std::vector<uint8_t> salt(CONST_SALT_LEN, 1); in HWTEST_F()
319 int32_t result = pinAuth->EnrollPin(0, 10010, salt, pinData, resultTlv); in HWTEST_F()
/drivers/peripheral/huks/hdi_service/
H A Dhuks_sa_hdi_struct.h159 * @param salt the salt value
164 int32_t (*HuksHdiCalcMacHeader)(const struct HksParamSet *paramSet, const struct HksBlob *salt,
273 * @param salt salt value
278 int32_t (*HuksHdiExportChipsetPlatformPublicKey)(const struct HksBlob *salt,
H A Dhuks_hdi_service.c214 static int32_t HuksExportChipsetPlatformPublicKey(struct IHuks *self, const struct HuksBlob *salt, in HuksExportChipsetPlatformPublicKey() argument
218 (void)salt; in HuksExportChipsetPlatformPublicKey()
/drivers/peripheral/user_auth/hdi_service/adaptor/src/
H A Dadaptor_algorithm.c489 int32_t GetDistributeKey(const Buffer *peerUdid, const Buffer *salt, Buffer **key) in GetDistributeKey() argument
491 if (!IsBufferValid(peerUdid) || !IsBufferValid(salt) || (key == NULL)) { in GetDistributeKey()
495 Buffer *keyData = CreateBufferBySize(salt->contentSize + USER_AUTH_DISTRIBUTE_DEVICE_KEY_SIZE); in GetDistributeKey()
506 if (memcpy_s(keyData->buf + keyData->contentSize, keyData->maxSize - keyData->contentSize, salt->buf, salt->contentSize) != EOK) { in GetDistributeKey()
507 LOG_ERROR("copy salt fail"); in GetDistributeKey()
511 keyData->contentSize += salt->contentSize; in GetDistributeKey()
/drivers/peripheral/user_auth/hdi_service/adaptor/inc/
H A Dadaptor_algorithm.h58 int32_t GetDistributeKey(const Buffer *peerUdid, const Buffer *salt, Buffer **key);
/drivers/peripheral/pin_auth/hdi_service/main/inc/
H A Dpin_auth.h55 int32_t EnrollPin(uint64_t scheduleId, uint64_t subType, std::vector<uint8_t> &salt,
/drivers/peripheral/pin_auth/hdi_service/database/src/
H A Dpin_db.c345 static ResultCode WriteAddPinInfo(const Buffer *secret, const Buffer *pinCredentialData, uint8_t *salt, in WriteAddPinInfo() argument
354 ret = WritePinFile(salt, saltLen, templateId, SALT_SUFFIX); in WriteAddPinInfo()
570 ResultCode ret = WriteAddPinInfo(secret, cipherInfo, pinEnrollParam->salt, CONST_SALT_LEN, *templateId); in ProcessAddPin()
631 ResultCode DoGetAlgoParameter(uint64_t templateId, uint8_t *salt, uint32_t *saltLen, uint32_t *algoVersion) in DoGetAlgoParameter() argument
633 if (salt == NULL || saltLen == NULL || templateId == INVALID_TEMPLATE_ID || algoVersion == NULL) { in DoGetAlgoParameter()
648 ret = ReadPinFile(salt, *saltLen, templateId, SALT_SUFFIX); in DoGetAlgoParameter()
650 LOG_ERROR("salt file read fail."); in DoGetAlgoParameter()
1123 LOG_ERROR("Generate salt failed"); in DoGenerateAlgoParameter()

Completed in 11 milliseconds