void AutoSeededRandomPool::Reseed(bool blocking, unsigned int seedSize) { #ifdef NONBLOCKING_RNG_AVAILABLE if (blocking) #endif { #ifdef BLOCKING_RNG_AVAILABLE BlockingRng rng; SecByteBlock seed(seedSize); rng.GenerateBlock(seed, seedSize); Put(seed, seedSize); #endif } #ifdef BLOCKING_RNG_AVAILABLE if (!blocking) #endif { #ifdef NONBLOCKING_RNG_AVAILABLE NonblockingRng rng; SecByteBlock seed(seedSize); rng.GenerateBlock(seed, seedSize); Put(seed, seedSize); #endif } }
void OS_GenerateRandomBlock(bool blocking, byte *output, size_t size) { #ifdef NONBLOCKING_RNG_AVAILABLE if (blocking) #endif { #ifdef BLOCKING_RNG_AVAILABLE BlockingRng rng; rng.GenerateBlock(output, size); #endif } #ifdef BLOCKING_RNG_AVAILABLE if (!blocking) #endif { #ifdef NONBLOCKING_RNG_AVAILABLE NonblockingRng rng; rng.GenerateBlock(output, size); #endif } }