| 473 | } |
| 474 | |
| 475 | static 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. */ |
| 497 | static void SeedStrengthen(CSHA512& hasher, RNGState& rng, int microseconds) noexcept |
no test coverage detected