FX::Secure::PRandomness Class Reference
[Writing secure code]

#include <FXSecure.h>

List of all members.


Detailed Description

A cryptographically secure source of pseudo entropy.

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.

Note:
This module requires support for the OpenSSL library to be compiled in

Static Public Member Functions

static FXuval readBlock (FXuchar *buffer, FXuval length)
static void freshen (FXuval amount)
static FXuval size ()

Member Function Documentation

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.


The documentation for this class was generated from the following file:

(C) 2002-2008 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Jun 13 22:30:27 2008 for TnFOX by doxygen v1.5.6