| 534 | } |
| 535 | |
| 536 | void SeedStartup(CSHA512& hasher, RNGState& rng) noexcept |
| 537 | { |
| 538 | // Gather 256 bits of hardware randomness, if available |
| 539 | SeedHardwareSlow(hasher); |
| 540 | |
| 541 | // Everything that the 'slow' seeder includes. |
| 542 | SeedSlow(hasher, rng); |
| 543 | |
| 544 | // Dynamic environment data (clocks, resource usage, ...) |
| 545 | auto old_size = hasher.Size(); |
| 546 | RandAddDynamicEnv(hasher); |
| 547 | |
| 548 | // Static environment data |
| 549 | RandAddStaticEnv(hasher); |
| 550 | LogDebug(BCLog::RAND, "Feeding %i bytes of environment data into RNG\n", hasher.Size() - old_size); |
| 551 | |
| 552 | // Strengthen for 100 ms |
| 553 | SeedStrengthen(hasher, rng, 100ms); |
| 554 | } |
| 555 | |
| 556 | enum class RNGLevel { |
| 557 | FAST, //!< Automatically called by GetRandBytes |
no test coverage detected