WrappedStreamRNG

Takes a RandomStream (ex: SystemEntropyStream or HashDRBGStream) and wraps it into a UniformRNG InputRange.

Note that, to conform to the expected InputRange interface, this must keep a copy of the last generated value in memory. For security purposes, it may occasionally be appropriate to make an extra popFront() call before and/or after retreiving entropy values. This may decrease the chance of using a compromized entropy value in the event of a memory-sniffing attacker.

  1. struct WrappedStreamRNG(RandomStream, StaticUByteArr)
  2. struct WrappedStreamRNG(RandomStream, UIntType)
    struct WrappedStreamRNG (
    RandomStream
    UIntType
    ) if (
    isRandomStream!RandomStream &&
    isUnsigned!UIntType
    ) {}

Members

Functions

popFront
void popFront()

Implements an InputRange

Manifest constants

empty
enum empty;

Infinite range. Never empty.

isUniformRandom
enum isUniformRandom;

Mark this as a Rng

max
enum max;

Largest generated value.

min
enum min;

Smallest generated value.

Properties

front
UIntType front [@property getter]

Implements an InputRange

Meta