Security Scol plugin
|
Generator of prime numbers of special forms. More...
#include <nbtheory.h>
Public Member Functions | |
PrimeAndGenerator () | |
Construct a PrimeAndGenerator. | |
PrimeAndGenerator (signed int delta, RandomNumberGenerator &rng, unsigned int pbits) | |
Construct a PrimeAndGenerator. | |
PrimeAndGenerator (signed int delta, RandomNumberGenerator &rng, unsigned int pbits, unsigned qbits) | |
Construct a PrimeAndGenerator. | |
void | Generate (signed int delta, RandomNumberGenerator &rng, unsigned int pbits, unsigned qbits) |
Generate a Prime and Generator. | |
const Integer & | Prime () const |
Retrieve first prime. | |
const Integer & | SubPrime () const |
Retrieve second prime. | |
const Integer & | Generator () const |
Retrieve the generator. | |
Generator of prime numbers of special forms.
Definition at line 263 of file nbtheory.h.
|
inline |
Construct a PrimeAndGenerator.
Definition at line 267 of file nbtheory.h.
|
inline |
Construct a PrimeAndGenerator.
delta | +1 or -1 |
rng | a RandomNumberGenerator derived class |
pbits | the number of bits in the prime p |
PrimeAndGenerator() generates a random prime p of the form 2*q+delta
, where delta is 1 or -1 and q is also prime. Internally the constructor calls Generate(delta, rng, pbits, pbits-1)
.
pbits > 5
Definition at line 277 of file nbtheory.h.
|
inline |
Construct a PrimeAndGenerator.
delta | +1 or -1 |
rng | a RandomNumberGenerator derived class |
pbits | the number of bits in the prime p |
qbits | the number of bits in the prime q |
PrimeAndGenerator() generates a random prime p of the form 2*r*q+delta
, where q is also prime. Internally the constructor calls Generate(delta, rng, pbits, qbits)
.
qbits > 4 && pbits > qbits
Definition at line 288 of file nbtheory.h.
void PrimeAndGenerator::Generate | ( | signed int | delta, |
RandomNumberGenerator & | rng, | ||
unsigned int | pbits, | ||
unsigned | qbits | ||
) |
Generate a Prime and Generator.
delta | +1 or -1 |
rng | a RandomNumberGenerator derived class |
pbits | the number of bits in the prime p |
qbits | the number of bits in the prime q |
Generate() generates a random prime p of the form 2*r*q+delta
, where q is also prime.
Definition at line 1054 of file nbtheory.cpp.
|
inline |
Retrieve the generator.
Definition at line 309 of file nbtheory.h.
|
inline |
Retrieve first prime.
Definition at line 301 of file nbtheory.h.
|
inline |
Retrieve second prime.
Definition at line 305 of file nbtheory.h.