mbed TLS v2.23.0: Entropy Generation

mbed TLS v2.23.0

Data Structures | Typedefs
Entropy Generation

## Data Structures
struct | psa_drv_entropy_t
| A struct containing all of the function pointers needed to interface to an entropy source. More...

## Typedefs
typedef psa_status_t(* | psa_drv_entropy_init_t) (void *p_context)
| Initialize an entropy driver. More...
typedef psa_status_t(* | psa_drv_entropy_get_bits_t) (void *p_context, uint8_t *p_buffer, uint32_t buffer_size, uint32_t *p_received_entropy_bits)
| Get a specified number of bits from the entropy source. More...

## Detailed Description

## Typedef Documentation

## ◆ psa_drv_entropy_get_bits_t

typedef psa_status_t(* psa_drv_entropy_get_bits_t) (void *p_context, uint8_t *p_buffer, uint32_t buffer_size, uint32_t *p_received_entropy_bits)

Get a specified number of bits from the entropy source.

It retrives `buffer_size` bytes of data from the entropy source. The entropy source will always fill the provided buffer to its full size, however, most entropy sources have biases, and the actual amount of entropy contained in the buffer will be less than the number of bytes. The driver will return the actual number of bytes of entropy placed in the buffer in `p_received_entropy_bytes`. A PSA Crypto API implementation will likely feed the output of this function into a Digital Random Bit Generator (DRBG), and typically has a minimum amount of entropy that it needs. To accomplish this, the PSA Crypto implementation should be designed to call this function multiple times until it has received the required amount of entropy from the entropy source.

Parameters

  [in,out] | p_context | A hardware-specific structure containing any context information for the implementation
  [out] | p_buffer | A caller-allocated buffer for the retrieved entropy to be placed in
  [in] | buffer_size | The allocated size of `p_buffer`
  [out] | p_received_entropy_bits | The amount of entropy (in bits) actually provided in `p_buffer`

Return values

  PSA_SUCCESS |

Definition at line 80 of file crypto_entropy_driver.h.

## ◆ psa_drv_entropy_init_t

typedef psa_status_t(* psa_drv_entropy_init_t) (void *p_context)

Initialize an entropy driver.

Parameters

  [in,out] | p_context | A hardware-specific structure containing any context information for the implementation

Return values

  PSA_SUCCESS |

Definition at line 52 of file crypto_entropy_driver.h.