This module includes functions that generates cryptographic random numbers.
More...
This module includes functions that generates cryptographic random numbers.
This module includes functions that generates non cryptographic random numbers.
otError otRandomCryptoFillBuffer |
( |
uint8_t * |
aBuffer, |
|
|
uint16_t |
aSize |
|
) |
| |
This function fills a given buffer with cryptographically secure random bytes.
- Parameters
-
[out] | aBuffer | A pointer to a buffer to fill with the random bytes. |
[in] | aSize | Size of buffer (number of bytes to fill). |
mbedtls_ctr_drbg_context* otRandomCryptoMbedTlsContextGet |
( |
void |
| ) |
|
This function returns initialized mbedtls_ctr_drbg_context.
- Returns
- A pointer to initialized mbedtls_ctr_drbg_context.
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] | aValue | A value to which the random jitter is added. |
[in] | aJitter | Maximum jitter. Random jitter is selected from the range [-aJitter, aJitter] . |
- Returns
- The given value with an added random jitter.
void otRandomNonCryptoFillBuffer |
( |
uint8_t * |
aBuffer, |
|
|
uint16_t |
aSize |
|
) |
| |
This function fills a given buffer with random bytes.
- Parameters
-
[out] | aBuffer | A pointer to a buffer to fill with the random bytes. |
[in] | aSize | Size of buffer (number of bytes to fill). |
uint16_t otRandomNonCryptoGetUint16 |
( |
void |
| ) |
|
This function generates and returns a random uint16_t
value.
- Returns
- A random
uint16_t
value.
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
aMin
value but excludes the aMax
.
- Parameters
-
[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
uint16_t
value in the given range (i.e., aMin <= random value < aMax).
uint32_t otRandomNonCryptoGetUint32 |
( |
void |
| ) |
|
This function generates and returns a random uint32_t
value.
- Returns
- A random
uint32_t
value.
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
aMin
value but excludes the aMax
.
- Parameters
-
[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
uint32_t
value in the given range (i.e., aMin <= random value < aMax).
uint8_t otRandomNonCryptoGetUint8 |
( |
void |
| ) |
|
This function generates and returns a random byte.
- Returns
- A random
uint8_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)
.
- Parameters
-
[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).