Infineon Logo AIROC BTSDK v4.1 - Documentation
 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Random Number Generator (RNG)

Defines a driver for the Random Number Generator (RNG). More...

Macros

#define wiced_hal_get_pseudo_rand_number   wiced_hal_rand_gen_num
 

Functions

uint32_t wiced_hal_rand_gen_num (void)
 Generates and returns a random 32-bit integer. More...
 
void wiced_hal_rand_gen_num_array (uint32_t *randNumberArrayPtr, uint32_t length)
 Fills a given array with randomly generated 32-bit integers. More...
 

Detailed Description

Defines a driver for the Random Number Generator (RNG).

The RNG uses a special hardware module to generate either a single 32-bit random number or fill a given array with 32-bit random numbers. These are useful for applications such as authentication.

Function Documentation

uint32_t wiced_hal_rand_gen_num ( void  )

Generates and returns a random 32-bit integer.

Internal functions check that the generating hardware is warmed up and ready before returning the random value. If the hardware is too "cold" at the time of use, the function will instead use the Bluetooth clock as a "seed" and generate a "soft" random number.

Parameters
none
Returns
A randomly generated 32-bit integer.
void wiced_hal_rand_gen_num_array ( uint32_t *  randNumberArrayPtr,
uint32_t  length 
)

Fills a given array with randomly generated 32-bit integers.

Uses the function wiced_hal_rand_gen_num().

Parameters
randNumberArrayPtr- Pointer to an array to be populated with the random numbers.
length- Length of the array pointed to by randNumberArrayPtr.
Returns
none