FortunaGenerator

This PRNG forms a base component of the Fortuna PRNG as proposed by Bruce Schneier & Niels Ferguson (PRNG with input). The Generator can be used stand alone as deterministic PRNG (DRNG). It won't gather entropy on its own and provided with the same seed it will always generate the same sequence of bytes for the same underlying block cipher and hash algorithm.

Note: Generator MUST be seeded before generating pseudo random data either with addSeed() or by passing the seed to the constructor.

@safe
struct FortunaGenerator (
Cipher
Digest
) if (
isBlockCipher!Cipher &&
isDigest!Digest
&&
Digest.digestLength == 32
) {
enum isDeterministic;
enum name;
}

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Members

Functions

addSeed
void addSeed(in ubyte[] seed...)

add entropy to the generator

nextBytes
void nextBytes(ubyte[] buf)

Fill an arbitrary-size buffer with random data.

Meta