Typos.
[bertos.git] / algos / randpool.h
1 /**
2  * \file
3  * <!--
4  * Copyright 2007 Develer S.r.l. (http://www.develer.com/)
5  * This file is part of DevLib - See README.devlib for information.
6  * -->
7  *
8  * \brief API function for to manage entropy pool.
9  *
10  *
11  * \version $Id$
12  * \author Daniele Basile <asterix@develer.com>
13  */
14
15 /*#*
16  *#* $Log$
17  *#* Revision 1.3  2007/02/08 14:25:56  asterix
18  *#* Typos.
19  *#*
20  *#* Revision 1.2  2007/02/08 11:53:03  asterix
21  *#* Add EntrPool struct. Typos.
22  *#*
23  *#* Revision 1.1  2007/02/08 11:13:41  asterix
24  *#* Add function prototypes.
25  *#*
26  *#*/
27
28 #ifndef RANDPOOL_H 
29 #define RANDPOOL_H
30
31 #include <cfg/compiler.h>
32 #include <appconfig.h>
33
34 /**
35  * Sturct data of entropy pool.
36  */
37 typedef struct EntrPool 
38 {
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.
45
46 } EntrPool;
47
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);
55
56 #endif /* RANDPOOL_H */