Page MenuHomePhabricator

Faster sigcache nonce

Authored by Fabien on Feb 11 2021, 13:13.


Group Reviewers
Restricted Project
rABC95d0162dae28: Faster sigcache nonce
This PR replaces nonces in two places with pre-salted hashers.

The nonce is chosen to be 64 bytes long so that it forces the SHA256
hasher to process the chunk. This leaves the next 64 (or 56 depending if
final chunk) open for data. In the case of the script execution cache,
this does not make a big performance improvement because the nonce was
already properly padded to fit into one buffer, but does make the code a
little simpler. In the case of the sig cache, this should reduce the
hashing overhead slightly because we are less likely to need an
additional processing step.

Backport of core PR13204.

Test Plan
ninja all check-all
ninja bench-bitcoin

Diff Detail

rABC Bitcoin ABC
Lint Not Applicable
Tests Not Applicable

Event Timeline

Fabien requested review of this revision.Feb 11 2021, 13:13
This revision is now accepted and ready to land.Feb 11 2021, 15:00
This revision was automatically updated to reflect the committed changes.