Data Fields
entropy_source Struct Reference

An entropy source. More...

#include <entropy.h>

Data Fields

const char * name
 Name. More...
min_entropy_t min_entropy_per_sample
 min-entropy per sample More...
struct entropy_repetition_count_test repetition_count_test
 Repetition count test state. More...
struct entropy_adaptive_proportion_test adaptive_proportion_test
 Adaptive proportion test state. More...
struct entropy_startup_test startup_test
 Startup test state. More...
int rc
 Failure status (if any) More...
int(* enable )(void)
 Enable entropy gathering. More...
void(* disable )(void)
 Disable entropy gathering. More...
int(* get_noise )(noise_sample_t *noise)
 Get noise sample. More...

Detailed Description

An entropy source.

Definition at line 116 of file entropy.h.

Field Documentation

◆ name

const char* entropy_source::name

◆ min_entropy_per_sample

min_entropy_t entropy_source::min_entropy_per_sample

min-entropy per sample

min-entropy is defined in ANS X9.82 Part 1-2006 Section 8.3 and in NIST SP 800-90 Appendix C.3 as

H_min = -log2 ( p_max )

where p_max is the probability of the most likely sample value.

Filled in by entropy_init().

Definition at line 131 of file entropy.h.

Referenced by entropy_enable(), entropy_init(), and get_entropy_input_tmp().

◆ repetition_count_test

struct entropy_repetition_count_test entropy_source::repetition_count_test

Repetition count test state.

Definition at line 133 of file entropy.h.

Referenced by entropy_init(), repetition_count_test(), and repetition_count_test_init().

◆ adaptive_proportion_test

struct entropy_adaptive_proportion_test entropy_source::adaptive_proportion_test

Adaptive proportion test state.

Definition at line 135 of file entropy.h.

Referenced by adaptive_proportion_test(), adaptive_proportion_test_init(), and entropy_init().

◆ startup_test

struct entropy_startup_test entropy_source::startup_test

◆ rc

int entropy_source::rc

Failure status (if any)

Any failure of an entropy source is regarded as permanent.

Definition at line 143 of file entropy.h.

Referenced by entropy_enable(), entropy_enable_and_test(), get_entropy(), and get_entropy_input_tmp().

◆ enable

int( * entropy_source::enable) (void)

Enable entropy gathering.

Return values
rcReturn status code

Definition at line 150 of file entropy.h.

Referenced by entropy_enable().

◆ disable

void( * entropy_source::disable) (void)

Disable entropy gathering.

Definition at line 155 of file entropy.h.

Referenced by entropy_disable().

◆ get_noise

int( * entropy_source::get_noise) (noise_sample_t *noise)

Get noise sample.

Return values
noiseNoise sample
rcReturn status code

This is the GetNoise function defined in ANS X9.82 Part 2 (October 2011 Draft) Section 6.5.2.

Definition at line 165 of file entropy.h.

Referenced by get_noise().

The documentation for this struct was generated from the following file: