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