[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
+2 -11
View File
@@ -408,16 +408,7 @@ int8_t otPlatRadioGetReceiveSensitivity(otInstance *aInstance)
// Random
//
uint32_t otPlatRandomGet(void)
{
#if _WIN32
return (uint32_t)rand();
#else
return (uint32_t)random();
#endif
}
otError otPlatRandomGetTrue(uint8_t *aOutput, uint16_t aOutputLength)
otError otPlatEntropyGet(uint8_t *aOutput, uint16_t aOutputLength)
{
otError error = OT_ERROR_NONE;
@@ -425,7 +416,7 @@ otError otPlatRandomGetTrue(uint8_t *aOutput, uint16_t aOutputLength)
for (uint16_t length = 0; length < aOutputLength; length++)
{
aOutput[length] = (uint8_t)otPlatRandomGet();
aOutput[length] = (uint8_t)rand();
}
exit: