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

Function SeedStartup

src/random.cpp:526–544  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

524}
525
526static void SeedStartup(CSHA512& hasher, RNGState& rng) noexcept
527{
528 // Gather 256 bits of hardware randomness, if available
529 SeedHardwareSlow(hasher);
530
531 // Everything that the 'slow' seeder includes.
532 SeedSlow(hasher, rng);
533
534 // Dynamic environment data (performance monitoring, ...)
535 auto old_size = hasher.Size();
536 RandAddDynamicEnv(hasher);
537
538 // Static environment data
539 RandAddStaticEnv(hasher);
540 LogPrint(BCLog::RAND, "Feeding %i bytes of environment data into RNG\n", hasher.Size() - old_size);
541
542 // Strengthen for 100 ms
543 SeedStrengthen(hasher, rng, 100000);
544}
545
546enum class RNGLevel {
547 FAST, //!< Automatically called by GetRandBytes

Callers 1

ProcRandFunction · 0.85

Calls 6

SeedHardwareSlowFunction · 0.85
SeedSlowFunction · 0.85
RandAddDynamicEnvFunction · 0.85
RandAddStaticEnvFunction · 0.85
SeedStrengthenFunction · 0.85
SizeMethod · 0.45

Tested by

no test coverage detected