MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / SeedStrengthen

Function SeedStrengthen

src/random.cpp:506–514  ·  view source on GitHub ↗

Extract entropy from rng, strengthen it, and feed it into hasher. */

Source from the content-addressed store, hash-verified

504
505/** Extract entropy from rng, strengthen it, and feed it into hasher. */
506void SeedStrengthen(CSHA512& hasher, RNGState& rng, SteadyClock::duration dur) noexcept
507{
508 // Generate 32 bytes of entropy from the RNG, and a copy of the entropy already in hasher.
509 // Never use the deterministic PRNG for this, as the result is only used internally.
510 unsigned char strengthen_seed[32];
511 rng.MixExtract(strengthen_seed, sizeof(strengthen_seed), CSHA512(hasher), false, /*always_use_real_rng=*/true);
512 // Strengthen the seed, and feed it into hasher.
513 Strengthen(strengthen_seed, dur, hasher);
514}
515
516void SeedPeriodic(CSHA512& hasher, RNGState& rng) noexcept
517{

Callers 2

SeedPeriodicFunction · 0.85
SeedStartupFunction · 0.85

Calls 2

CSHA512Class · 0.85
StrengthenFunction · 0.85

Tested by

no test coverage detected