Skip to content

Entropy Pool

include/crypto/entropy_pool.h View source View on GitHub
struct entropy_pool (4 fields) source
§ uint8_t buffer[ENTROPY_POOL_SIZE]

Raw pool data

§ uint64_t write_pos

Circular buffer write position

§ uint64_t entropy_bits

Estimated entropy in bits

§ struct spinlock lock

To protect concurrent access

void entropy_pool_init(struct entropy_pool *pool)
source
void entropy_pool_add(
    struct entropy_pool *pool,
    const uint8_t *data,
    uint64_t len,
    uint64_t entropy_bits
)
source
void entropy_pool_decrease(struct entropy_pool *pool, uint64_t bits)
source
void entropy_pool_seed(struct entropy_pool *pool)
source
void entropy_pool_reseed(struct entropy_pool *pool)
source
#define ENTROPY_POOL_SIZE 64
source

512 bits

#define ENTROPY_MAX_BITS to_bits(ENTROPY_POOL_SIZE)
source