/base/hiviewdfx/hiview/utility/common_utils/ |
H A D | calc_fingerprint.cpp | 26 int CalcFingerprint::ConvertToString(const unsigned char hash[SHA256_DIGEST_LENGTH], char *outstr, size_t len) in ConvertToString() argument 31 if (hash == nullptr || outHash == nullptr) { in ConvertToString() 39 int err = snprintf_s(outHash, charsEachHex + 1, charsEachHex, "%02x", hash[i]); in ConvertToString() 51 * Description : calculate a file sha1 hash for given file 54 * hash : buffer to store output sha1 string 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() 71 return ConvertToString(value, hash, len); in CalcFileSha() 74 int CalcFingerprint::CalcFileShaOriginal(const string& filePath, unsigned char *hash, size_t len) in CalcFileShaOriginal() argument 76 if (filePath.empty() || hash in CalcFileShaOriginal() 118 CalcBufferSha(const string& buffer, size_t bufSize, char *hash, size_t len) CalcBufferSha() argument 138 CalcBufferSha(unsigned char* source, size_t sourceLen, char *hash, size_t hashLen) CalcBufferSha() argument [all...] |
H A D | tbox.cpp | 46 char hash[HAS_LEN] = {'0'}; in CalcFingerPrint() local 50 err = CalcFingerprint::CalcFileSha(val, hash, sizeof(hash)); in CalcFingerPrint() 53 err = CalcFingerprint::CalcBufferSha(val, val.size(), hash, sizeof(hash)); in CalcFingerPrint() 63 return string(hash); in CalcFingerPrint()
|
/base/hiviewdfx/hiview/utility/common_utils/include/ |
H A D | calc_fingerprint.h | 31 * CalcFileSha: calculate a file sha1 hash for given file 34 * The caller can pass a char hash_str[41] to get the hash string 37 static int CalcFileSha(const std::string& filePath, char *hash, size_t len); 40 * CalcFileSha: calculate a file sha1 hash for given file 43 * The caller can pass a char hash[41] to get the hash 46 static int CalcFileShaOriginal(const std::string& filePath, unsigned char *hash, size_t len); 49 * CalcBufferSha: calculate a buffer sha1 hash for given buffer 52 * The caller can pass a char hash_str[41] to get the hash string 55 static int CalcBufferSha(const std::string& buffer, size_t bufSize, char *hash, size_ [all...] |
/base/hiviewdfx/hilog_lite/interfaces/native/kits/hilog_lite/ |
H A D | hiview_log.h | 408 * Interface for printing hash logs. 412 * @param hash Hash of printing string. 413 * @attention Never use this interface directly, only for hash tools. 415 void HILOG_HashPrintf(uint8 module, uint8 level, const char *nums, uint32 hash, ...); 418 * Interface for printing debug hash logs. 422 * @param hash Hash of printing string. 423 * @attention Never use this interface directly, only for hash tools. 426 #define HILOG_DEBUG_HASH(mod, hash, ...) \ 427 HILOG_HashPrintf(mod, HILOG_LV_DEBUG, FUN_ARG_NUM(__VA_ARGS__), hash, ##__VA_ARGS__) 429 #define HILOG_DEBUG_HASH(mod, hash, [all...] |
/base/security/huks/frameworks/huks_standard/main/crypto_engine/openssl/src/ |
H A D | hks_openssl_hash.c | 66 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 hash!")
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() 148 HKS_LOG_E("Invalid param hash!");
in HksOpensslHashFinal() [all...] |
/base/update/updater/services/package/pkg_verify/ |
H A D | pkg_verify_util.cpp | 80 std::vector<uint8_t> hash; in VerifySign() local 81 int32_t ret = Pkcs7verify(signData, hash); in VerifySign() 87 size_t hashLen = hash.size(); in VerifySign() 88 if ((hashLen != digest.size()) || memcmp(hash.data(), digest.data(), hashLen) != EOK) { in VerifySign() 111 std::vector<uint8_t> hash; in VerifyPackageSign() local 112 int32_t ret = Pkcs7verify(signature, hash); in VerifyPackageSign() 120 ret = HashCheck(pkgStream, srcDataLen, hash); in VerifyPackageSign() 123 ret = HashCheck(pkgStream, srcDataLen, hash); in VerifyPackageSign() 179 int32_t PkgVerifyUtil::Pkcs7verify(std::vector<uint8_t> &signature, std::vector<uint8_t> &hash) const in Pkcs7verify() 183 return pkcs7.GetHashFromSignBlock(signature.data(), signature.size(), hash); in Pkcs7verify() [all...] |
H A D | pkcs7_signed_data.h | 71 std::vector<uint8_t> &hash); 77 int32_t Verify(const std::vector<uint8_t> &hash, const std::vector<uint8_t> &sig, bool sigInSignerInfo) const; 95 int32_t Pkcs7SignleSignerVerify(const Pkcs7SignerInfo &signerInfo, const std::vector<uint8_t> &hash, 97 int32_t VerifyDigest(X509 *cert, const Pkcs7SignerInfo &signer, const std::vector<uint8_t> &hash,
|
/base/security/huks/frameworks/huks_standard/main/crypto_engine/mbedtls/src/ |
H A D | hks_mbedtls_hash.c | 97 static int32_t HksMbedtlsHashMd5Final(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 static int32_t HksMbedtlsHashSha1Final(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() 288 if (hash->data == NULL) {
in HksMbedtlsHashSha256Final() 303 ret = mbedtls_sha256_finish_ret(context, hash->data);
in HksMbedtlsHashSha256Final() 380 struct HksBlob *hash)
in HksMbedtlsHashSha512Final() 387 if (hash in HksMbedtlsHashSha512Final() 280 HksMbedtlsHashSha256Final(struct HksMbedtlsHashCtx *ctx, const struct HksBlob *msg, struct HksBlob *hash) HksMbedtlsHashSha256Final() argument 379 HksMbedtlsHashSha512Final(struct HksMbedtlsHashCtx *ctx, const struct HksBlob *msg, struct HksBlob *hash) HksMbedtlsHashSha512Final() argument 526 HksMbedtlsHashFinal(void **cryptoCtx, const struct HksBlob *msg, struct HksBlob *hash) HksMbedtlsHashFinal() argument 603 HksMbedtlsHash(uint32_t alg, const struct HksBlob *msg, struct HksBlob *hash) HksMbedtlsHash() argument [all...] |
/base/update/sys_installer_lite/frameworks/source/verify/ |
H A D | hota_verify.c | 26 static AppSha256Context g_sha256 = { 0 }; /* hash tmp var */
31 // Init the hash value of data
in HotaHashInit() 62 // Calc the last hash, and save it
in HotaGetHash() 74 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() 86 printf("HotaCalcImageHash memset_s hash failed.\r\n");
in HotaCalcImageHash() 97 // Calc Final hash
in HotaCalcImageHash() 98 AppSha256Finish(&sha256, hash);
in HotaCalcImageHash() 103 static int32 HotaSignVerifyByHash(const uint8 *hash, uint3 argument [all...] |
/base/security/device_auth/deps_adapter/key_management_adapter/impl/src/standard/ |
H A D | huks_adapter_diff_impl.c | 34 int32_t HashToPointX25519(const Uint8Buff *hash, Uint8Buff *outEcPoint) in HashToPointX25519() argument 36 struct HksBlob hashBlob = { hash->length, hash->val }; in HashToPointX25519()
|
/base/security/huks/test/unittest/huks_standard_test/crypto_engine_test/src/ |
H A D | hks_crypto_hal_sm3_cipher.cpp | 97 struct HksBlob hash = { 19, hashData }; in HWTEST_F() local 98 RunTestCase(&message, &hash); in HWTEST_F() 119 struct HksBlob hash = { 32, hashData }; in HWTEST_F() local 120 RunTestCase(&message, &hash); in HWTEST_F() 141 struct HksBlob hash = { 46, hashData }; in HWTEST_F() local 142 RunTestCase(&message, &hash); in HWTEST_F()
|
/base/security/huks/test/unittest/huks_lite_test/liteos_m_adapter/ |
H A D | hks_hash_test.c | 84 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/ |
H A D | hks_hash_test.cpp | 78 struct HksBlob *hash = NULL; in HWTEST_F() local 92 ret = TestConstructBlobOut(&hash, in HWTEST_F() 99 ret = HksHashRun(paramSet, srcData, hash, 1); in HWTEST_F() 107 TestFreeBlob(&hash); in HWTEST_F()
|
H A D | hks_test_api_performance.c | 193 const struct HksBlob *srcData, struct HksBlob *hash, uint32_t performTimes) in HksHashRun() 197 if (hash != NULL) { in HksHashRun() 198 oriHashSize = hash->size; in HksHashRun() 202 if (hash != NULL) { in HksHashRun() 203 (void)memset_s(hash->data, oriHashSize, 0, oriHashSize); in HksHashRun() 204 hash->size = oriHashSize; in HksHashRun() 207 ret = HksHash(paramSet, srcData, hash); in HksHashRun() 192 HksHashRun(const struct HksParamSet *paramSet, const struct HksBlob *srcData, struct HksBlob *hash, uint32_t performTimes) HksHashRun() argument
|
/base/security/huks/test/unittest/huks_lite_test/liteos_a_adapter/ |
H A D | hks_hash_test.cpp | 80 struct HksBlob *hash = NULL; in HWTEST_F() local 93 ret = TestConstructBlobOut(&hash, in HWTEST_F() 99 ret = HksHashRun(paramSet, srcData, hash, 1); in HWTEST_F() 107 TestFreeBlob(&hash); in HWTEST_F()
|
/base/security/device_auth/deps_adapter/key_management_adapter/impl/src/small/ |
H A D | huks_adapter_diff_impl.c | 34 int32_t HashToPointX25519(const Uint8Buff *hash, Uint8Buff *outEcPoint) in HashToPointX25519() argument 36 int32_t res = MbedtlsHashToPoint25519(hash, outEcPoint); in HashToPointX25519()
|
/base/security/huks/frameworks/huks_standard/main/crypto_engine/mbedtls/include/ |
H A D | hks_mbedtls_hash.h | 31 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/frameworks/huks_standard/main/crypto_engine/openssl/include/ |
H A D | hks_openssl_hash.h | 27 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/security/certificate_manager/services/cert_manager_standard/cert_manager_engine/main/core/src/ |
H A D | cert_manager_crypto_operation.c | 103 int32_t CmGetHash(const struct CmBlob *inData, struct CmBlob *hash) in CmGetHash() argument 105 if ((CmCheckBlob(inData) != CM_SUCCESS) || (CmCheckBlob(hash) != CM_SUCCESS) || in CmGetHash() 106 (hash->size < DIGEST_SHA256_LEN)) { in CmGetHash() 117 int32_t ret = EVP_Digest(inData->data, inData->size, hash->data, &hash->size, opensslAlg, NULL); in CmGetHash()
|
/base/security/huks/test/unittest/huks_lite_test/common/ |
H A D | hks_test_api_performance.c | 186 const struct HksBlob *srcData, struct HksBlob *hash, uint32_t performTimes) in HksHashRun() 189 if (hash != NULL) { in HksHashRun() 190 oriHashSize = hash->size; in HksHashRun() 194 if (hash != NULL) { in HksHashRun() 195 (void)memset_s(hash->data, oriHashSize, 0, oriHashSize); in HksHashRun() 196 hash->size = oriHashSize; in HksHashRun() 199 int32_t ret = HksHash(paramSet, srcData, hash); in HksHashRun() 185 HksHashRun(const struct HksParamSet *paramSet, const struct HksBlob *srcData, struct HksBlob *hash, uint32_t performTimes) HksHashRun() argument
|
/base/security/device_auth/deps_adapter/key_management_adapter/impl/inc/ |
H A D | mbedtls_ec_adapter.h | 30 int32_t MbedtlsHashToPoint(const Uint8Buff *hash, Uint8Buff *outEcPoint);
31 int32_t MbedtlsHashToPoint25519(const Uint8Buff *hash, Uint8Buff *outEcPoint);
|
/base/security/device_auth/deps_adapter/key_management_adapter/impl/src/mini/ |
H A D | huks_adapter_diff_impl.c | 61 int32_t HashToPointX25519(const Uint8Buff *hash, Uint8Buff *outEcPoint) in HashToPointX25519() argument 63 int32_t res = MbedtlsHashToPoint25519(hash, outEcPoint); in HashToPointX25519()
|
/base/hiviewdfx/hichecker/interfaces/js/kits/napi/js_leak_watcher/ |
H A D | js_leak_watcher.js | 45 const registry = new FinalizationRegistry((hash) => { 46 gcObjList.push(hash); 127 hash: util.getHash(obj), 131 watchObjMap.set(objMsg.hash, objMsg); 132 registry.register(obj, objMsg.hash);
|
/base/startup/init/services/modules/udid/ |
H A D | udid_adp.c | 35 unsigned char hash[HASH_LENGTH] = { 0 }; in GetSha256Value() local 41 mbedtls_sha256_finish(&context, hash); in GetSha256Value() 44 unsigned char value = hash[i]; in GetSha256Value()
|
/base/security/huks/test/fuzz_test/innerapi_fuzzer/hkshash_fuzzer/ |
H A D | hkshash_fuzzer.cpp | 43 struct HksBlob hash = { hashBuf.size(), hashBuf.data() }; in DoSomethingInterestingWithMyAPI() local 46 [[maybe_unused]] int ret = HksHash(ps.s, &srcData, &hash); in DoSomethingInterestingWithMyAPI()
|