HashDRBGStream

Cryptographic random number generator Hash_DRBG, as defined in NIST's SP800-90A.

TSHA: Any SHA-1 or SHA-2 digest type. Default is SHA512.

custom: Hash_DRBG's personalization string. You can optionally set this to any specific value of your own choosing for improved security.

Members

Functions

read
void read(ubyte[] buf, ubyte[] overrideExtraInput)
void read(ubyte[] buf, Flag!"PredictionResistance" overridePredictionResistance)

Fills the buffer with random values using the Hash_DRBG algorithm.

read
void read(ubyte[] buf)
void read(ubyte[] buf, Flag!"PredictionResistance" overridePredictionResistance, ubyte[] overrideExtraInput)

Fills the buffer with random values using the Hash_DRBG algorithm.

Manifest constants

isUniformRandomStream
enum isUniformRandomStream;

Mark this as a Rng Stream

Variables

extraInput
ubyte[] extraInput;

Further improve security by setting Hash_DRBG's optional "additional input" for each call to read(). This can be set to a new value before each read() call for maximum effect.

predictionResistance
Flag!"PredictionResistance" predictionResistance;

Set to Yes.PredictionResistance for additional protection against prediction attacks by forcing a reseed with fresh entropy for each call to read(). Reset back to No.PredictionResistance afterwords for faster, but still cryptographically-secure, operation when you're done with extra-elevated security needs.

Meta