iPXE
Macros | Functions
null_entropy.h File Reference

Nonexistent entropy source. More...

#include <stdint.h>

Go to the source code of this file.

Macros

#define ENTROPY_PREFIX_null   __null_
 

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 
static __always_inline int ENTROPY_INLINE (null, entropy_enable)(void)
 
static __always_inline void ENTROPY_INLINE (null, entropy_disable)(void)
 
static __always_inline min_entropy_t ENTROPY_INLINE (null, min_entropy_per_sample)(void)
 
static __always_inline int ENTROPY_INLINE (null, get_noise)(noise_sample_t *noise)
 

Detailed Description

Nonexistent entropy source.

This source provides no entropy and must NOT be used in a security-sensitive environment.

Definition in file null_entropy.h.

Macro Definition Documentation

◆ ENTROPY_PREFIX_null

#define ENTROPY_PREFIX_null   __null_

Definition at line 19 of file null_entropy.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ ENTROPY_INLINE() [1/4]

static __always_inline int ENTROPY_INLINE ( null  ,
entropy_enable   
)
inlinestatic

Definition at line 23 of file null_entropy.h.

23  {
24  /* Do nothing */
25  return 0;
26 }

◆ ENTROPY_INLINE() [2/4]

static __always_inline void ENTROPY_INLINE ( null  ,
entropy_disable   
)
inlinestatic

Definition at line 29 of file null_entropy.h.

29  {
30  /* Do nothing */
31 }

◆ ENTROPY_INLINE() [3/4]

static __always_inline min_entropy_t ENTROPY_INLINE ( null  ,
min_entropy_per_sample   
)
inlinestatic

Definition at line 34 of file null_entropy.h.

34  {
35  /* Actual amount of min-entropy is zero. To avoid
36  * division-by-zero errors and to allow compilation of
37  * entropy-consuming code, pretend to have 1 bit of entropy in
38  * each sample.
39  */
40  return MIN_ENTROPY ( 1.0 );
41 }
#define MIN_ENTROPY(bits)
Construct a min-entropy fixed-point value.
Definition: entropy.h:71

References MIN_ENTROPY.

◆ ENTROPY_INLINE() [4/4]

static __always_inline int ENTROPY_INLINE ( null  ,
get_noise   
)
inlinestatic

Definition at line 44 of file null_entropy.h.

44  {
45 
46  /* All sample values are constant */
47  *noise = 0x01;
48 
49  return 0;
50 }