From: asterix Date: Thu, 8 Feb 2007 11:53:03 +0000 (+0000) Subject: Add EntrPool struct. Typos. X-Git-Tag: 1.0.0~475 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=775a4c184ac4b83d0a0a6d1cef015ad912c769bc;p=bertos.git Add EntrPool struct. Typos. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@766 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/algos/randpool.c b/algos/randpool.c index 81aa0eab..42d50d55 100755 --- a/algos/randpool.c +++ b/algos/randpool.c @@ -13,38 +13,46 @@ /*#* *#* $Log$ - *#* Revision 1.1 2007/02/08 11:13:40 asterix - *#* Add function prototypes. + *#* Revision 1.2 2007/02/08 11:53:03 asterix + *#* Add EntrPool struct. Typos. *#* *#*/ #include "randpool.h" +#include "md2.h" #include #include //ASSERT() +static void stir(EntrPool *pool) +{ +} + +void init_pool(EntrPool *pool); +{ +} -void add_entropy(void *data, size_t n_bit) +void add_data(EntrPool *pool, void *data, size_t n_bit); { } -size_t pool_size(void) +size_t pool_size(EntrPool *pool); { } -void get_bit(void *data, size_t n_bit) +void get_bit(EntrPool *pool, void *data, size_t n_bit); { } -void get_bit_n(void *data, size_t n_bit) +void get_bit_n(EntrPool *pool, void *data, size_t n_bit); { } -bool save_pool(void) +bool save_pool(void *data); { } -uint8_t load_pool(void) +uint8_t *load_pool(void); { } diff --git a/algos/randpool.h b/algos/randpool.h index 817cf39c..62d650b9 100755 --- a/algos/randpool.h +++ b/algos/randpool.h @@ -14,6 +14,9 @@ /*#* *#* $Log$ + *#* Revision 1.2 2007/02/08 11:53:03 asterix + *#* Add EntrPool struct. Typos. + *#* *#* Revision 1.1 2007/02/08 11:13:41 asterix *#* Add function prototypes. *#* @@ -25,14 +28,24 @@ #include #include - /** + * Sturct data of entropy pool. */ -void add_entropy(void *data, size_t n_bit); -size_t pool_size(void); -void get_bit(void *data, size_t n_bit); -void get_bit_n(void *data, size_t n_bit); -bool save_pool(void); -uint8_t load_pool(void); +typedef struct EntrPool +{ + size_t entropy; ///< Actual value of entropy. + size_t pool_pos; ///< Actual size of entropy pool. + size_t counter; ///< Counter. + uint8_t pool_entropy[CONFIG_SIZE_ENTROPY_POOL]; ///< Entropy pool. + +} EntrPool; + +void init_pool(EntrPool *pool); +void add_data(EntrPool *pool, void *data, size_t n_bit); +size_t pool_size(EntrPool *pool); +void get_bit(EntrPool *pool, void *data, size_t n_bit); +void get_bit_n(EntrPool *pool, void *data, size_t n_bit); +bool save_pool(void *data); +uint8_t *load_pool(void); #endif /* RANDPOOL_H */