![]() |
BSHA3
0.17.99
P2P Blockchain, based on Bitcoin
|
#include <random.h>#include <crypto/sha512.h>#include <support/cleanse.h>#include <logging.h>#include <sync.h>#include <utiltime.h>#include <stdlib.h>#include <chrono>#include <thread>#include <fcntl.h>#include <sys/time.h>#include <mutex>#include <openssl/err.h>#include <openssl/rand.h>Go to the source code of this file.
Functions | |
| void | RandAddSeed () |
| void | GetOSRand (unsigned char *ent32) |
| Get 32 bytes of system entropy. More... | |
| void | GetRandBytes (unsigned char *buf, int num) |
| Functions to gather random data via the OpenSSL PRNG. More... | |
| void | RandAddSeedSleep () |
| Add a little bit of randomness to the output of GetStrongRangBytes. More... | |
| void | GetStrongRandBytes (unsigned char *out, int num) |
| Function to gather random data from multiple sources, failing whenever any of those sources fail to provide a result. More... | |
| uint64_t | GetRand (uint64_t nMax) |
| int | GetRandInt (int nMax) |
| uint256 | GetRandHash () |
| bool | Random_SanityCheck () |
| Check that OS randomness is available and returning the requested number of bytes. More... | |
| void | RandomInit () |
| Initialize the RNG. More... | |
| void GetOSRand | ( | unsigned char * | ent32 | ) |
Get 32 bytes of system entropy.
Definition at line 204 of file random.cpp.
| uint64_t GetRand | ( | uint64_t | nMax | ) |
Definition at line 354 of file random.cpp.
| void GetRandBytes | ( | unsigned char * | buf, |
| int | num | ||
| ) |
Functions to gather random data via the OpenSSL PRNG.
Definition at line 275 of file random.cpp.
| uint256 GetRandHash | ( | ) |
Definition at line 374 of file random.cpp.
| int GetRandInt | ( | int | nMax | ) |
Definition at line 369 of file random.cpp.
| void GetStrongRandBytes | ( | unsigned char * | out, |
| int | num | ||
| ) |
Function to gather random data from multiple sources, failing whenever any of those sources fail to provide a result.
Definition at line 319 of file random.cpp.
| void RandAddSeed | ( | ) |
Definition at line 132 of file random.cpp.
| void RandAddSeedSleep | ( | ) |
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 other work to be done.
Definition at line 284 of file random.cpp.
| bool Random_SanityCheck | ( | ) |
Check that OS randomness is available and returning the requested number of bytes.
Definition at line 413 of file random.cpp.
| void RandomInit | ( | ) |
Initialize the RNG.
Definition at line 466 of file random.cpp.
1.8.14