Page MenuHomePhabricator

Use RdSeed when available, and reduce RdRand load
ClosedPublic

Authored by deadalnix on Nov 22 2019, 20:56.

Details

Summary

This introduces support for autodetecting and using the RdSeed instruction.

In addition:

  • In SeedFast, only 64 bits of entropy are generated through RdRand (256 was relatively slow).
  • In SeedStartup, 256 bits of entropy are generated, using RdSeed (preferably) or RdRand (otherwise).

This is a backport of Core PR15250

Test Plan
make check
./test/functional/test_runner.py

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Fabien requested changes to this revision.Nov 24 2019, 10:26
Fabien added a subscriber: Fabien.
Fabien added inline comments.
src/random.cpp
142 ↗(On Diff #14335)

Move the comment above.
The same apply to all other similar changes in the diff.

143 ↗(On Diff #14335)

Braces.
The same apply to all other similar changes in the diff.

150 ↗(On Diff #14335)

Use c++ constructor

179 ↗(On Diff #14335)

TIL the pause instruction

187 ↗(On Diff #14335)

Use C++ constructor

215 ↗(On Diff #14335)

Layout

This revision now requires changes to proceed.Nov 24 2019, 10:26
This revision is now accepted and ready to land.Nov 25 2019, 07:07