Documentation ¶
Overview ¶
drbg implemented deterministic random bit generator as defined in TTAK.KO-12.0331, TTAK.KO-12.0332, TTAK.KO-12.0189/R1, NIST SP 800-90A.
Index ¶
- type DRBG
- type Entropy
- type Option
- func WithCTRLength(ctrLen int) Option
- func WithCustomEntropy(entropy Entropy) Option
- func WithDerivationFunction(require bool) Option
- func WithInstantiateEntropy(entropyInput []byte) Option
- func WithNonce(nonce []byte) Option
- func WithPersonalizationString(personalizationString []byte) Option
- func WithPredictionResistance(require bool) Option
- func WithReseedInterval(reseedInterval uint64) Option
- func WithStrengthBits(value int) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DRBG ¶
type DRBG interface { io.Reader io.Closer Generate(dst []byte, additionalInput []byte) (n int, err error) Reseed(additionalInput []byte) error ReseedWithEntropy(additionalInput, entropyInput []byte) error }
func NewCTRDRBG ¶
func NewCTRDRBG( newCipher func(key []byte) (cipher.Block, error), keySize int, options ...Option, ) (DRBG, error)
NewCTRDRBG Deterministic Random Bit Generator based on Block Cipher
default entropy: if requireDerivationFunction is true, NewEntropy(rand.Reader, strengthBits), otherwise NewEntropy(rand.Reader, blocksize + keysize) If strengthBits is unset or smaller than keySize, strengthBits is set to keySize.
TTAK.KO-12.0189/R1
func NewHMACDRGB ¶
New Deterministic Random Bit Generator based on HMAC
default entropy: if requireDerivationFunction is true, NewEntropy(rand.Reader, strengthBits, strengthBits*2), otherwise NewEntropy(rand.Reader, blocksize + keysize, blocksize + keysize) If strengthBits is unset or smaller than keySize, strengthBits is set to keySize.
TTAK.KO-12.0332
func NewHashDRGB ¶
New Deterministic Random Bit Generator based on Hash Function
default entropy: if requireDerivationFunction is true, NewEntropy(rand.Reader, strengthBits, strengthBits*2), otherwise NewEntropy(rand.Reader, blocksize + keysize, blocksize + keysize) If strengthBits is unset or smaller than keySize, strengthBits is set to keySize.
TTAK.KO-12.0331
type Option ¶
type Option func(args *args)