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