isaac

package module
v0.0.0-...-75fea99 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2014 License: MIT Imports: 3 Imported by: 1

README

This is a mildly ported version of Bob Jenkins' ISAAC, a fast 32-bit CSPRNG.

More information on the algorithm can be found at
http://www.burtleburtle.net/bob/rand/isaacafa.html

The code emits a stream of random uint32 and also supports Go's
crypto/cipher.Stream interface. Its output matches the official test vectors
for ISAAC, but I can't make any guarantees about the cryptographic qualities of
this code (especially the stream mode). Use at your own risk.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewISAACStream

func NewISAACStream(key string) cipher.Stream

Types

type ISAAC

type ISAAC struct {
	// contains filtered or unexported fields
}

func (*ISAAC) Rand

func (r *ISAAC) Rand() (number uint32)

retrieve the next number in the sequence

func (*ISAAC) Seed

func (r *ISAAC) Seed(key string)

there is no official method for doing this * the challenge code just memcpys the string to the top of the output array * and this is the best equivalent I could come up with in Go

func (*ISAAC) XORKeyStream

func (r *ISAAC) XORKeyStream(dst, src []byte)

implementation based on http://golang.org/src/pkg/crypto/cipher/ctr.go

Jump to

Keyboard shortcuts

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