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
Branch
pr15250
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 8236
Build 14498: Default Diff Build & Tests
Build 14497: arc lint + arc unit

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

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

143

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

150

Use c++ constructor

179

TIL the pause instruction

187

Use C++ constructor

215

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