4 * Copyright 2007 Develer S.r.l. (http://www.develer.com/);
5 * This file is part of DevLib - See README.devlib for information.
8 * \brief API function for to manage entropy pool.
12 * \author Daniele Basile <asterix@develer.com>
17 *#* Revision 1.5 2007/02/09 09:24:38 asterix
18 *#* Typos. Add data_len in randpool_add and n_byte in randpool_push pototypes.
20 *#* Revision 1.4 2007/02/08 17:18:01 asterix
21 *#* Write add_data and stir function. Typos
23 *#* Revision 1.3 2007/02/08 14:25:56 asterix
26 *#* Revision 1.2 2007/02/08 11:53:03 asterix
27 *#* Add EntrPool struct. Typos.
29 *#* Revision 1.1 2007/02/08 11:13:41 asterix
30 *#* Add function prototypes.
37 #include <cfg/compiler.h>
38 #include <appconfig.h>
41 * Sturct data of entropy pool.
43 typedef struct EntrPool
45 size_t entropy; ///< Actual value of entropy (byte).
46 size_t pos_add; ///< Size of byte insert in entropy pool.
47 size_t pos_get; ///< Size of byte take in entropy pool.
48 size_t counter; ///< Counter.
49 size_t last_counter; ///< Last timer value.
50 uint8_t pool_entropy[CONFIG_SIZE_ENTROPY_POOL]; ///< Entropy pool.
55 void randpool_add(EntrPool *pool, void *data, size_t data_len, size_t entropy);
56 void randpool_init(EntrPool *pool);
57 size_t randpool_size(EntrPool *pool);
58 void randpool_get(EntrPool *pool, void *data, size_t n_byte);
59 void randpool_getN(EntrPool *pool, void *data, size_t n_byte);
60 bool randpool_save(void *data);
61 uint8_t *randpool_load(void);
63 #endif /* RANDPOOL_H */