RandomTools[BlumBlumShub][NewBitGenerator] - Blum, Blum and Shub Pseudo Random Bit Generator
|
Calling Sequence
|
|
NewBitGenerator( seed, opt1, opt2, ... )
|
|
Parameters
|
|
seed
|
-
|
an integer, the seed for the generator
|
opt1, opt2, ...
|
-
|
(optional) argument of the form option=value where option is one of primes, numbits, or output
|
|
|
|
|
Description
|
|
•
|
The NewBitGenerator command outputs a Maple procedure, a pseudo-random bit generator, which when called outputs one pseudo-random bit, a 0 or 1. The generator is a Blum-Blum-Shub (BBS) generator. A BBS generator uses the following quadratic recurrence to generate a sequence of integers from which cryptographically secure pseudo-random bits are extracted:
|
|
- n is a product of two large primes p and q
|
|
- and
|
|
- is determined from the seed s.
|
•
|
The cryptographic security of the BBS generator assumes that the number theoretic problem of distinguishing a quadratic residue from a pseudo-square in Z mod n is computationally infeasible when n is the product of two primes p and q and the factorization of n is not known. Thus it also assumes that integer factorization is computationally infeasible. Recall the definitions of a quadratic residue and pseudo-square:
|
|
Definition: An integer x in Z mod n is a quadratic residue if (i) and (ii) for some integer y.
|
|
Definition: An integer z in Z mod n where is a pseudo square if (i) and (ii) z is not a quadratic residue in Z mod p and (iii) z is not a quadratic residue in Z mod q.
|
•
|
The following optional arguments are supported. They are input as equations in any order.
|
|
This specifies how many bits are computed and output by each call to the generator. The default is 1.
|
|
This specifies how the bits are output. If integer is specified, the output is a Maple integer in the range 0 to 2^b-1. If bits is specified, the output will be a Maple sequence of b bits. The default is bits.
|
•
|
The RandomTools[BlumBlumShub] module also exports the NewGenerator function. This function's interface is compatible with the NewGenerator functions of other RandomTools pseudo-random number generator subpackages.
|
|
|
Examples
|
|
>
|
|
| (1) |
>
|
|
>
|
|
| (2) |
>
|
|
| (3) |
>
|
|
| (4) |
>
|
|
| (5) |
>
|
|
>
|
|
| (6) |
>
|
|
| (7) |
>
|
|
>
|
|
| (8) |
>
|
|
| (9) |
|
|