BeRTOS
randpool.h
Go to the documentation of this file.
00001 
00043 #ifndef ALGO_RANDPOOL_H
00044 #define ALGO_RANDPOOL_H
00045 
00046 #include "cfg/cfg_randpool.h"
00047 #include <cfg/compiler.h>
00048 
00049 
00053 typedef struct EntropyPool
00054 {
00055     size_t entropy;                                  
00056     size_t pos_add;                                  
00057     size_t pos_get;                                  
00058     size_t counter;                                  
00059 
00060 #if CONFIG_RANDPOOL_TIMER
00061     size_t last_counter;                             
00062 #endif
00063 
00064     uint8_t pool_entropy[CONFIG_SIZE_ENTROPY_POOL];  
00065 
00066 } EntropyPool;
00067 
00068 
00069 void randpool_add(EntropyPool *pool, void *data, size_t entropy);
00070 void randpool_init(EntropyPool *pool, void *_data, size_t len);
00071 size_t randpool_size(EntropyPool *pool);
00072 void randpool_get(EntropyPool *pool, void *data, size_t n_byte);
00073 uint8_t *randpool_pool(EntropyPool *pool);
00074 
00075 #endif /* ALGO_RANDPOOL_H */