Fabcoin Core  0.16.2
P2P Digital Currency
Classes | Functions
random.h File Reference
#include <crypto/chacha20.h>
#include <crypto/common.h>
#include <uint256.h>
#include <stdint.h>
Include dependency graph for random.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  FastRandomContext
 Fast randomness source. More...
 

Functions

void RandAddSeed ()
 
void GetRandBytes (unsigned char *buf, int num)
 Functions to gather random data via the OpenSSL PRNG. More...
 
uint64_t GetRand (uint64_t nMax)
 
int GetRandInt (int nMax)
 
uint256 GetRandHash ()
 
void RandAddSeedSleep ()
 Add a little bit of randomness to the output of GetStrongRangBytes. More...
 
void GetStrongRandBytes (unsigned char *buf, int num)
 Function to gather random data from multiple sources, failing whenever any of those source fail to provide a result. More...
 
void GetOSRand (unsigned char *ent32)
 Get 32 bytes of system entropy. More...
 
bool Random_SanityCheck ()
 Check that OS randomness is available and returning the requested number of bytes. More...
 
void RandomInit ()
 Initialize the RNG. More...
 

Function Documentation

void GetOSRand ( unsigned char *  ent32)

Get 32 bytes of system entropy.

Do not use this in application code: use GetStrongRandBytes instead.

Definition at line 202 of file random.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

uint64_t GetRand ( uint64_t  nMax)

Definition at line 352 of file random.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void GetRandBytes ( unsigned char *  buf,
int  num 
)

Functions to gather random data via the OpenSSL PRNG.

Definition at line 273 of file random.cpp.

Here is the caller graph for this function:

uint256 GetRandHash ( )

Definition at line 372 of file random.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int GetRandInt ( int  nMax)

Definition at line 367 of file random.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void GetStrongRandBytes ( unsigned char *  buf,
int  num 
)

Function to gather random data from multiple sources, failing whenever any of those source fail to provide a result.

Definition at line 317 of file random.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void RandAddSeed ( )

Definition at line 130 of file random.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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 282 of file random.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool Random_SanityCheck ( )

Check that OS randomness is available and returning the requested number of bytes.

Definition at line 411 of file random.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void RandomInit ( )

Initialize the RNG.

Definition at line 464 of file random.cpp.

Here is the caller graph for this function: