Changeset View
Changeset View
Standalone View
Standalone View
src/random.h
Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | |||||
* SHA512. | * SHA512. | ||||
* These just exploit the fact the system is idle to improve the quality | * These just exploit the fact the system is idle to improve the quality | ||||
* of the RNG slightly. | * of the RNG slightly. | ||||
* | * | ||||
* On first use of the RNG (regardless of what function is called first), all | * 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: | * entropy sources used in the 'slow' seeder are included, but also: | ||||
* - 256 bits from the hardware RNG (rdseed or rdrand) when available. | * - 256 bits from the hardware RNG (rdseed or rdrand) when available. | ||||
* - (On Windows) Performance monitoring data from the OS. | * - (On Windows) Performance monitoring data from the OS. | ||||
* - (On Windows) Through OpenSSL, the screen contents. | |||||
* - Strengthen the entropy for 100 ms using repeated SHA512. | * - Strengthen the entropy for 100 ms using repeated SHA512. | ||||
* | * | ||||
* When mixing in new entropy, H = SHA512(entropy || old_rng_state) is computed, | * 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 | * and (up to) the first 32 bytes of H are produced as output, while the last 32 | ||||
* bytes become the new RNG state. | * bytes become the new RNG state. | ||||
*/ | */ | ||||
/** | /** | ||||
▲ Show 20 Lines • Show All 193 Lines • Show Last 20 Lines |