Defines all functions of mcuxClRandom. More...
Defines all functions of mcuxClRandom.
mcuxClRandom_Status_t mcuxClRandom_init | ( | mcuxClSession_Handle_t | pSession, |
mcuxClRandom_Context_t | pContext, | ||
mcuxClRandom_Mode_t | mode | ||
) |
Random data generator initialization function.
This function performs the initialization of a random data generator. This operation initializes the Random context referenced in the session handle.
[in] | pSession | Handle for the current CL session. |
[in] | pContext | Pointer to a Random data context buffer large enough to hold the context for the selected mode |
[in] | mode | Mode of operation for random data generator. |
mcuxClRandom_Status_t mcuxClRandom_reseed | ( | mcuxClSession_Handle_t | pSession | ) |
Random data generator reseed function.
This function performs the reseeding of a random data generator. This operation fetches a fresh seed from a TRNG and updates the state in the Random context referenced in the session handle.
[in] | pSession | Handle for the current CL session. |
mcuxClRandom_Status_t mcuxClRandom_generate | ( | mcuxClSession_Handle_t | pSession, |
mcuxCl_Buffer_t | pOut, | ||
uint32_t | outLength | ||
) |
Random data generation function.
This function generates random data based on the information contained in the Random context referenced in the session handle.
[in] | pSession | Handle for the current CL session. |
[out] | pOut | Buffer in which the generated random data must be written. |
[in] | outLength | Number of random data bytes that must be written in the pOut buffer. |
mcuxClRandom_Status_t mcuxClRandom_uninit | ( | mcuxClSession_Handle_t | pSession | ) |
Random data generator uninitialization function.
This function performs the cleanup of a random data generator. This operation cleans up the Random context referenced in the session handle.
[in] | pSession | Handle for the current CL session. |
mcuxClRandom_Status_t mcuxClRandom_selftest | ( | mcuxClSession_Handle_t | pSession, |
mcuxClRandom_Mode_t | mode | ||
) |
Random data generator self-test function.
This function performs a series of selft-tests on the random data generator. These tests are performed on the random data generator defined by Random context referenced in the session handle.
[in] | pSession | Handle for the current CL session. |
mcuxClRandom_Status_t mcuxClRandom_checkSecurityStrength | ( | mcuxClSession_Handle_t | pSession, |
uint32_t | securityStrength | ||
) |
Random data generator security strength check.
This function reports whether the the random data generator can provide the requested security strength.
[in] | pSession | Handle for the current CL session. |
[in] | securityStrength | Requested security strength in bits. |
mcuxClRandom_Status_t mcuxClRandom_ncPatch | ( | mcuxClSession_Handle_t | pSession, |
mcuxClRandom_CustomNcGenerateAlgorithm_t | prngPatchFunction, | ||
void * | pCustomPrngState | ||
) |
Function to enable the PRNG patch mode.
In PRNG patch mode all calls to mcuxClRandom_ncGenerate are mapped to prngPatchFunction. pCustomPrngState can be used to allow a stateful prngPatchFunction. mcuxClRandom_ncInit does not need to be called before this. A subsequent call to mcuxClRandom_ncInit will deactivate patch mode.
[in] | pSession | Session of the PRNG to be patched. |
[in] | prngPatchFunction | Function pointer of the custom PRNG patch function. |
[in] | pCustomPrngState | Pointer to a custom prng state to be maintained by prngPatchFunction |
mcuxClRandom_Status_t mcuxClRandom_ncInit | ( | mcuxClSession_Handle_t | pSession | ) |
Non-cryptographic PRNG initialization function.
This function performs the initialization of the non-cryptographic random number generator. If PRNG patching is active, this will also deactivate PRNG patch mode and reset to normal PRNG operation mode. A potential custom prng state is removed from pSession, but not cleared.
[in] | pSession | Handle for the current CL session. |
mcuxClRandom_Status_t mcuxClRandom_ncGenerate | ( | mcuxClSession_Handle_t | pSession, |
mcuxCl_Buffer_t | pOut, | ||
uint32_t | outLength | ||
) |
Non-cryptographic PRNG data generation function.
This function generates non-cryptographic random data
[in] | pSession | Handle for the current CL session. |
[out] | pOut | Buffer in which the generated random data must be written. |
[in] | outLength | Number of random data bytes that must be written in the pOut buffer. |