#include <FXSecure.h>
The great trouble with a source of true entropy like FX::Secure::Randomness is that there is very little new random information accumulated by a computer with time (unless additional hardware is fitted). Therefore it makes sense to seed a cryptographically secure random number generator with true randomness and use the generator to generate lots of nearly true randomness. This is similar to normal pseudo random number generators such as fxrandom()
, but the output is far more random plus the generated sequence is far longer.
Static Public Member Functions | |
static FXuval | readBlock (FXuchar *buffer, FXuval length) |
static void | freshen (FXuval amount) |
static FXuval | size () |
static FXuval FX::Secure::PRandomness::readBlock | ( | FXuchar * | buffer, | |
FXuval | length | |||
) | [static] |
Reads any quantity of nearly random data. Reasonably fast, but you wouldn't want it in a repetitive loop.
static void FX::Secure::PRandomness::freshen | ( | FXuval | amount | ) | [static] |
Freshens the generator with the specified number of bytes.
static FXuval FX::Secure::PRandomness::size | ( | ) | [inline, static] |
Returns how much randomness is already available. Always (FXuval)-1.