5.13.0.0R1
Software Development Kit
wiced_crypto.c File Reference

Functions

wiced_result_t wiced_crypto_add_entropy (const void *buffer, uint16_t buffer_length)
 
wiced_result_t wiced_crypto_get_random (void *buffer, uint16_t buffer_length)
 
void wiced_crypto_prng_add_low_variability_entropy (uint32_t cycles)
 
wiced_result_t wiced_crypto_set_prng (wiced_crypto_prng_t *prng)
 
wiced_result_t wiced_crypto_use_default_prng (void)
 

Detailed Description

Cryptographic functions

Provides cryptographic functions for use in applications

Function Documentation

wiced_result_t wiced_crypto_add_entropy ( const void *  buffer,
uint16_t  buffer_length 
)

Feed entropy into random number generator.

Parameters
buffer: pointer to the buffer which contains random data
buffer_length: size of the buffer
Returns
WICED_SUCCESS or Error code
wiced_result_t wiced_crypto_get_random ( void *  buffer,
uint16_t  buffer_length 
)

Gets a 16 bit random numbers.

Allows user applications to retrieve 16 bit random numbers. If cryptographic security for rand numbers is required, call wiced_crypto_use_secure_prng first

Parameters
buffer: pointer to the buffer which will receive the generated random data
buffer_length: size of the buffer
Returns
WICED_SUCCESS or Error code
void wiced_crypto_prng_add_low_variability_entropy ( uint32_t  entropy)

Use the parameter to seed the default pseudo-random number generator (PRNG) from a low variability source. Examples of this type of entropy are cycles taken to complete a function. Note this type of seeding is usually most effective if the secure PRNG is compiled in. (See wiced_crypto_use_secure_prng for more info.)

Parameters
entropy: variable holding a value with some small amount of variability that can be used as an initial seed Example: number of cycles to complete functions accessing hardware
Returns
WICED_SUCCESS or Error code
wiced_result_t wiced_crypto_set_prng ( wiced_crypto_prng_t *  prng)

Set new PRNG implementation.

Parameters
prng: pointer to PRNG implementation, if NULL then default (Well512) would be used
Returns
WICED_SUCCESS or Error code
wiced_result_t wiced_crypto_use_default_prng ( void  )

Use default PRNG (currently Well512). This is not a cryptographically secure PRNG. Advantage is, relatively small memory requirements.

Returns
WICED_SUCCESS