mirror of
https://github.com/espressif/openthread.git
synced 2026-08-17 16:09:51 +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:
@@ -50,7 +50,7 @@ Ip6::InterfaceIdentifier generateRandomIid(uint16_t aIndex)
|
||||
{
|
||||
Ip6::InterfaceIdentifier iid;
|
||||
|
||||
Random::NonCrypto::FillBuffer(iid.mFields.m8, sizeof(iid));
|
||||
Random::NonCrypto::Fill(iid);
|
||||
iid.mFields.m16[3] = aIndex;
|
||||
|
||||
return iid;
|
||||
|
||||
Reference in New Issue
Block a user