mirror of
https://github.com/espressif/openthread.git
synced 2026-08-03 01:17:46 +00:00
[random] add Fill<ObjectType>() function (#9097)
This commit adds template `Fill<ObjectType>(ObjectType &aObject)` functions for both `Crypto` and `NonCrypto` random number generation modules. These functions fill a given object with random byes.
This commit is contained in:
@@ -891,7 +891,7 @@ uint32_t GetRandom(uint32_t max)
|
||||
|
||||
if (kUseTrueRandomNumberGenerator)
|
||||
{
|
||||
SuccessOrQuit(Random::Crypto::FillBuffer(reinterpret_cast<uint8_t *>(&value), sizeof(value)));
|
||||
SuccessOrQuit(Random::Crypto::Fill(value));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user