Skip to content

Commit f70e0c8

Browse files
fanquakeFuzzbawls
authored andcommitted
doc: correct random.h docs after bitcoin#17270
1 parent c117d6b commit f70e0c8

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/random.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ static uint64_t GetRdSeed() noexcept
188188
/* Access to other hardware random number generators could be added here later,
189189
* assuming it is sufficiently fast (in the order of a few hundred CPU cycles).
190190
* Slower sources should probably be invoked separately, and/or only from
191-
* RandAddSeedSleep (which is called during idle background operation).
191+
* RandAddPeriodic (which is called once a minute).
192192
*/
193193
static void InitHardwareRand() {}
194194
static void ReportHardwareRand() {}

src/random.h

+7-7
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,17 @@
4141
* These entropy sources are slower, but designed to make sure the RNG state contains
4242
* fresh data that is unpredictable to attackers.
4343
*
44-
* - RandAddSeedSleep() seeds everything that fast seeding includes, but additionally:
45-
* - A high-precision timestamp before and after sleeping 1ms.
46-
* - (On Windows) Once every 10 minutes, performance monitoring data from the OS.
47-
- - Once every minute, strengthen the entropy for 10 ms using repeated SHA512.
48-
* These just exploit the fact the system is idle to improve the quality of the RNG
49-
* slightly.
44+
* - RandAddPeriodic() seeds everything that fast seeding includes, but additionally:
45+
* - A high-precision timestamp
46+
* - Dynamic environment data (performance monitoring, ...)
47+
* - Strengthen the entropy for 10 ms using repeated SHA512.
48+
* This is run once every minute.
5049
*
5150
* On first use of the RNG (regardless of what function is called first), all entropy
5251
* sources used in the 'slow' seeder are included, but also:
5352
* - 256 bits from the hardware RNG (rdseed or rdrand) when available.
54-
* - (On Windows) Performance monitoring data from the OS.
53+
* - Dynamic environment data (performance monitoring, ...)
54+
* - Static environment data
5555
* - Strengthen the entropy for 100 ms using repeated SHA512.
5656
*
5757
* When mixing in new entropy, H = SHA512(entropy || old_rng_state) is computed, and

0 commit comments

Comments
 (0)