random

package
v2.0.0-...-f066f8d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2018 License: MPL-2.0 Imports: 3 Imported by: 21

Documentation

Overview

Package random provides facilities for generating random or pseudorandom cryptographic objects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bits

func Bits(bitlen uint, exact bool, rand cipher.Stream) []byte

Bits chooses a uniform random BigInt with a given maximum BitLen. If 'exact' is true, choose a BigInt with _exactly_ that BitLen, not less

func Bytes

func Bytes(b []byte, rand cipher.Stream)

Bytes fills a slice with random bytes from rand.

func Int

func Int(mod *big.Int, rand cipher.Stream) *big.Int

Int chooses a uniform random big.Int less than a given modulus

func New

func New() cipher.Stream

New returns a new cipher.Stream that gets random data from Go's crypto/rand package. The resulting cipher.Stream can be used in multiple threads.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL