MCPcopy Create free account
hub / github.com/ElementsProject/elements / SeedSlow

Function SeedSlow

src/random.cpp:475–494  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

473}
474
475static void SeedSlow(CSHA512& hasher, RNGState& rng) noexcept
476{
477 unsigned char buffer[32];
478
479 // Everything that the 'fast' seeder includes
480 SeedFast(hasher);
481
482 // OS randomness
483 GetOSRand(buffer);
484 hasher.Write(buffer, sizeof(buffer));
485
486 // Add the events hasher into the mix
487 rng.SeedEvents(hasher);
488
489 // High-precision timestamp.
490 //
491 // Note that we also commit to a timestamp in the Fast seeder, so we indirectly commit to a
492 // benchmark of all the entropy gathering sources in this function).
493 SeedTimestamp(hasher);
494}
495
496/** Extract entropy from rng, strengthen it, and feed it into hasher. */
497static void SeedStrengthen(CSHA512& hasher, RNGState& rng, int microseconds) noexcept

Callers 2

SeedStartupFunction · 0.85
ProcRandFunction · 0.85

Calls 5

SeedFastFunction · 0.85
GetOSRandFunction · 0.85
SeedTimestampFunction · 0.85
SeedEventsMethod · 0.80
WriteMethod · 0.45

Tested by

no test coverage detected