Documentation ¶
Overview ¶
Package drbg implements a minimalistic DRBG based off SipHash-2-4 in OFB mode.
Index ¶
Constants ¶
const SeedLength = 16 + Size
SeedLength is the length of the HashDrbg seed.
const Size = siphash.Size
Size is the length of the HashDrbg output.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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 makes a HashDrbg instance based off an optional seed. The seed is truncated to SeedLength.
type InvalidSeedLengthError ¶
type InvalidSeedLengthError int
InvalidSeedLengthError is the error returned when the seed provided to the DRBG is an invalid length.
func (InvalidSeedLengthError) Error ¶
func (e InvalidSeedLengthError) Error() string
type Seed ¶
type Seed [SeedLength]byte
Seed is the initial state for a HashDrbg. It consists of a SipHash-2-4 key, and 8 bytes of initial data.
func SeedFromBytes ¶
SeedFromBytes creates a Seed from the raw bytes, truncating to SeedLength as appropriate.
func SeedFromHex ¶
SeedFromHex creates a Seed from the hexdecimal representation, truncating to SeedLength as appropriate.
func (*Seed) Bytes ¶
func (seed *Seed) Bytes() *[SeedLength]byte
Bytes returns a pointer to the raw HashDrbg seed.