nRF5 SDK v13.0.0
Functions
Random number generation related functions.

Provides functions to initialize rng subsystem and generate random data. More...

Functions

uint32_t nrf_crypto_rng_init (void)
 Initialize the random number generator. More...
 
uint32_t nrf_crypto_rng_vector_generate (uint8_t *p_target, uint32_t length)
 Generate random data into a buffer, given length as an input. More...
 

Detailed Description

Provides functions to initialize rng subsystem and generate random data.

Function Documentation

uint32_t nrf_crypto_rng_init ( void  )

Initialize the random number generator.

Note
This function is called by nrf_crypto_init.
Return values
NRF_SUCCESSIf random number generator was initialized successfully.
NRF_ERROR_INTERNALIf an internal error occured in the nrf_crypto backend.
uint32_t nrf_crypto_rng_vector_generate ( uint8_t *  p_target,
uint32_t  length 
)

Generate random data into a buffer, given length as an input.

Parameters
[in,out]p_targetPointer to a buffer to accept the random generated data. This buffer must be the same length as the length input.
[in]lengthLength (in bytes) to generate random data for.
Return values
NRF_SUCCESSData was generated successfully.
NRF_ERROR_NULLp_target was NULL.
NRF_ERROR_INTERNALIf an internal error occured in the nrf_crypto backend.

Documentation feedback | Developer Zone | Subscribe | Updated