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

Function SeedSlow

src/random.cpp:484–503  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

482}
483
484void SeedSlow(CSHA512& hasher, RNGState& rng) noexcept
485{
486 unsigned char buffer[32];
487
488 // Everything that the 'fast' seeder includes
489 SeedFast(hasher);
490
491 // OS randomness
492 GetOSRand(buffer);
493 hasher.Write(buffer, sizeof(buffer));
494
495 // Add the events hasher into the mix
496 rng.SeedEvents(hasher);
497
498 // High-precision timestamp.
499 //
500 // Note that we also commit to a timestamp in the Fast seeder, so we indirectly commit to a
501 // benchmark of all the entropy gathering sources in this function).
502 SeedTimestamp(hasher);
503}
504
505/** Extract entropy from rng, strengthen it, and feed it into hasher. */
506void SeedStrengthen(CSHA512& hasher, RNGState& rng, SteadyClock::duration dur) noexcept

Callers 2

SeedStartupFunction · 0.85
ProcRandFunction · 0.85

Calls 4

SeedFastFunction · 0.85
GetOSRandFunction · 0.85
SeedTimestampFunction · 0.85
WriteMethod · 0.45

Tested by

no test coverage detected