RNG Non-cryptographic#
This module includes functions that generates non cryptographic random numbers.
Functions#
Generates and returns a random uint32_t
value.
Generates and returns a random byte.
Generates and returns a random uint16_t
value.
Generates and returns a random uint8_t
value within a given range [aMin, aMax)
.
Generates and returns a random uint16_t
value within a given range [aMin, aMax)
.
Generates and returns a random uint32_t
value within a given range [aMin, aMax)
.
Fills a given buffer with random bytes.
Adds a random jitter within a given range to a given value.
Function Documentation#
otRandomNonCryptoGetUint32#
uint32_t otRandomNonCryptoGetUint32 (void )
Generates and returns a random uint32_t
value.
N/A |
Returns
A random
uint32_t
value.
60
of file include/openthread/random_noncrypto.h
otRandomNonCryptoGetUint8#
uint8_t otRandomNonCryptoGetUint8 (void )
Generates and returns a random byte.
N/A |
Returns
A random
uint8_t
value.
68
of file include/openthread/random_noncrypto.h
otRandomNonCryptoGetUint16#
uint16_t otRandomNonCryptoGetUint16 (void )
Generates and returns a random uint16_t
value.
N/A |
Returns
A random
uint16_t
value.
76
of file include/openthread/random_noncrypto.h
otRandomNonCryptoGetUint8InRange#
uint8_t otRandomNonCryptoGetUint8InRange (uint8_t aMin, uint8_t aMax)
Generates and returns a random uint8_t
value within a given range [aMin, aMax)
.
[in] | aMin | A minimum value (this value can be included in returned random result). |
[in] | aMax | A maximum value (this value is excluded from returned random result). |
Returns
A random
uint8_t
value in the given range (i.e., aMin <= random value < aMax).
86
of file include/openthread/random_noncrypto.h
otRandomNonCryptoGetUint16InRange#
uint16_t otRandomNonCryptoGetUint16InRange (uint16_t aMin, uint16_t aMax)
Generates and returns a random uint16_t
value within a given range [aMin, aMax)
.
[in] | aMin | A minimum value (this value can be included in returned random result). |
[in] | aMax | A maximum value (this value is excluded from returned random result). |
Note
The returned random value can include the
aMin
value but excludes theaMax
.
Returns
A random
uint16_t
value in the given range (i.e., aMin <= random value < aMax).
98
of file include/openthread/random_noncrypto.h
otRandomNonCryptoGetUint32InRange#
uint32_t otRandomNonCryptoGetUint32InRange (uint32_t aMin, uint32_t aMax)
Generates and returns a random uint32_t
value within a given range [aMin, aMax)
.
[in] | aMin | A minimum value (this value can be included in returned random result). |
[in] | aMax | A maximum value (this value is excluded from returned random result). |
Note
The returned random value can include the
aMin
value but excludes theaMax
.
Returns
A random
uint32_t
value in the given range (i.e., aMin <= random value < aMax).
111
of file include/openthread/random_noncrypto.h
otRandomNonCryptoFillBuffer#
void otRandomNonCryptoFillBuffer (uint8_t * aBuffer, uint16_t aSize)
Fills a given buffer with random bytes.
[out] | aBuffer | A pointer to a buffer to fill with the random bytes. |
[in] | aSize | Size of buffer (number of bytes to fill). |
120
of file include/openthread/random_noncrypto.h
otRandomNonCryptoAddJitter#
uint32_t otRandomNonCryptoAddJitter (uint32_t aValue, uint16_t aJitter)
Adds a random jitter within a given range to a given value.
[in] | aValue | A value to which the random jitter is added. |
[in] | aJitter | Maximum jitter. Random jitter is selected from the range |
Returns
The given value with an added random jitter.
131
of file include/openthread/random_noncrypto.h