[entropy] allow for entropy source sharing (#3818)

This commit is contained in:
Kamil Sroka
2019-05-17 12:41:03 -07:00
committed by Jonathan Hui
parent fc580c39e6
commit 56fa9ac9cd
110 changed files with 1510 additions and 598 deletions
+3 -2
View File
@@ -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;