resource generateBlumInt(
Math_Random
$source, int
$bits)
|
|
Returns a random Blum prime with requested length
Returns an Blum prime with length of at least $bits. A Blum prime is a prime that has a modulo 4 residue of 3. The returned value is a gmp resource.
Tags:
Parameters:
Return maximum supported integer
The value returned by this function is the upper limit to the getInteger method parameters. Values above this are not supported by the used class and will most likely not work.
Tags:
Overrides
Math_Random::getMaxInteger() (Return maximum supported integer)
Return minimum supported integer
The value returned by this function is the lower limit to the getInteger method parameters. Values below this are not supported by the used class and will most likely not work.
Tags:
Overrides
Math_Random::getMinInteger() (Return minimum supported integer)
string getString(
int
$len)
|
|
Get a string of random characters
Returns a binary string of 8bit characters with the specified length.
Tags:
Overrides
Math_Random::getString() (Get a string of random characters)
Parameters:
void initializeFromSource(
Math_Random
$modulosource, int
$modulobits, [Math_Random
$xsource = null], [int
$xbits = null], Math_Random_BlumBlumShaw
4)
|
|
Factory method to initialize the generator from a random source
Creates an instance of the BBS PRNG and initializes values from specified random source. The length of the modulo generated is at least $modulobits bits in length. Because the BBS algorithm is proven to be at least as strong as the problem of factoring the modulo one can take the bit length of RSA modulo as a guidance of reasonable values.
If $xsource is not specified the random seed is initialized from the same source as the modulo.
If $xbits is not specified the length of the random seed is set to be same as the generated modulo.
Tags:
Parameters: