diff --git a/src/crypto/sha512.h b/src/crypto/sha512.h index 01fd896aab..ccb7b7af2c 100644 --- a/src/crypto/sha512.h +++ b/src/crypto/sha512.h @@ -24,6 +24,7 @@ class CSHA512 CSHA512& Write(const unsigned char* data, size_t len); void Finalize(unsigned char hash[OUTPUT_SIZE]); CSHA512& Reset(); + uint64_t Size() const { return bytes; } }; void detect_sha512_hardware(void); diff --git a/src/random.cpp b/src/random.cpp index 80ec2a151f..1e00b6503f 100644 --- a/src/random.cpp +++ b/src/random.cpp @@ -444,7 +444,9 @@ static void SeedPeriodic(CSHA512& hasher, RNGState& rng) SeedTimestamp(hasher); // Dynamic environment data (performance monitoring, ...) + auto old_size = hasher.Size(); RandAddDynamicEnv(hasher); + LogPrintf("Feeding %i bytes of dynamic environment data into RNG\n", hasher.Size() - old_size); // Strengthen for 10 ms SeedStrengthen(hasher, rng, 10000); @@ -460,10 +462,12 @@ static void SeedStartup(CSHA512& hasher, RNGState& rng) noexcept SeedSlow(hasher); // Dynamic environment data (performance monitoring, ...) + auto old_size = hasher.Size(); RandAddDynamicEnv(hasher); // Static environment data RandAddStaticEnv(hasher); + LogPrintf("Feeding %i bytes of environment data into RNG\n", hasher.Size() - old_size); // Strengthen for 100 ms SeedStrengthen(hasher, rng, 100000);