Loading...
Searching...
No Matches
Entropy source API to Mbed TLS

Detailed Description

Files

file  entropy_sources_mbedtls_riot.h
 Functions to register and poll with the Mbed TLS entropy module.
 

Data Structures

struct  entropy_source_mbedtls_riot_t
 Structure containing entropy function and its strength. More...
 

Functions

int riot_add_entropy_src_avail (mbedtls_entropy_context *ctx)
 Add all available entropy sources to poll.
 
int riot_hwrng_poll (void *data, unsigned char *output, size_t len, size_t *olen)
 Wrapper around RIOTs HWRNG API.
 
int riot_adc_poll (void *data, unsigned char *output, size_t len, size_t *olen)
 Wrapper around RIOTs ADC entropy API.
 

Function Documentation

◆ riot_adc_poll()

int riot_adc_poll ( void *  data,
unsigned char *  output,
size_t  len,
size_t *  olen 
)

Wrapper around RIOTs ADC entropy API.

Required to comply with mbed TLS entropy callback function signature.

Parameters
[in]dataNot used.
[in]outputPointer to the output buffer to fill.
[in]lenLength of requested entropy in bytes.
[out]olenEquals len.
Returns
0 if no critical failures occurred, MBEDTLS_ERR_ENTROPY_SOURCE_FAILED otherwise.

◆ riot_add_entropy_src_avail()

int riot_add_entropy_src_avail ( mbedtls_entropy_context *  ctx)

Add all available entropy sources to poll.

This function would typically not be called by a user. It is called during initialization by entropy_mbedtls_riot_init.

Parameters
[out]ctxPointer to mbedtls context.
Returns
0 if successful
MBEDTLS_ERR_ENTROPY_MAX_SOURCES on failure

◆ riot_hwrng_poll()

int riot_hwrng_poll ( void *  data,
unsigned char *  output,
size_t  len,
size_t *  olen 
)

Wrapper around RIOTs HWRNG API.

Required to comply with mbed TLS entropy callback function signature.

Parameters
[in]dataNot used.
[in]outputPointer to the output buffer to fill.
[in]lenLength of requested entropy in bytes.
[out]olenEquals len.
Returns
0 always