Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PRNGFactory ¶
PRNGFactory is function, which creates RNG from seed.
type RNG ¶
RNG is extension for any io.Reader, which is RNG. USE WITH CAUTION, IN ORDER NOT TO WRAP INVALID READER AS RNG!!!
func DefaultRNG ¶
func DefaultRNG() RNG
DefaultRNG returns default RNG. It's used when it's required and not provided in options.
func FastRNG ¶
FastRNG creates NewSource from math/rand form golang STL. This RNG IS NOT cryptographically secure and SHOULD NOT be used for crypto.
func GetRNG ¶
func GetRNG(options interface{}) (rng RNG)
GetRNG returns RNG from options or DefaultRNG.
func NewChaCha20RNG ¶
NewChaCha20RNG creates ChaCha20 based RNG from specified seed. Seed has to be 32 bytes long. It can be extended with hash function if needed.
type RNGOptions ¶
type RNGOptions interface {
GetRNG() RNG
}
RNGOptions is kind of options, which provides custom RNG.