Infineon Logo AIROC BTSDK v4.9 - 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...

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...
 
uint32_t wiced_hal_get_pseudo_rand_number (void)
 This functin returns a pseudo random number. 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_get_pseudo_rand_number ( void  )

This functin returns a pseudo random number.

Parameters
none
Returns
A randomly generated 32-bit integer.
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