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

Function SeedStrengthen

src/random.cpp:497–504  ·  view source on GitHub ↗

Extract entropy from rng, strengthen it, and feed it into hasher. */

Source from the content-addressed store, hash-verified

495
496/** Extract entropy from rng, strengthen it, and feed it into hasher. */
497static void SeedStrengthen(CSHA512& hasher, RNGState& rng, int microseconds) noexcept
498{
499 // Generate 32 bytes of entropy from the RNG, and a copy of the entropy already in hasher.
500 unsigned char strengthen_seed[32];
501 rng.MixExtract(strengthen_seed, sizeof(strengthen_seed), CSHA512(hasher), false);
502 // Strengthen the seed, and feed it into hasher.
503 Strengthen(strengthen_seed, microseconds, hasher);
504}
505
506static void SeedPeriodic(CSHA512& hasher, RNGState& rng) noexcept
507{

Callers 2

SeedPeriodicFunction · 0.85
SeedStartupFunction · 0.85

Calls 3

CSHA512Class · 0.85
StrengthenFunction · 0.85
MixExtractMethod · 0.80

Tested by

no test coverage detected