mirror of
https://github.com/espressif/openthread.git
synced 2026-08-26 12:11:17 +00:00
[entropy] allow for entropy source sharing (#3818)
This commit is contained in:
committed by
Jonathan Hui
parent
fc580c39e6
commit
56fa9ac9cd
@@ -31,6 +31,7 @@
|
||||
#include "common/code_utils.hpp"
|
||||
#include "common/instance.hpp"
|
||||
#include "common/message.hpp"
|
||||
#include "common/random.hpp"
|
||||
#include "ncp/ncp_buffer.hpp"
|
||||
|
||||
#include "test_platform.h"
|
||||
@@ -933,11 +934,11 @@ uint32_t GetRandom(uint32_t max)
|
||||
|
||||
if (kUseTrueRandomNumberGenerator)
|
||||
{
|
||||
otPlatRandomGetTrue(reinterpret_cast<uint8_t *>(&value), sizeof(value));
|
||||
Random::Crypto::FillBuffer(reinterpret_cast<uint8_t *>(&value), sizeof(value));
|
||||
}
|
||||
else
|
||||
{
|
||||
value = otPlatRandomGet();
|
||||
value = Random::NonCrypto::GetUint32();
|
||||
}
|
||||
|
||||
return value % max;
|
||||
|
||||
Reference in New Issue
Block a user