From ef3cf7088f675a1336730628f233fd27de019dec Mon Sep 17 00:00:00 2001 From: Paul Bakker Date: Wed, 26 Mar 2014 12:51:25 +0100 Subject: [PATCH] Provide no info from entropy_func() on future entropy --- library/entropy.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/library/entropy.c b/library/entropy.c index 7409c2e72..468ef03cf 100644 --- a/library/entropy.c +++ b/library/entropy.c @@ -184,11 +184,6 @@ int entropy_func( void *data, unsigned char *output, size_t len ) memset( buf, 0, ENTROPY_BLOCK_SIZE ); sha4_finish( &ctx->accumulator, buf ); - - /* - * Perform second SHA-512 on entropy - */ - sha4( buf, ENTROPY_BLOCK_SIZE, buf, 0 ); /* * Reset accumulator and counters and recycle existing entropy @@ -197,6 +192,11 @@ int entropy_func( void *data, unsigned char *output, size_t len ) sha4_starts( &ctx->accumulator, 0 ); sha4_update( &ctx->accumulator, buf, ENTROPY_BLOCK_SIZE ); + /* + * Perform second SHA-512 on entropy + */ + sha4( buf, ENTROPY_BLOCK_SIZE, buf, 0 ); + for( i = 0; i < ctx->source_count; i++ ) ctx->source[i].size = 0;