Changeset View
Changeset View
Standalone View
Standalone View
src/random.h
Show All 29 Lines | |||||
* Add a little bit of randomness to the output of GetStrongRangBytes. | * Add a little bit of randomness to the output of GetStrongRangBytes. | ||||
* This sleeps for a millisecond, so should only be called when there is no | * This sleeps for a millisecond, so should only be called when there is no | ||||
* other work to be done. | * other work to be done. | ||||
*/ | */ | ||||
void RandAddSeedSleep(); | void RandAddSeedSleep(); | ||||
/** | /** | ||||
* Function to gather random data from multiple sources, failing whenever any of | * Function to gather random data from multiple sources, failing whenever any of | ||||
* those source fail to provide a result. | * those sources fail to provide a result. | ||||
*/ | */ | ||||
void GetStrongRandBytes(uint8_t *buf, int num); | void GetStrongRandBytes(uint8_t *buf, int num); | ||||
/** | /** | ||||
* Fast randomness source. This is seeded once with secure random data, but is | * Fast randomness source. This is seeded once with secure random data, but is | ||||
* completely deterministic and insecure after that. | * completely deterministic and insecure after that. | ||||
* This class is not thread-safe. | * This class is not thread-safe. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 150 Lines • Show Last 20 Lines |