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 коммит произвёл Simon Tatham
Родитель 6f871e3d22
Коммит fa38307244
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -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;
}