1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

In random_add_noise, put the hashed noise into the pool, not the raw noise

random_add_noise calls SHATransform for every 64 octets of incoming noise,
yet instead of xor'ing the hashed noise into the pool it instead only xor'ed
20 octets of the raw noise in each iteration. This effectively reduced the
amount of new entropy entering the pool.
This commit is contained in:
Tim Kosse 2016-12-28 15:41:40 +01:00 committed by Simon Tatham
parent 6f871e3d22
commit fa38307244

View File

@ -240,7 +240,7 @@ void random_add_noise(void *noise, int length)
length -= HASHINPUT - pool.incomingpos;
SHATransform((word32 *) pool.incoming, (word32 *) pool.incomingb);
for (i = 0; i < HASHSIZE; i++) {
pool.pool[pool.poolpos++] ^= pool.incomingb[i];
pool.pool[pool.poolpos++] ^= pool.incoming[i];
if (pool.poolpos >= POOLSIZE)
pool.poolpos = 0;
}