Documentation ¶
Index ¶
Constants ¶
View Source
const (
L = 32
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlumBlumShub ¶
func NewBlumBlumShub ¶
func NewBlumBlumShub() BlumBlumShub
func (*BlumBlumShub) Bit ¶
func (b *BlumBlumShub) Bit() uint32
func (*BlumBlumShub) Seed ¶
p: large prime congruent to 3 mod 4, with small gcd(φ(p-1), φ(q-1)) q: large prime congruent to 3 mod 4, with small gcd(φ(p-1), φ(q-1)) s: integer coprime to M=PQ, not 0 or 1
func (*BlumBlumShub) Urand32 ¶
func (b *BlumBlumShub) Urand32() uint32
We generate uint32 from the LSB of 32 terms. Therefore the periodicity really needs to be a large multiple of that. @TODO: determine bits we can extract using http://www.win.tue.nl/~berry/papers/ima05bbs.pdf @TODO: refactor PRNGs to output specified n bits as opposed to uint32.
type BlumMicali ¶
func NewBlumMicali ¶
func NewBlumMicali() BlumMicali
func (*BlumMicali) Bit ¶
func (b *BlumMicali) Bit() uint32
func (*BlumMicali) Urand32 ¶
func (b *BlumMicali) Urand32() uint32
type DualECDRBG ¶
type DualECDRBG struct { C *ec.PrimeCurve Q *ec.Point S *big.Int Sp *ec.Point Z *big.Int Zp *ec.Point ZBytes []byte StateIndex uint64 StateBit uint32 }
func NewDualECDRBG ¶
func NewDualECDRBG(c *ec.PrimeCurve, qx, qy, seed *big.Int) *DualECDRBG
func (*DualECDRBG) Bit ¶
func (g *DualECDRBG) Bit() uint32
func (*DualECDRBG) Byte ¶
func (g *DualECDRBG) Byte() byte
func (*DualECDRBG) Bytes ¶
func (g *DualECDRBG) Bytes(length uint32) []byte
func (*DualECDRBG) Selfcheck ¶
func (g *DualECDRBG) Selfcheck() error
func (*DualECDRBG) Urand32 ¶
func (g *DualECDRBG) Urand32() uint32
type MersenneTwister ¶
type MersenneTwister struct { State [mersenne_twister_n]uint32 // contains filtered or unexported fields }
func NewMersenneTwister ¶
func NewMersenneTwister(seed uint32) MersenneTwister
func (*MersenneTwister) SeedFromUrand32s ¶
func (m *MersenneTwister) SeedFromUrand32s(urand32s [mersenne_twister_n]uint32)
func (*MersenneTwister) Urand32 ¶
func (m *MersenneTwister) Urand32() uint32
func (*MersenneTwister) Urand32ToState ¶
func (m *MersenneTwister) Urand32ToState(urand32 uint32) uint32
type TauswortheGenerator ¶
func NewTauswortheGenerator ¶
func NewTauswortheGenerator() TauswortheGenerator
func NewTauswortheGeneratorFromJSON ¶
func NewTauswortheGeneratorFromJSON(tg_json []byte) (TauswortheGenerator, error)
func NewTauswortheGeneratorFromJSONFile ¶
func NewTauswortheGeneratorFromJSONFile(jpath string) (TauswortheGenerator, error)
func (*TauswortheGenerator) AsJSON ¶
func (t *TauswortheGenerator) AsJSON() ([]byte, error)
func (*TauswortheGenerator) Bit ¶
func (t *TauswortheGenerator) Bit() uint32
func (*TauswortheGenerator) Seed ¶
func (t *TauswortheGenerator) Seed(seed uint32)
func (*TauswortheGenerator) Urand32 ¶
func (t *TauswortheGenerator) Urand32() uint32
Source Files ¶
Click to show internal directories.
Click to hide internal directories.