lbrycrd/src/bench
Wladimir J. van der Laan 6e6b3b944d
Merge #14955: Switch all RNG code to the built-in PRNG
223de8d94d Document RNG design in random.h (Pieter Wuille)
f2e60ca985 Use secure allocator for RNG state (Pieter Wuille)
cddb31bb0a Encapsulate RNGState better (Pieter Wuille)
152146e782 DRY: Implement GetRand using FastRandomContext::randrange (Pieter Wuille)
a1f252eda8 Sprinkle some sweet noexcepts over the RNG code (Pieter Wuille)
4ea8e50837 Remove hwrand_initialized. (Pieter Wuille)
9d7032e4f0 Switch all RNG code to the built-in PRNG. (Pieter Wuille)
16e40a8b56 Integrate util/system's CInit into RNGState (Pieter Wuille)
2ccc3d3aa3 Abstract out seeding/extracting entropy into RNGState::MixExtract (Pieter Wuille)
aae8b9bf0f Add thread safety annotations to RNG state (Pieter Wuille)
d3f54d1c82 Rename some hardware RNG related functions (Pieter Wuille)
05fde14e3a Automatically initialize RNG on first use. (Pieter Wuille)
2d1cc50939 Don't log RandAddSeedPerfmon details (Pieter Wuille)
6a57ca91da Use FRC::randbytes instead of reading >32 bytes from RNG (Pieter Wuille)

Pull request description:

  This does not remove OpenSSL, but makes our own PRNG the 'main' one; for GetStrongRandBytes, the OpenSSL RNG is still used (indirectly, by feeding its output into our PRNG state).

  It includes a few policy changes (regarding what entropy is seeded when).

  Before this PR:
  * GetRand*:
    * OpenSSL
  * GetStrongRand*:
    * CPU cycle counter
    * Perfmon data (on Windows, once 10 min)
    * /dev/urandom (or equivalent)
    * rdrand (if available)
  * From scheduler when idle:
    * CPU cycle counter before and after 1ms sleep
  * At startup:
    * CPU cycle counter before and after 1ms sleep

  After this PR:
  * GetRand*:
    * Stack pointer (which indirectly identifies thread and some call stack information)
    * rdrand (if available)
    * CPU cycle counter
  * GetStrongRand*:
    * Stack pointer (which indirectly identifies thread and some call stack information)
    * rdrand (if available)
    * CPU cycle counter
    * /dev/urandom (or equivalent)
    * OpenSSL
    * CPU cycle counter again
  * From scheduler when idle:
    * Stack pointer (which indirectly identifies thread and some call stack information)
    * rdrand (if available)
    * CPU cycle counter before and after 1ms sleep
    * Perfmon data (on Windows, once every 10 min)
  * At startup:
    * Stack pointer (which indirectly identifies thread and some call stack information)
    * rdrand (if available)
    * CPU cycle counter
    * /dev/urandom (or equivalent)
    * OpenSSL
    * CPU cycle counter again
    * Perfmon data (on Windows, once every 10 min)

  The interface of random.h is also simplified, and documentation is added.

  This implements most of #14623.

Tree-SHA512: 0120e19bd4ce80a509b5c180a4f29497d299ce8242e25755880851344b825bc2d64a222bc245e659562fb5463fb7c70fbfcf003616be4dc59d0ed6534f93dd20
2019-01-21 19:46:45 +01:00
..
data Add deserialize + CheckBlock benchmarks, and a full block hex 2016-11-09 11:27:59 -08:00
.gitignore Ignore bench_bitcoin binary. 2015-10-06 17:46:12 +02:00
base58.cpp tests: Explicitly ignore the return value of DecodeBase58(...) 2018-11-05 16:52:59 +01:00
bech32.cpp scripted-diff: Move util files to separate directory. 2018-11-04 22:46:07 -08:00
bench.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
bench.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
bench_bitcoin.cpp Automatically initialize RNG on first use. 2019-01-16 15:46:27 -08:00
block_assemble.cpp Merge #13743: refactor: Replace boost::bind with std::bind 2018-12-29 14:14:26 +01:00
ccoins_caching.cpp Removed implicit CTransaction conversion from benchmaks 2018-12-11 19:43:35 -08:00
checkblock.cpp Don't access out of bounds array entry array[sizeof(array)] 2018-10-05 16:48:16 +09:00
checkqueue.cpp scripted-diff: Move util files to separate directory. 2018-11-04 22:46:07 -08:00
coin_selection.cpp bench: Destroy wallet txs instead of leaking their memory 2018-11-27 16:52:56 -05:00
crypto_hash.cpp Extract CSipHasher to it's own file in crypto/ directory. 2018-11-05 09:25:15 -08:00
duplicate_inputs.cpp Add Benchmark to test input de-duplication worst case 2018-11-25 10:53:20 +09:00
examples.cpp scripted-diff: Move util files to separate directory. 2018-11-04 22:46:07 -08:00
gcs_filter.cpp blockfilter: Refactor GCS params into struct. 2018-11-06 09:12:54 -08:00
lockedpool.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
mempool_eviction.cpp test: Add missing validation locks 2018-12-17 14:27:29 -05:00
merkle_root.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
prevector.cpp Drop defunct IS_TRIVIALLY_CONSTRUCTIBLE handling from prevector.h 2018-11-14 12:19:04 -05:00
rollingbloom.cpp Merge #13767: Remove redundant assignments (dead stores) 2018-08-27 13:39:46 -04:00
verify_script.cpp Merge #13666: Always create signatures with Low R values 2018-08-13 12:07:20 +02:00