[LTP] [PATCH v2] getrandom02: relax check for returned data
Cyril Hrubis
chrubis@suse.cz
Wed Feb 8 15:12:51 CET 2017
Hi!
> "nb * 0.1" can easily fail for nb < 20, since all we need
> are 2 identical bytes. Worst case (nb == 19) is almost
> identical to "birthday problem", but with smaller pool.
> Chance of hitting 2 identical bytes in pool of 19
> is close to 50%.
>
> Adjust formula to allow small repetitions in small pools.
> Chance we fail now should be pretty unlikely, ~10^-16.
>
> Signed-off-by: Jan Stancek <jstancek@redhat.com>
Acked.
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list