HomePhabricator

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

Authored by Pieter Wuille <pieter.wuille@gmail.com> on Dec 18 2018, 01:00.

Description

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

Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc

Reviewed By: jasonbcox, O1 Bitcoin ABC, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D4387

Details

Committed
Nico Guiton <nico@bitframe.org>Fri, Nov 8, 15:54
Pushed
nakihitoFri, Nov 8, 15:54
Reviewer
Restricted Owners Package
Differential Revision
D4387: Use FRC::randbytes instead of reading >32 bytes from RNG
Parents
rABCe20d900747f1: [CMAKE] Generate the split-debug.sh script
Branches
Unknown
Tags
Unknown

Event Timeline