Loading...
Searching...
No Matches
Access API to Mbed TLS entropy module

Detailed Description

Files

file  entropy_mbedtls_riot.h
 Convenience functions to retrieve entropy from Mbed TLS.
 

Functions

int entropy_mbedtls_riot_init (void)
 Initialize the Mbed TLS entropy module.
 
int entropy_mbedtls_riot_retrieve (unsigned char *output, size_t len)
 Retrieve entropy values after initialization.
 
void entropy_mbedtls_riot_uninit (void)
 Uninitialize the Mbed TLS entropy module.
 
int entropy_mbedtls_riot_get (unsigned char *output, size_t len)
 Get entropy values.
 

Function Documentation

◆ entropy_mbedtls_riot_get()

int entropy_mbedtls_riot_get ( unsigned char *  output,
size_t  len 
)

Get entropy values.

Convenience function. A context structure is allocated and managed internally. Requested entropy values are gathered and the context is uninitialized afterwards.

Parameters
[out]outputPointer to the output buffer to fill with entropy values.
[in]lenLength of requested entropy in bytes.
Return values
0if successful
MBEDTLS_ERR_ENTROPY_MAX_SOURCESon failure
MBEDTLS_ERR_ENTROPY_SOURCE_FAILEDif source failed

◆ entropy_mbedtls_riot_init()

int entropy_mbedtls_riot_init ( void  )

Initialize the Mbed TLS entropy module.

A context structure is allocated and managed internally. Connect all available entropy sources to the poll.

Return values
0if successful
MBEDTLS_ERR_ENTROPY_MAX_SOURCESon failure

◆ entropy_mbedtls_riot_retrieve()

int entropy_mbedtls_riot_retrieve ( unsigned char *  output,
size_t  len 
)

Retrieve entropy values after initialization.

Precondition
Module is initialized already (i.e. entropy_mbedtls_riot_init has been called).
Parameters
[out]outputPointer to the output buffer to fill with entropy values.
[in]lenLength of requested entropy in bytes.
Return values
0if successful
MBEDTLS_ERR_ENTROPY_SOURCE_FAILEDif source failed

◆ entropy_mbedtls_riot_uninit()

void entropy_mbedtls_riot_uninit ( void  )

Uninitialize the Mbed TLS entropy module.

Frees the internally allocated context. Mbed TLS zeroizes the memory.