Entropy Source based on LSB of ADC samples. More...
Entropy Source based on LSB of ADC samples.
This module provides entropy from ADC samples. Thereby, only the LSB is considered for generation of output values. The available resolution as well as internal sampling rates, specific driver settings and device inaccuracies may lead to different behavior between different platforms. The configured ADC pin might be unconnected and floating, it can be exposed as an I/O pin or internally connected to a thermal noise source, an avalanche diode circuit or the receive path of an antenna. The possibilities are manifold, thus, configuration and deployment properties of this module need to be thoroughly validated.
Files | |
file | adc_noise.h |
Functions | |
int | entropy_source_adc_init (void) |
Initialize ADC and test structures, if tests are enabled. | |
int | entropy_source_adc_get (uint8_t *buf, size_t len) |
Generates bytes from ADC noise. | |
static uint32_t | entropy_source_adc_entropy_per_sample (void) |
Static entropy per sample value for this source [bit/sample * 2^16]. | |
#define | CONFIG_ENTROPY_SOURCE_ADC_LINE ADC_LINE(0) |
ADC line default configuration. | |
#define | CONFIG_ENTROPY_SOURCE_ADC_HMIN (0) |
ADC estimated entropy per sample [2^16 * bit/sample]. | |
#define | CONFIG_ENTROPY_SOURCE_ADC_HEALTH_TEST 0 |
Disable ADC health test by default. | |
#define | CONFIG_ENTROPY_SOURCE_ADC_COND 0 |
Disable ADC conditioning test by default. | |
#define CONFIG_ENTROPY_SOURCE_ADC_COND 0 |
Disable ADC conditioning test by default.
Definition at line 113 of file adc_noise.h.
#define CONFIG_ENTROPY_SOURCE_ADC_HEALTH_TEST 0 |
Disable ADC health test by default.
Definition at line 108 of file adc_noise.h.
#define CONFIG_ENTROPY_SOURCE_ADC_HMIN (0) |
ADC estimated entropy per sample [2^16 * bit/sample].
The entropy value needs to be estimated and evaluated thoroughly beforehand deployment! To avoid float, the actual entropy value per one byte sample needs to be manually multiplied by 2^16 before before configuring it (e.g., to an entropy value of 1 bit/sample, a value of 1 * 65536 needs to be set) . We default to zero which is an invalid configuration to enforce a thoughtful investigation on the actual entropy properties. See Entropy Sources for further information about entropy source validation. H_min=0 bit/sample * 2^16 is invalid and needs to set manually!
Definition at line 102 of file adc_noise.h.
#define CONFIG_ENTROPY_SOURCE_ADC_LINE ADC_LINE(0) |
ADC line default configuration.
The ADC line maps to an I/O pin. This number acts as index to an array of predefined ADC devices that contain the pin definition. Typically, the array is defined by a board in a periph_conf.h file. Please note that a board is not required to specify a minimum number of lines.
Definition at line 81 of file adc_noise.h.
|
inlinestatic |
Static entropy per sample value for this source [bit/sample * 2^16].
Definition at line 148 of file adc_noise.h.
int entropy_source_adc_get | ( | uint8_t * | buf, |
size_t | len | ||
) |
Generates bytes from ADC noise.
[out] | buf | pointer to write noisy bytes to |
[in] | len | number of bytes to generate |
int entropy_source_adc_init | ( | void | ) |
Initialize ADC and test structures, if tests are enabled.