The MCUXpresso SDK provides a peripheral driver for the Random Number Generator module of MCUXpresso SDK devices.
The Random Number Generator is a hardware module that generates 32-bit random numbers. A typical consumer is a pseudo random number generator (PRNG) which can be implemented to achieve both true randomness and cryptographic strength random numbers using the RNG output as its entropy seed. The data generated by a RNG is intended for direct use by functions that generate secret keys, per-message secrets, random challenges, and other similar quantities used in cryptographic algorithms.
|
|
static void | RNG_Init (void) |
| | This function initializes random number generator.
|
| |
| static status_t | GenerateSecureRng (uint8_t *pBuffer, uint32_t dwDataLength) |
| | This function generates CHI SQUARE tested random numbers in the passed buffer. More...
|
| |
| static status_t | GenerateRng (uint8_t *pBuffer, uint32_t dwDataLength) |
| | This function generates random numbers buffer. More...
|
| |
| static status_t | GeneratePrng (uint8_t *pBuf, uint32_t dwLen) |
| | This function generates random numbers buffer. More...
|
| |
| static status_t | GenerateSecurePrng (uint8_t *pbiRngBuffer, uint32_t dRNrLength) |
| | This function generates CHI SQUARE tested random numbers in the passed buffer. More...
|
| |
| #define FSL_RNG_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) |
| static status_t GenerateSecureRng |
( |
uint8_t * |
pBuffer, |
|
|
uint32_t |
dwDataLength |
|
) |
| |
|
inlinestatic |
- Parameters
-
| *pBuffer | : Pointer to generated random number data message structure. |
| dwDataLength | : Length of pBuffer in bytes. |
- Return values
-
| kStatus_Success | on successful RNG Generation |
| kStatus_InvalidArgument | error code due to wrong parameter |
- Note
- Value of RNG is 8-bit, but it is placed in 32-bit register.
-
This function will first enable RNG, calculate RNG and then disable RNG.
| static status_t GenerateRng |
( |
uint8_t * |
pBuffer, |
|
|
uint32_t |
dwDataLength |
|
) |
| |
|
inlinestatic |
- Parameters
-
| *pBuffer | : Pointer to generated random number data message structure. |
| dwDataLength | : Length of data message structure in bytes |
- Return values
-
| kStatus_Success | on successful RNG Generation |
| kStatus_InvalidArgument | Parameter error |
- Note
- Once started RNG will be enabled all the time and will continuously generate random numbers.
-
Value of RNG is 8-bit, but it is placed in 32-bit register.
| static status_t GeneratePrng |
( |
uint8_t * |
pBuf, |
|
|
uint32_t |
dwLen |
|
) |
| |
|
inlinestatic |
- Parameters
-
| *pBuf | : Pointer to generated random number data message structure. |
| dwLen | : Length of data message structure in bytes. |
- Return values
-
| kStatus_Success | on successful PRNG Generation |
| kStatus_InvalidArgument | Parameter error |
- Note
- This function is generic and not dependent on any RTOS
-
Once started RNG will be enabled all the time and will continuously generate random numbers
| static status_t GenerateSecurePrng |
( |
uint8_t * |
pbiRngBuffer, |
|
|
uint32_t |
dRNrLength |
|
) |
| |
|
inlinestatic |
- Parameters
-
| *pbiRngBuffer | : Pointer to generated random number data message structure |
| dRNrLength | : Length of data message structure in bytes |
- Return values
-
| kStatus_Success | on successful Secure PRNG generated. |
| kStatus_InvalidArgument | Parameter error |
- Note
- This function is generic and not dependent on any RTOS
-
This function will first enable RNG, calculate RNG and then disable RNG