[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:
Abtin Keshavarzian
2023-05-30 13:25:10 -07:00
committed by GitHub
parent b14646b5a8
commit edf539ce27
14 changed files with 57 additions and 18 deletions
+1 -1
View File
@@ -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;