Random

This module includes the platform abstraction for random number generation.

Summary

Functions

otPlatRandomGet(void)
uint32_t
Get a 32-bit random value.
otPlatRandomGetTrue(uint8_t *aOutput, uint16_t aOutputLength)
Get true random value sequence.

Functions

otPlatRandomGet

uint32_t otPlatRandomGet(
  void
)

Get a 32-bit random value.

This function may be implemented using a pseudo-random number generator.

Details
Returns
A 32-bit random value.

otPlatRandomGetTrue

otError otPlatRandomGetTrue(
  uint8_t *aOutput,
  uint16_t aOutputLength
)

Get true random value sequence.

This function MUST be implemented using a true random number generator (TRNG).

Details
Parameters
[out] aOutput
A pointer to where the true random values are placed. Must not be NULL.
[in] aOutputLength
Size of aBuffer.
Return Values
OT_ERROR_NONE
Successfully filled aBuffer with true random values.
OT_ERROR_FAILED
Failed to fill aBuffer with true random values.
OT_ERROR_INVALID_ARGS
aBuffer was set to NULL.