randombytes

package
v0.0.0-...-dd73372 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2017 License: ISC Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

RandomBytesSalsa20Implementation contains a pointer to C.randombytes_salsa20_implementation This means that it can be used as an argument to RandomBytesSetImplementation

RandomBytesSysRandomImplementation contains a pointer to C.randombytes_sysrandom_implementation This means that it can be used as an argument to RandomBytesSetImplementation

Functions

func RandomBytes

func RandomBytes(size int) []byte

RandomBytes returns a specified number of random bytes. It is essentially a wrapper around RandomBytesBuf for convenience. Note that this behaviour is different than in NaCl and libsodium, where this function behaves the same as RandomBytesBuf.

func RandomBytesBuf

func RandomBytesBuf(buf []byte)

RandomBytesBuf fills a buffer with random bytes.

func RandomBytesBufDeterministic

func RandomBytesBufDeterministic(buf []byte, seed []byte)

RandomBytesBufDeterministic fills a buffer with bytes that are indistinguishable from random bytes without knowing seed.

func RandomBytesClose

func RandomBytesClose()

RandomBytesClose deallocates the resources used by the random number generator.

func RandomBytesImplementationName

func RandomBytesImplementationName() string

RandomBytesImplementationName returns the name of the random number generator that is being used.

func RandomBytesRandom

func RandomBytesRandom() uint32

RandomBytesRandom returns a random 32 bit unsigned integer.

func RandomBytesSeedBytes

func RandomBytesSeedBytes() int

RandomBytesSeedBytes returns the number of bytes required for seeding RandomBytesBufDeterministic.

func RandomBytesSetImplementation

func RandomBytesSetImplementation(impl *C.struct_randombytes_implementation) int

RandomBytesSetImplementation sets the implementation of the random number generator.

func RandomBytesStir

func RandomBytesStir()

RandomBytesStir reseeds the random number generator.

func RandomBytesUniform

func RandomBytesUniform(upperBound uint32) uint32

RandomBytesUniform returns a random number between 0 and an upper bound. The generated bytes have a uniform distribution between 0 and the upper bound.

Types

This section is empty.

Jump to

Keyboard shortcuts

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