RNG Non-cryptographic
This module includes functions that generates non cryptographic random numbers.
Functions |
|
| uint32_t | otRandomNonCryptoGetUint32 (void) |
This function generates and returns a random
uint32_t
value.
|
|
| uint8_t | otRandomNonCryptoGetUint8 (void) |
|
This function generates and returns a random byte.
|
|
| uint16_t | otRandomNonCryptoGetUint16 (void) |
This function generates and returns a random
uint16_t
value.
|
|
| uint8_t | otRandomNonCryptoGetUint8InRange (uint8_t aMin, uint8_t aMax) |
This function generates and returns a random
uint8_t
value within a given range
[aMin, aMax)
.
|
|
| uint16_t | otRandomNonCryptoGetUint16InRange (uint16_t aMin, uint16_t aMax) |
This function generates and returns a random
uint16_t
value within a given range
[aMin, aMax)
.
|
|
| uint32_t | otRandomNonCryptoGetUint32InRange (uint32_t aMin, uint32_t aMax) |
This function generates and returns a random
uint32_t
value within a given range
[aMin, aMax)
.
|
|
| void | otRandomNonCryptoFillBuffer (uint8_t *aBuffer, uint16_t aSize) |
|
This function fills a given buffer with random bytes.
|
|
| uint32_t | otRandomNonCryptoAddJitter (uint32_t aValue, uint16_t aJitter) |
|
This function adds a random jitter within a given range to a given value.
|
|
Detailed Description
This module includes functions that generates non cryptographic random numbers.
Function Documentation
◆ otRandomNonCryptoAddJitter()
| uint32_t otRandomNonCryptoAddJitter | ( | uint32_t |
aValue,
|
| uint16_t |
aJitter
|
||
| ) |
This function adds a random jitter within a given range to a given value.
- Parameters
-
[in] aValueA value to which the random jitter is added. [in] aJitterMaximum jitter. Random jitter is selected from the range [-aJitter, aJitter].
- Returns
- The given value with an added random jitter.
◆ otRandomNonCryptoFillBuffer()
| void otRandomNonCryptoFillBuffer | ( | uint8_t * |
aBuffer,
|
| uint16_t |
aSize
|
||
| ) |
This function fills a given buffer with random bytes.
- Parameters
-
[out] aBufferA pointer to a buffer to fill with the random bytes. [in] aSizeSize of buffer (number of bytes to fill).
◆ otRandomNonCryptoGetUint16()
| uint16_t otRandomNonCryptoGetUint16 | ( | void |
|
) |
This function generates and returns a random
uint16_t
value.
- Returns
-
A random
uint16_tvalue.
◆ otRandomNonCryptoGetUint16InRange()
| uint16_t otRandomNonCryptoGetUint16InRange | ( | uint16_t |
aMin,
|
| uint16_t |
aMax
|
||
| ) |
This function generates and returns a random
uint16_t
value within a given range
[aMin, aMax)
.
- Note
-
The returned random value can include the
aMinvalue but excludes theaMax.
- Parameters
-
[in] aMinA minimum value (this value can be included in returned random result). [in] aMaxA maximum value (this value is excluded from returned random result).
- Returns
-
A random
uint16_tvalue in the given range (i.e., aMin <= random value < aMax).
◆ otRandomNonCryptoGetUint32()
| uint32_t otRandomNonCryptoGetUint32 | ( | void |
|
) |
This function generates and returns a random
uint32_t
value.
- Returns
-
A random
uint32_tvalue.
◆ otRandomNonCryptoGetUint32InRange()
| uint32_t otRandomNonCryptoGetUint32InRange | ( | uint32_t |
aMin,
|
| uint32_t |
aMax
|
||
| ) |
This function generates and returns a random
uint32_t
value within a given range
[aMin, aMax)
.
- Note
-
The returned random value can include the
aMinvalue but excludes theaMax.
- Parameters
-
[in] aMinA minimum value (this value can be included in returned random result). [in] aMaxA maximum value (this value is excluded from returned random result).
- Returns
-
A random
uint32_tvalue in the given range (i.e., aMin <= random value < aMax).
◆ otRandomNonCryptoGetUint8()
| uint8_t otRandomNonCryptoGetUint8 | ( | void |
|
) |
This function generates and returns a random byte.
- Returns
-
A random
uint8_tvalue.
◆ otRandomNonCryptoGetUint8InRange()
| uint8_t otRandomNonCryptoGetUint8InRange | ( | uint8_t |
aMin,
|
| uint8_t |
aMax
|
||
| ) |
This function generates and returns a random
uint8_t
value within a given range
[aMin, aMax)
.
- Parameters
-
[in] aMinA minimum value (this value can be included in returned random result). [in] aMaxA maximum value (this value is excluded from returned random result).
- Returns
-
A random
uint8_tvalue in the given range (i.e., aMin <= random value < aMax).