Extract entropy from rng, strengthen it, and feed it into hasher. */
| 504 | |
| 505 | /** Extract entropy from rng, strengthen it, and feed it into hasher. */ |
| 506 | void SeedStrengthen(CSHA512& hasher, RNGState& rng, SteadyClock::duration dur) noexcept |
| 507 | { |
| 508 | // Generate 32 bytes of entropy from the RNG, and a copy of the entropy already in hasher. |
| 509 | // Never use the deterministic PRNG for this, as the result is only used internally. |
| 510 | unsigned char strengthen_seed[32]; |
| 511 | rng.MixExtract(strengthen_seed, sizeof(strengthen_seed), CSHA512(hasher), false, /*always_use_real_rng=*/true); |
| 512 | // Strengthen the seed, and feed it into hasher. |
| 513 | Strengthen(strengthen_seed, dur, hasher); |
| 514 | } |
| 515 | |
| 516 | void SeedPeriodic(CSHA512& hasher, RNGState& rng) noexcept |
| 517 | { |
no test coverage detected