Documentation ¶
Index ¶
Constants ¶
const SeedLength = 16 + siphash.Size
SeedLength is the number of bytes a drbg seed takes in memory.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HashDrbg ¶
type HashDrbg struct {
// contains filtered or unexported fields
}
HashDrbg is a CSDRBG based off of SipHash-2-4 in OFB mode.
func NewHashDrbg ¶
NewHashDrbg creates a deterministic random number generator from a provided Seed.
func (*HashDrbg) RandomUint32 ¶
RandomUint32 provides the next block of the random number generator as an integer.
func (*HashDrbg) RandomUint64 ¶
RandomUint64 provides the next block of the random number generator as a long integer.
type Seed ¶
type Seed struct {
// contains filtered or unexported fields
}
Seed holds the state of a deterministic HashDrbg. - SipHash-2-4 keys: key0 and key1 - 8 byte nonce (initialization vector)
func (*Seed) KeyUint128 ¶
KeyUint128 provides a representation of the underlying key as two 64bit ints.
func (*Seed) MarshalBinary ¶
MarshalBinary creates a byte array representation of a Seed.
func (*Seed) MarshalText ¶
MarshalText serializes the seed to textual representation
func (*Seed) UnmarshalBinary ¶
UnmarshalBinary reconstructs a Seed from a binary implementation, implementing the interface.
func (*Seed) UnmarshalText ¶
UnmarshalText restores the seed from a Text representation.