BeRTOS
Data Structures | Functions
randpool.h File Reference

Collection of functions to manage entropy pool. More...

#include "cfg/cfg_randpool.h"
#include <cfg/compiler.h>

Go to the source code of this file.

Data Structures

struct  EntropyPool
 Sturct data of entropy pool. More...

Functions

void randpool_add (EntropyPool *pool, void *data, size_t entropy)
 Add.
void randpool_init (EntropyPool *pool, void *_data, size_t len)
 Randpool function initialization.
size_t randpool_size (EntropyPool *pool)
 Get the actual value of entropy.
void randpool_get (EntropyPool *pool, void *data, size_t n_byte)
 Get.
uint8_t * randpool_pool (EntropyPool *pool)
 Return a pointer to entropy pool.

Detailed Description

Collection of functions to manage entropy pool.

Author:
Daniele Basile <asterix@develer.com>

Definition in file randpool.h.


Function Documentation

void randpool_add ( EntropyPool pool,
void *  data,
size_t  entropy 
)

Add.

Parameters:
entropybits from
databuffer to the entropy
pool

Definition at line 120 of file randpool.c.

void randpool_get ( EntropyPool pool,
void *  _data,
size_t  n_byte 
)

Get.

Parameters:
n_bytefrom entropy pool. If n_byte is larger than number byte of entropy in entropy pool, randpool_get continue to generate pseudocasual value from previous state of pool.
n_bytenumber fo bytes to read.
poolis the pool entropy context.
_datais the pointer to write the random data to.

Definition at line 205 of file randpool.c.

void randpool_init ( EntropyPool pool,
void *  _data,
size_t  len 
)

Randpool function initialization.

The entropy pool can be initialize also with a previous entropy pool.

Definition at line 161 of file randpool.c.