Documentation ¶
Index ¶
Constants ¶
const MaxBytesPerGenerate = 937 // ~ 7500bits/8
*937 bytes (~7500 bits) as per the spec.
const MaxEntropyBytes = 125 // = 1000bits
*Entropy for NewHmacDrbg() and Reseed() must never exceed this number of bytes.
const MaxPersonalizationBytes = 32 // = 256bits
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HmacDrbg ¶
type HmacDrbg struct { /**The effective security level (eg 128 bits) which this generator was instantiated with.*/ SecurityLevelBits int // contains filtered or unexported fields }
func NewHmacDrbg ¶
*Create a new DRBG. desiredSecurityLevelBits must be one of 112, 128, 192, 256.
entropy length (in bits) must be at least 1.5 times securityLevelBits. entropy byte length cannot exceed MaxEntropyBytes.
The personalization can be nil. If non-nil, it's byte length cannot exceed MaxPersonalizationBytes.
If any of the parameters are out-of-range this function will panic.
type HmacDrbgReader ¶
type HmacDrbgReader struct { Drbg *HmacDrbg // contains filtered or unexported fields }
*Read from an arbitrary number of bytes from HmacDrbg efficiently. Internally it generates blocks of MaxBytesPerGenerate. It then serves these out through the standard `Read` function. Read returns an error if reseed becomes is necessary.
func NewHmacDrbgReader ¶
func NewHmacDrbgReader(drbg *HmacDrbg) *HmacDrbgReader