File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed
Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ class CSHA512
2323 CSHA512& Write (const unsigned char * data, size_t len);
2424 void Finalize (unsigned char hash[OUTPUT_SIZE]);
2525 CSHA512& Reset ();
26+ uint64_t Size () const { return bytes; }
2627};
2728
2829#endif // BITCOIN_CRYPTO_SHA512_H
Original file line number Diff line number Diff line change @@ -525,7 +525,9 @@ static void SeedPeriodic(CSHA512& hasher, RNGState& rng)
525525 SeedTimestamp (hasher);
526526
527527 // Dynamic environment data (performance monitoring, ...)
528+ auto old_size = hasher.Size ();
528529 RandAddDynamicEnv (hasher);
530+ LogPrintf (" Feeding %i bytes of dynamic environment data into RNG\n " , hasher.Size () - old_size);
529531
530532 // Strengthen for 10 ms
531533 SeedStrengthen (hasher, rng, 10000 );
@@ -540,10 +542,12 @@ static void SeedStartup(CSHA512& hasher, RNGState& rng) noexcept
540542 SeedSlow (hasher);
541543
542544 // Dynamic environment data (performance monitoring, ...)
545+ auto old_size = hasher.Size ();
543546 RandAddDynamicEnv (hasher);
544547
545548 // Static environment data
546549 RandAddStaticEnv (hasher);
550+ LogPrintf (" Feeding %i bytes of environment data into RNG\n " , hasher.Size () - old_size);
547551
548552 // Strengthen for 100 ms
549553 SeedStrengthen (hasher, rng, 100000 );
You can’t perform that action at this time.
0 commit comments