Home
last modified time | relevance | path

Searched refs:hash (Results 1 – 25 of 84) sorted by relevance

1234

/base/hiviewdfx/hiview/utility/common_utils/
Dcalc_fingerprint.cpp26 int CalcFingerprint::ConvertToString(const unsigned char hash[SHA256_DIGEST_LENGTH], char *outstr, … in ConvertToString()
31 if (hash == nullptr || outHash == nullptr) { in ConvertToString()
39 int err = snprintf_s(outHash, charsEachHex + 1, charsEachHex, "%02x", hash[i]); in ConvertToString()
59 int CalcFingerprint::CalcFileSha(const string& filePath, char *hash, size_t len) in CalcFileSha() argument
61 if (filePath.empty() || hash == nullptr || !FileUtil::IsLegalPath(filePath)) { in CalcFileSha()
83 return ConvertToString(value, hash, len); in CalcFileSha()
96 int CalcFingerprint::CalcBufferSha(const string& buffer, size_t bufSize, char *hash, size_t len) in CalcBufferSha() argument
98 if (buffer.empty() || hash == nullptr) { in CalcBufferSha()
103 return ConvertToString(value, hash, len); in CalcBufferSha()
Dtbox.cpp45 char hash[HAS_LEN] = {'0'}; in CalcFingerPrint() local
49 err = CalcFingerprint::CalcFileSha(val, hash, sizeof(hash)); in CalcFingerPrint()
52 err = CalcFingerprint::CalcBufferSha(val, val.size(), hash, sizeof(hash)); in CalcFingerPrint()
62 return string(hash); in CalcFingerPrint()
/base/hiviewdfx/hilog_lite/interfaces/native/kits/hilog_lite/
Dhiview_log.h413 void HILOG_HashPrintf(uint8 module, uint8 level, const char *nums, uint32 hash, ...);
424 #define HILOG_DEBUG_HASH(mod, hash, ...) \ argument
425 HILOG_HashPrintf(mod, HILOG_LV_DEBUG, FUN_ARG_NUM(__VA_ARGS__), hash, ##__VA_ARGS__)
427 #define HILOG_DEBUG_HASH(mod, hash, ...) argument
439 #define HILOG_INFO_HASH(mod, hash, ...) \ argument
440 HILOG_HashPrintf(mod, HILOG_LV_INFO, FUN_ARG_NUM(__VA_ARGS__), hash, ##__VA_ARGS__)
442 #define HILOG_INFO_HASH(mod, hash, ...) argument
454 #define HILOG_WARN_HASH(mod, hash, ...) \ argument
455 HILOG_HashPrintf(mod, HILOG_LV_WARN, FUN_ARG_NUM(__VA_ARGS__), hash, ##__VA_ARGS__)
457 #define HILOG_WARN_HASH(mod, hash, ...) argument
[all …]
/base/security/huks/frameworks/huks_standard/main/crypto_engine/openssl/src/
Dhks_openssl_hash.c66 static int32_t HashCheckParam(uint32_t alg, const struct HksBlob *msg, struct HksBlob *hash) in HashCheckParam() argument
70 …HKS_IF_NOT_SUCC_LOGE_RETURN(HksOpensslCheckBlob(hash), HKS_ERROR_INVALID_ARGUMENT, "Invalid param … in HashCheckParam()
76 int32_t HksOpensslHash(uint32_t alg, const struct HksBlob *msg, struct HksBlob *hash) in HksOpensslHash() argument
78 int32_t ret = HashCheckParam(alg, msg, hash); in HksOpensslHash()
84 ret = EVP_Digest(msg->data, msg->size, hash->data, &hash->size, opensslAlg, NULL); in HksOpensslHash()
134 int32_t HksOpensslHashFinal(void **cryptoCtx, const struct HksBlob *msg, struct HksBlob *hash) in HksOpensslHashFinal() argument
147 if (HksOpensslCheckBlob(hash) != HKS_SUCCESS) { in HksOpensslHashFinal()
165 ret = EVP_DigestFinal_ex((EVP_MD_CTX *)*cryptoCtx, hash->data, &hash->size); in HksOpensslHashFinal()
/base/update/updater/services/package/pkg_verify/
Dpkg_verify_util.cpp50 std::vector<uint8_t> hash; in VerifyPackageSign() local
51 int32_t ret = Pkcs7verify(signature, hash); in VerifyPackageSign()
58 return HashCheck(pkgStream, srcDataLen, hash); in VerifyPackageSign()
97 int32_t PkgVerifyUtil::Pkcs7verify(std::vector<uint8_t> &signature, std::vector<uint8_t> &hash) con… in Pkcs7verify()
101 return pkcs7.GetHashFromSignBlock(signature.data(), signature.size(), hash); in Pkcs7verify()
105 const std::vector<uint8_t> &hash) const in HashCheck()
111 size_t digestLen = hash.size(); in HashCheck()
123 if (memcmp(hash.data(), sourceDigest.data(), digestLen) != EOK) { in HashCheck()
Dpkg_verify_util.h43 int32_t Pkcs7verify(std::vector<uint8_t> &signature, std::vector<uint8_t> &hash) const;
46 const std::vector<uint8_t> &hash) const;
/base/security/certificate_manager/services/cert_manager_standard/cert_manager_engine/main/core/src/
Dcert_manager_crypto_operation.c60 int32_t CmGetHash(const struct CmBlob *inData, struct CmBlob *hash) in CmGetHash() argument
85 if (hash->size < outBlob.len) { in CmGetHash()
86 CM_LOG_E("hash input size[%u] too small", hash->size); in CmGetHash()
90 if (memcpy_s(hash->data, hash->size, outBlob.data, outBlob.len) != EOK) { in CmGetHash()
94 hash->size = outBlob.len; in CmGetHash()
/base/security/huks/frameworks/huks_standard/main/crypto_engine/mbedtls/src/
Dhks_mbedtls_hash.c97 …MbedtlsHashMd5Final(struct HksMbedtlsHashCtx *ctx, const struct HksBlob *msg, struct HksBlob *hash) in HksMbedtlsHashMd5Final() argument
114 ret = mbedtls_md5_finish_ret(context, hash->data); in HksMbedtlsHashMd5Final()
184 …bedtlsHashSha1Final(struct HksMbedtlsHashCtx *ctx, const struct HksBlob *msg, struct HksBlob *hash) in HksMbedtlsHashSha1Final() argument
191 if (hash->data == NULL) { in HksMbedtlsHashSha1Final()
206 ret = mbedtls_sha1_finish_ret(context, hash->data); in HksMbedtlsHashSha1Final()
281 struct HksBlob *hash) in HksMbedtlsHashSha256Final() argument
288 if (hash->data == NULL) { in HksMbedtlsHashSha256Final()
303 ret = mbedtls_sha256_finish_ret(context, hash->data); in HksMbedtlsHashSha256Final()
380 struct HksBlob *hash) in HksMbedtlsHashSha512Final() argument
387 if (hash->data == NULL) { in HksMbedtlsHashSha512Final()
[all …]
/base/update/ota_lite/frameworks/source/verify/
Dhota_verify.c74 static int32 HotaCalcImageHash(uint8 *dataAddr, uint32 dataLen, uint8 *hash, uint32 hashLen) in HotaCalcImageHash() argument
79 if ((dataAddr == NULL) || (hash == NULL) || (dataLen == 0) || (hashLen < HASH_LENGTH)) { in HotaCalcImageHash()
85 if (memset_s(hash, hashLen, 0, hashLen) != EOK) { in HotaCalcImageHash()
98 AppSha256Finish(&sha256, hash); in HotaCalcImageHash()
103 static int32 HotaSignVerifyByHash(const uint8 *hash, uint32 hashLen, const uint8 *imageSign, uint32… in HotaSignVerifyByHash() argument
107 if ((hash == NULL) || (imageSign == NULL)) { in HotaSignVerifyByHash()
122 ret = AppVerifyData(&rsa, hash, hashLen, imageSign, signLen); in HotaSignVerifyByHash()
/base/hiviewdfx/hiview/utility/common_utils/include/
Dcalc_fingerprint.h37 static int CalcFileSha(const std::string& filePath, char *hash, size_t len);
46 static int CalcBufferSha(const std::string& buffer, size_t bufSize, char *hash, size_t len);
49 …static int ConvertToString(const unsigned char hash[SHA256_DIGEST_LENGTH], char *outstr, size_t le…
/base/security/device_auth/deps_adapter/key_management_adapter/impl/src/standard/
Dcrypto_hash_to_point.c111 static int32_t CurveHashToPointCalcB(const struct HksBlob *hash, in CurveHashToPointCalcB() argument
117 if (BN_bin2bn(hash->data, hash->size, swap) == NULL) { in CurveHashToPointCalcB()
267 static int32_t CurveHashToPoint(const struct HksBlob *hash, struct HksBlob *point) in CurveHashToPoint() argument
269 if ((hash == NULL) || (hash->data == NULL) || in CurveHashToPoint()
270 (hash->size != KEY_BYTES_CURVE25519)) { in CurveHashToPoint()
295 ret = CurveHashToPointCalcB(hash, &curvePara, b, ctx); in CurveHashToPoint()
348 int32_t OpensslHashToPoint(const struct HksBlob *hash, struct HksBlob *point) in OpensslHashToPoint() argument
351 uint8_t *copyData = HcMalloc(hash->size, 0); in OpensslHashToPoint()
353 LOGE("malloc size %u failed", hash->size); in OpensslHashToPoint()
356 struct HksBlob hashCopy = { hash->size, copyData}; in OpensslHashToPoint()
[all …]
/base/security/huks/test/unittest/huks_lite_test/liteos_m_adapter/
Dhks_hash_test.c84 struct HksBlob *hash = NULL; in LITE_TEST_CASE() local
98 ret = TestConstructBlobOut(&hash, in LITE_TEST_CASE()
105 ret = HksHashRun(paramSet, srcData, hash, 1); in LITE_TEST_CASE()
113 TestFreeBlob(&hash); in LITE_TEST_CASE()
/base/security/huks/test/unittest/huks_standard_test/interface_inner_test/sdk_test/src/
Dhks_hash_test.cpp77 struct HksBlob *hash = NULL; variable
91 ret = TestConstructBlobOut(&hash,
98 ret = HksHashRun(paramSet, srcData, hash, 1);
106 TestFreeBlob(&hash);
Dhks_test_api_performance.c192 const struct HksBlob *srcData, struct HksBlob *hash, uint32_t performTimes) in HksHashRun() argument
196 if (hash != NULL) { in HksHashRun()
197 oriHashSize = hash->size; in HksHashRun()
201 if (hash != NULL) { in HksHashRun()
202 (void)memset_s(hash->data, oriHashSize, 0, oriHashSize); in HksHashRun()
203 hash->size = oriHashSize; in HksHashRun()
206 ret = HksHash(paramSet, srcData, hash); in HksHashRun()
/base/security/huks/test/unittest/huks_lite_test/liteos_a_adapter/
Dhks_hash_test.cpp80 struct HksBlob *hash = NULL; variable
94 ret = TestConstructBlobOut(&hash,
101 ret = HksHashRun(paramSet, srcData, hash, 1);
109 TestFreeBlob(&hash);
/base/hiviewdfx/hiview/plugins/faultlogger/service/sanitizer_collector/
Dasan_collector.h39 …virtual void ProcessStackTrace(const std::string& asanDump, bool printDiagnostics, unsigned *hash);
40 int UpdateCollectedData(const std::string& hash, const std::string& rfile);
41 bool IsDuplicate(const std::string& hash);
Dsanitizerd_collector.cpp53 bool SanitizerdCollector::IsDuplicate(const std::string hash) const in IsDuplicate()
55 auto backIter = stacks_.find(hash); in IsDuplicate()
Dsanitizerd_collector.h43 int UpdateCollectedData(std::string hash, std::string rfile);
44 bool IsDuplicate(const std::string hash) const;
/base/startup/hvb/
DREADME_zh.md29 - 整包校验(hash
31 整包校验适用于一次性加载的镜像,这种镜像只需要生成一个hash值即可,加载镜像时对整个镜像进行hash计算,与编译时的hash值进行对比确保完整性。
37 按需校验适用于大的文件系统镜像包,由内核在访问存储块时进行完整性校验。由于是按存储块进行hash值计算的,因此需要在编译时构造哈希树(hashtree)加快校验速度。此方案可以不用在开机时对整个进行…
52 | hash_info | hash_info存放镜像的完整性信息,根据镜像校验类型可以是hash或hashtree信息。 |
/base/security/huks/frameworks/huks_standard/main/crypto_engine/openssl/include/
Dhks_openssl_hash.h27 int32_t HksOpensslHash(uint32_t alg, const struct HksBlob *msg, struct HksBlob *hash);
33 int32_t HksOpensslHashFinal(void **cryptoCtx, const struct HksBlob *msg, struct HksBlob *hash);
/base/hiviewdfx/hiview/utility/common_utils/test/unittest/common/
Dutility_common_utils_test.cpp76 char hash[SHA256_DIGEST_LENGTH] = {0}; variable
77 auto ret = calcFingerprint.CalcFileSha("", hash, SHA256_DIGEST_LENGTH);
79 …ret = calcFingerprint.CalcFileSha(GenerateLogFileName(caseName, SUFFIX_0), hash, SHA256_DIGEST_LEN…
81 ret = calcFingerprint.CalcFileSha("//....../asdsa", hash, SHA256_DIGEST_LENGTH);
87 ret = calcFingerprint.CalcFileSha(GenerateLogFileName(caseName, SUFFIX_0), hash, invalidLen);
101 char hash[SHA256_DIGEST_LENGTH] = {0}; variable
103 auto ret = calcFingerprint.CalcBufferSha(buffer1, buffer1.size(), hash, SHA256_DIGEST_LENGTH);
/base/security/huks/frameworks/huks_standard/main/crypto_engine/mbedtls/include/
Dhks_mbedtls_hash.h31 int32_t HksMbedtlsHash(uint32_t alg, const struct HksBlob *msg, struct HksBlob *hash);
37 int32_t HksMbedtlsHashFinal(void **cryptoCtx, const struct HksBlob *msg, struct HksBlob *hash);
/base/security/huks/test/unittest/huks_lite_test/common/
Dhks_test_api_performance.c185 const struct HksBlob *srcData, struct HksBlob *hash, uint32_t performTimes) in HksHashRun() argument
188 if (hash != NULL) { in HksHashRun()
189 oriHashSize = hash->size; in HksHashRun()
193 if (hash != NULL) { in HksHashRun()
194 (void)memset_s(hash->data, oriHashSize, 0, oriHashSize); in HksHashRun()
195 hash->size = oriHashSize; in HksHashRun()
198 int32_t ret = HksHash(paramSet, srcData, hash); in HksHashRun()
/base/security/device_auth/deps_adapter/key_management_adapter/impl/src/small/
Dmbedtls_ec_adapter.c149 static int32_t CalTmpParab(mbedtls_mpi *tmpX, const mbedtls_mpi *modP, const uint8_t *hash, uint32_… in CalTmpParab() argument
170 status = mbedtls_mpi_read_binary(&tmpBnA, hash, hashLen); in CalTmpParab()
204 static int32_t Elligator(unsigned char *point, int pointLength, const unsigned char *hash, int hash… in Elligator() argument
229 status = CalTmpParab(&tmpBnB, &paraBnP, hash, hashLength); in Elligator()
262 int32_t MbedtlsHashToPoint(const Uint8Buff *hash, Uint8Buff *outEcPoint) in MbedtlsHashToPoint() argument
264 if (IsInvalidBlob(hash) || IsInvalidBlob(outEcPoint)) { in MbedtlsHashToPoint()
267 if (hash->length != BYTE_LENGTH_CURVE_25519 || outEcPoint->length != BYTE_LENGTH_CURVE_25519) { in MbedtlsHashToPoint()
272 (void)memcpy_s(hashTmp, BYTE_LENGTH_CURVE_25519, hash->val, BYTE_LENGTH_CURVE_25519); in MbedtlsHashToPoint()
/base/security/huks/test/fuzz_test/hkshash_fuzzer/
Dhkshash_fuzzer.cpp42 struct HksBlob hash = { BLOB_SIZE, static_cast<uint8_t *>(myData + BLOB_SIZE) }; in DoSomethingInterestingWithMyAPI() local
47 (void)HksHash(paramSet, &srcData, &hash); in DoSomethingInterestingWithMyAPI()

1234