Home
last modified time | relevance | path

Searched refs:rand (Results 1 – 25 of 33) sorted by relevance

12

/base/security/device_security_level/services/common/
Ddslm_crypto.c23 void GenerateRandom(RandomValue *rand, uint32_t length) in GenerateRandom() argument
25 if (rand == NULL) { in GenerateRandom()
28 rand->length = (length > RANDOM_MAX_LEN) ? RANDOM_MAX_LEN : length; in GenerateRandom()
30 RAND_bytes(&rand->value[0], rand->length); in GenerateRandom()
32 rand->value[0] = 1; in GenerateRandom()
/base/security/dlp_permission_service/frameworks/common/src/
Drandom_mbedtls.cpp27 unsigned int rand; in GetRandomUint32() local
28 …Mbedtls::GetInstance().GenerateRandomArray(reinterpret_cast<unsigned char *>(&rand), sizeof(rand)); in GetRandomUint32()
32 return rand; in GetRandomUint32()
/base/security/access_token/frameworks/common/src/
Drandom_mbedtls.cpp27 unsigned int rand; in GetRandomUint32() local
28 …Mbedtls::GetInstance().GenerateRandomArray(reinterpret_cast<unsigned char *>(&rand), sizeof(rand)); in GetRandomUint32()
32 return rand; in GetRandomUint32()
/base/security/crypto_framework/frameworks/js/napi/crypto/src/
Dnapi_rand.cpp44 HcfRand *rand = nullptr; member
76 context->rand = nullptr; in FreeCryptoFwkCtx()
111 HcfRand *randObj = context->rand; in GenerateRandomExecute()
172 context->rand = napiRand->GetRand(); in BuildGenerateRandomCtx()
266 HcfRand *rand = napiRand->GetRand(); in JsGenerateRandomSync() local
267 if (rand == nullptr) { in JsGenerateRandomSync()
274 HcfResult res = rand->generateRandom(rand, numBytes, &randBlob); in JsGenerateRandomSync()
308 HcfRand *rand = napiRand->GetRand(); in JsSetSeed() local
309 if (rand == nullptr) { in JsSetSeed()
314 HcfResult res = rand->setSeed(rand, seedBlob); in JsSetSeed()
[all …]
/base/security/device_security_level/services/dslm/
Ddslm_inner_process.c47 RandomValue rand = {0}; in CheckAndGenerateChallenge() local
48 GenerateRandom(&rand, RANDOM_MAX_LEN); in CheckAndGenerateChallenge()
49 device->nonce = *(uint64_t *)&rand.value[0]; in CheckAndGenerateChallenge()
/base/security/device_auth/frameworks/deviceauth_lite/source/key_agreement/
Dpake_server.c240 struct random_value rand = generate_random(esk_len); in generate_pake_params() local
241 if (rand.length == 0) { in generate_pake_params()
245 pake_server->self_esk = *(struct esk *)&rand; in generate_pake_params()
278 struct random_value rand = generate_random(CHALLENGE_BUFF_LENGTH); in get_challenge() local
279 if (rand.length == CHALLENGE_BUFF_LENGTH) { in get_challenge()
281 challenge.length = rand.length; in get_challenge()
282 …(void)memcpy_s(challenge.challenge, sizeof(challenge.challenge), rand.random_value, CHALLENGE_BUFF… in get_challenge()
292 struct random_value rand = generate_random(HC_SALT_BUFF_LEN); in get_salt() local
293 if (rand.length == HC_SALT_BUFF_LEN) { in get_salt()
295 salt.length = rand.length; in get_salt()
[all …]
Dpake_client.c216 struct random_value rand = generate_random(esk_len); in parse_start_response_data() local
217 if (rand.length == 0) { in parse_start_response_data()
223 pake_client->self_esk = *(struct esk *)&rand; in parse_start_response_data()
260 struct random_value rand = generate_random(CHALLENGE_BUFF_LENGTH); in build_end_request_data() local
261 if (rand.length == CHALLENGE_BUFF_LENGTH) { in build_end_request_data()
263 challenge.length = rand.length; in build_end_request_data()
264 if (memcpy_s(challenge.challenge, sizeof(challenge.challenge), rand.random_value, in build_end_request_data()
/base/security/access_token/services/accesstokenmanager/main/cpp/src/token/
Daccesstoken_id_manager.cpp82 unsigned int rand = GetRandomUint32(); in CreateTokenId() local
83 if (rand == 0) { in CreateTokenId()
94 innerId.tokenUniqueID = rand & TOKEN_RANDOM_MASK; in CreateTokenId()
/base/security/device_security_level/services/include/
Ddslm_crypto.h36 void GenerateRandom(RandomValue *rand, uint32_t length);
/base/security/crypto_framework/test/fuzztest/rand/hcfrandcreate_fuzzer/
DBUILD.gn19 module_output_path = "crypto_framework/rand"
25 "//base/security/crypto_framework/test/fuzztest/rand/hcfrandcreate_fuzzer"
/base/security/crypto_framework/frameworks/
Dframeworks.gni32 "${plugin_path}/openssl_plugin/crypto_operation/rand/inc",
50 framework_rand_files = [ "${framework_path}/crypto_operation/rand.c" ]
/base/notification/eventhandler/frameworks/test/moduletest/
Devent_handler_test_common.h36 return static_cast<uint32_t>(std::rand()); in Random()
Devent_handler_press_module_test.cpp35 return static_cast<uint32_t>(std::rand() % remainderNum); in RandomInTen()
/base/security/crypto_framework/
DREADME_zh.md32 │ └── rand # 随机数
DBUILD.gn44 "test/fuzztest/rand/hcfrandcreate_fuzzer:fuzztest",
/base/update/updateservice/services/firmware/common/src/
Dfirmware_update_adapter.cpp62 int32_t randomInt = rand() % RANDOM_BOUND_SIX; /* random len is 6 */ in GetRequestId()
/base/update/updateservice/services/core/ability/utils/include/
Dtime_utils.h55 return minTime + rand() % (maxTime - minTime); in GetRandTime()
Dencrypt_utils.h40 return min + rand() % (max - min); in GetRand()
/base/security/crypto_framework/plugin/
Dplugin.gni28 "${plugin_path}/openssl_plugin/crypto_operation/rand/inc",
72 [ "${plugin_path}/openssl_plugin/crypto_operation/rand/src/rand_openssl.c" ]
/base/security/device_auth/deps_adapter/key_management_adapter/impl/src/mini/
Dhuks_adapter.c145 static int32_t GenerateRandom(Uint8Buff *rand) in GenerateRandom() argument
147 CHECK_PTR_RETURN_HAL_ERROR_CODE(rand, "rand"); in GenerateRandom()
148 CHECK_PTR_RETURN_HAL_ERROR_CODE(rand->val, "rand->val"); in GenerateRandom()
149 CHECK_LEN_ZERO_RETURN_ERROR_CODE(rand->length, "rand->length"); in GenerateRandom()
151 struct HksBlob randBlob = { rand->length, rand->val }; in GenerateRandom()
/base/security/access_token/interfaces/innerkits/nativetoken/src/
Dnativetoken.c282 uint32_t rand; in CreateNativeTokenId() local
288 if (GetRandomTokenId(&rand) != ATRET_SUCCESS) { in CreateNativeTokenId()
291 if (IsTokenUniqueIdExist(rand & (TOKEN_RANDOM_MASK)) == 0) { in CreateNativeTokenId()
302 innerId->tokenUniqueId = rand & (TOKEN_RANDOM_MASK); in CreateNativeTokenId()
/base/security/device_auth/deps_adapter/key_management_adapter/interfaces/
Dalg_defs.h78 typedef int32_t (*GenerateRandomFunc)(Uint8Buff *rand);
/base/security/device_auth/deps_adapter/key_management_adapter/impl/src/small/
Dhuks_adapter.c125 static int32_t GenerateRandom(Uint8Buff *rand) in GenerateRandom() argument
127 CHECK_PTR_RETURN_HAL_ERROR_CODE(rand, "rand"); in GenerateRandom()
128 CHECK_PTR_RETURN_HAL_ERROR_CODE(rand->val, "rand->val"); in GenerateRandom()
129 CHECK_LEN_ZERO_RETURN_ERROR_CODE(rand->length, "rand->length"); in GenerateRandom()
131 struct HksBlob randBlob = { rand->length, rand->val }; in GenerateRandom()
/base/security/device_auth/deps_adapter/key_management_adapter/impl/src/standard/
Dhuks_adapter.c127 static int32_t GenerateRandom(Uint8Buff *rand) in GenerateRandom() argument
129 CHECK_PTR_RETURN_HAL_ERROR_CODE(rand, "rand"); in GenerateRandom()
130 CHECK_PTR_RETURN_HAL_ERROR_CODE(rand->val, "rand->val"); in GenerateRandom()
131 CHECK_LEN_ZERO_RETURN_ERROR_CODE(rand->length, "rand->length"); in GenerateRandom()
133 struct HksBlob randBlob = { rand->length, rand->val }; in GenerateRandom()
/base/hiviewdfx/hiview/plugins/eventlogger/test/unittest/common/
Devent_logger_action_test.cpp254 temp2[i] = rand();

12