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.3 2007/02/08 14:25:56 asterix
20 *#* Revision 1.2 2007/02/08 11:53:03 asterix
21 *#* Add EntrPool struct. Typos.
23 *#* Revision 1.1 2007/02/08 11:13:41 asterix
24 *#* Add function prototypes.
31 #include <cfg/compiler.h>
32 #include <appconfig.h>
35 * Sturct data of entropy pool.
37 typedef struct EntrPool
39 size_t entropy; ///< Actual value of entropy.
40 size_t pool_pos_add; ///< Size of byte insert in entropy pool.
41 size_t pool_pos_get; ///< Size of byte take in entropy pool.
42 size_t counter; ///< Counter.
43 size_t last_counter; ///< Last timer value.
44 uint8_t pool_entropy[CONFIG_SIZE_ENTROPY_POOL]; ///< Entropy pool.
48 void init_pool(EntrPool *pool);
49 void add_data(EntrPool *pool, void *data, size_t n_bit);
50 size_t pool_size(EntrPool *pool);
51 void get_bit(EntrPool *pool, void *data, size_t n_bit);
52 void get_bit_n(EntrPool *pool, void *data, size_t n_bit);
53 bool save_pool(void *data);
54 uint8_t *load_pool(void);
56 #endif /* RANDPOOL_H */