From e23eec8c9a602eee0a09851a54db0f5d611f125c Mon Sep 17 00:00:00 2001 From: Werner Koch <wk@gnupg.org> Date: Wed, 17 Aug 2016 11:03:07 +0200 Subject: [PATCH 1/2] cipher: Improve readability by using a macro. * cipher/random.c (mix_pool): Use DIGESTLEN instead of 20. Signed-off-by: Werner Koch <wk@gnupg.org> --- cipher/random.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cipher/random.c b/cipher/random.c index 7549517..be2f51a 100644 --- a/cipher/random.c +++ b/cipher/random.c @@ -365,7 +365,7 @@ mix_pool(byte *pool) memcpy(hashbuf, pend - DIGESTLEN, DIGESTLEN ); memcpy(hashbuf+DIGESTLEN, pool, BLOCKLEN-DIGESTLEN); rmd160_mixblock( &md, hashbuf); - memcpy(pool, hashbuf, 20 ); + memcpy(pool, hashbuf, DIGESTLEN); p = pool; for( n=1; n < POOLBLOCKS; n++ ) { @@ -384,7 +384,7 @@ mix_pool(byte *pool) } rmd160_mixblock( &md, hashbuf); - memcpy(p, hashbuf, 20 ); + memcpy(p, hashbuf, DIGESTLEN); } burn_stack (384); /* for the rmd160_mixblock() */ } -- 2.1.4