Documentation
¶
Overview ¶
Package bbs implements the Blum-Blum-Shub pseudo-random number generator. The implementation should be considered to be insecure. x(n+1)=x(n)^2 mod (p*q). p,q are large primes, gcd(φ(p − 1), φ(q − 1)) should be small. p and q, should both be congruent to 3 (mod 4) initial seed xn should be neither 1 or 0, and not divisible by p or q. xi = x0^(2^i mod lcm(p-1,q-1)) mod p*q
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Rand = rand.Reader
Rand is the upstream random source for initialisation
View Source
var Reader io.Reader
Reader is a conveniance reader
Functions ¶
Types ¶
type BBS ¶
type BBS struct { X0 *big.Int // x at 0 M *big.Int // M = p*q L *big.Int // lcm(p-1,q-1) Step int64 Maxbits int // log (bits M) // contains filtered or unexported fields }
BBS contains the state of a Blum-Blum-Shub
Click to show internal directories.
Click to hide internal directories.