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
) {}

Constructors

this
this(ubyte[] seed)
Undocumented in source.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

addSeed
void addSeed(ubyte[] seed)

add entropy to the generator

nextBytes
void nextBytes(ubyte[] buf)

Fill an arbitrary-size buffer with random data.

setSeed
void setSeed(ubyte[] seed)
Undocumented in source. Be warned that the author may not have intended to support it.

Manifest constants

isDeterministic
enum isDeterministic;
Undocumented in source.
name
enum name;

Name of the PRNG algorithm.

Parameters

Cipher

defines the underlying block cipher algorithm.

Digest

Underlying hash algorithm. Hash length has to be 256 bits (corresponds to used key size).

Meta