| 524 | } |
| 525 | |
| 526 | static 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 | |
| 546 | enum class RNGLevel { |
| 547 | FAST, //!< Automatically called by GetRandBytes |
no test coverage detected