From c8a9601859363da4718073728ead6c04545f1154 Mon Sep 17 00:00:00 2001 From: asterix Date: Tue, 13 Feb 2007 09:57:12 +0000 Subject: [PATCH] Add directive #if in struct EntropyPool, and remove #else in randpool_add. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@781 38d2e660-2303-0410-9eaa-f027e97ec537 --- algos/randpool.c | 10 ++++------ algos/randpool.h | 7 +++++++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/algos/randpool.c b/algos/randpool.c index 6881bc48..ed9bf436 100755 --- a/algos/randpool.c +++ b/algos/randpool.c @@ -13,6 +13,9 @@ /*#* *#* $Log$ + *#* Revision 1.14 2007/02/13 09:57:12 asterix + *#* Add directive #if in struct EntropyPool, and remove #else in randpool_add. + *#* *#* Revision 1.13 2007/02/12 18:25:34 asterix *#* Fix bug in randpool_getN. *#* @@ -146,16 +149,11 @@ void randpool_add(EntropyPool *pool, void *data, size_t data_len, size_t entropy entropy++; } -#else - size_t event = 0; - - /*Difference of time between a two accese to entropy pool.*/ - event = pool->last_counter++; + pool->last_counter = event; #endif pool->entropy += entropy; //Update a entropy of the pool. - pool->last_counter = event; } /** diff --git a/algos/randpool.h b/algos/randpool.h index 9c310c91..46d91288 100755 --- a/algos/randpool.h +++ b/algos/randpool.h @@ -14,6 +14,9 @@ /*#* *#* $Log$ + *#* Revision 1.9 2007/02/13 09:57:12 asterix + *#* Add directive #if in struct EntropyPool, and remove #else in randpool_add. + *#* *#* Revision 1.8 2007/02/12 09:47:39 asterix *#* Remove randpool_save. Add randpool_pool. *#* @@ -54,7 +57,11 @@ typedef struct EntropyPool size_t pos_add; ///< Number of byte idd in entropy pool. size_t pos_get; ///< Number of byte get in entropy pool. size_t counter; ///< Counter. + +#if CONFIG_RANDPOOL_TIMER size_t last_counter; ///< Last timer value. +#endif + uint8_t pool_entropy[CONFIG_SIZE_ENTROPY_POOL]; ///< Entropy pool. } EntropyPool; -- 2.25.1