Page MenuHomePhabricator

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

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

Details

Reviewers
deadalnix
Fabien
jasonbcox
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Restricted Project
Commits
rABCdb22ce1e682d: Use FRC::randbytes instead of reading >32 bytes from RNG
Summary

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
https://github.com/bitcoin/bitcoin/pull/14955/commits/6a57ca91da23c6a5d91399ffc7fc09a99b6d4c76

Test Plan
make check

Diff Detail

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

Event Timeline

nakihito created this revision.Tue, Nov 5, 22:40
Owners added a reviewer: Restricted Owners Package.Tue, Nov 5, 22:40
Herald added a reviewer: Restricted Project. · View Herald TranscriptTue, Nov 5, 22:40
jasonbcox accepted this revision.Tue, Nov 5, 22:50
This revision is now accepted and ready to land.Tue, Nov 5, 22:50