Page MenuHomePhabricator

Use FRC::randbytes instead of reading >32 bytes from RNG

Authored by nakihito on Nov 5 2019, 22:40.



There was only one place in the codebase where we're directly reading >32 bytes from
the RNG. One possibility would be to make the built-in RNG support large reads, but
using FastRandomContext lets us reuse code better.

There is no change in behavior here, because the FastRandomContext constructor
uses GetRandBytes internally.

Partial backport of Core PR14955

Test Plan
make check

Diff Detail

rABC Bitcoin ABC
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Owners added a reviewer: Restricted Owners Package.Nov 5 2019, 22:40
This revision is now accepted and ready to land.Nov 5 2019, 22:50