1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-16 02:27:32 -05:00

Windows PuTTYgen: bound entropy input by PRNG state size.

Although I've reinstated the tedious manual mouse input, I can at
least reduce the amount of it that the user is required to provide:
the new PRNG has a hard limit on the size of its seed, so once we've
generated enough entropy to fill that up, there's no point in
collecting more, even if we're generating a particularly large key.
This commit is contained in:
Simon Tatham
2019-02-10 13:43:14 +00:00
parent 4d288dc3e9
commit 22131a51fa
5 changed files with 21 additions and 0 deletions

View File

@ -284,3 +284,9 @@ void prng_add_entropy(prng *pr, unsigned source_id, ptrlen data)
prng_seed_finish(&pi->Prng);
}
}
size_t prng_seed_bits(prng *pr)
{
prng_impl *pi = container_of(pr, prng_impl, Prng);
return pi->hashalg->hlen * 8;
}