Skip to content

Commit

Permalink
Document strenghtening
Browse files Browse the repository at this point in the history
Cherry-picked from: 3cb9ce8
  • Loading branch information
sipa authored and xanimo committed Apr 3, 2024
1 parent d171765 commit 33d4804
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/random.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,15 @@
* - RandAddSeedSleep() seeds everything that fast seeding includes, but additionally:
* - A high-precision timestamp before and after sleeping 1ms.
* - (On Windows) Once every 10 minutes, performance monitoring data from the OS.
- - Once every minute, strengthen the entropy for 10 ms using repeated SHA512.
* These just exploit the fact the system is idle to improve the quality of the RNG
* slightly.
*
* On first use of the RNG (regardless of what function is called first), all entropy
* sources used in the 'slow' seeder are included, but also:
* - (On Windows) Performance monitoring data from the OS.
* - (On Windows) Through OpenSSL, the screen contents.
* - Strengthen the entropy for 100 ms using repeated SHA512.
*
* When mixing in new entropy, H = SHA512(entropy || old_rng_state) is computed, and
* (up to) the first 32 bytes of H are produced as output, while the last 32 bytes
Expand Down

0 comments on commit 33d4804

Please sign in to comment.