Documentation ¶
Index ¶
- Constants
- Variables
- type Base
- type CTR
- type DRBG
- type Hash
- type Prng
- func NewCtrPrng(cipherProvider func(key []byte) (cipher.Block, error), keyLen int, ...) (*Prng, error)
- func NewGmCtrPrng(entropySource io.Reader, securityStrength int, securityLevel SecurityLevel, ...) (*Prng, error)
- func NewGmHashPrng(entropySource io.Reader, securityStrength int, securityLevel SecurityLevel, ...) (*Prng, error)
- func NewHashPrng(newHash func() hash.Hash, entropySource io.Reader, securityStrength int, ...) (*Prng, error)
- func NewNistCtrPrng(cipherProvider func(key []byte) (cipher.Block, error), keyLen int, ...) (*Prng, error)
- func NewNistHashPrng(newHash func() hash.Hash, entropySource io.Reader, securityStrength int, ...) (*Prng, error)
- type SecurityLevel
Constants ¶
View Source
const MaxBytes = 1 << 27
View Source
const MaxBytesPerGenerate = 1 << 11
View Source
const ReseedCounterIntervalLevelOne uint64 = 1 << 20
View Source
const ReseedCounterIntervalLevelTest uint64 = 8
View Source
const ReseedCounterIntervalLevelTwo uint64 = 1 << 10
View Source
const ReseedTimeIntervalLevelOne = time.Duration(600) * time.Second
View Source
const ReseedTimeIntervalLevelTest = time.Duration(6) * time.Second
View Source
const ReseedTimeIntervalLevelTwo = time.Duration(60) * time.Second
Variables ¶
View Source
var ErrReseedRequired = errors.New("reseed required")
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base struct {
// contains filtered or unexported fields
}
func (*Base) NeedReseed ¶
type CTR ¶
type CTR struct { Base // contains filtered or unexported fields }
func NewGmCTR ¶
func NewGmCTR(securityLevel SecurityLevel, entropy, nonce, personalization []byte) (*CTR, error)
func NewNistCTR ¶
func (*CTR) MaxBytesPerRequest ¶
type Hash ¶
type Hash struct { Base // contains filtered or unexported fields }
func NewGmHash ¶
func NewGmHash(securityLevel SecurityLevel, entropy, nonce, personalization []byte) (*Hash, error)
func NewNistHash ¶
func (*Hash) MaxBytesPerRequest ¶
type Prng ¶
type Prng struct {
// contains filtered or unexported fields
}
func NewCtrPrng ¶
func NewGmCtrPrng ¶
func NewGmHashPrng ¶
func NewHashPrng ¶
func NewNistCtrPrng ¶
func NewNistHashPrng ¶
type SecurityLevel ¶
type SecurityLevel byte
const ( SecurityLevelOne SecurityLevel = 0x01 SecurityLevelTwo SecurityLevel = 0x02 SecurityLevelTest SecurityLevel = 0x99 )
Click to show internal directories.
Click to hide internal directories.