Documentation ¶
Overview ¶
Package rand provides facilities for generating random or pseudorandom cryptographic objects.
XXX this package might go away and get subsumed by the currently equivalent abstract.Stream type.
Index ¶
- Variables
- func Bits(bitlen uint, exact bool, rand cipher.Stream) []byte
- func Bool(rand cipher.Stream) bool
- func Byte(rand cipher.Stream) byte
- func Bytes(n int, rand cipher.Stream) []byte
- func Int(mod *big.Int, rand cipher.Stream) *big.Int
- func NonZeroBytes(n int, rand cipher.Stream) []byte
- func Uint16(rand cipher.Stream) uint16
- func Uint32(rand cipher.Stream) uint32
- func Uint64(rand cipher.Stream) uint64
- func Uint8(rand cipher.Stream) uint8
Constants ¶
This section is empty.
Variables ¶
var Stream cipher.Stream = new(randstream)
Standard virtual "stream cipher" that just generates fresh cryptographically strong random bits.
Functions ¶
func Bits ¶
Choose a uniform random BigInt with a given maximum BitLen. If 'exact' is true, choose a BigInt with _exactly_ that BitLen, not less
func NonZeroBytes ¶
NonZeroBytes calls Bytes as long as it gets a slice full of '0's. This is needed when using suite.Cipher(abstract.NoKey) because the first 6 iterations returns 0000...000 as bytes for edwards & ed25519 cipher. XXX Issue reported in https://github.com/dedis/crypto/issues/70
Types ¶
This section is empty.