CluE
1.0
|
Generates numbers which are (most likely) prime numbers. More...
#include <primegenerator.h>
Public Member Functions | |
unsigned long long | getPrime (unsigned long long lowerBound, unsigned long long upperBound, double errorProbability) |
Returns a number [lowerBound, upperBound] which is prime with probablity 1-errorProbability. More... | |
bool | isMillerRabinPrime (unsigned long long candidate, double errorProbability) |
Miller-Rabin primality test. More... | |
Private Member Functions | |
unsigned long long | potMod (unsigned long long x, unsigned long long b, unsigned long long m) |
Calculates "x^b mod m". More... | |
Generates numbers which are (most likely) prime numbers.
Definition at line 15 of file primegenerator.h.
unsigned long long CluE::PrimeGenerator::getPrime | ( | unsigned long long | lowerBound, |
unsigned long long | upperBound, | ||
double | errorProbability | ||
) |
Returns a number [lowerBound, upperBound] which is prime with probablity 1-errorProbability.
Definition at line 8 of file primegenerator.cpp.
bool CluE::PrimeGenerator::isMillerRabinPrime | ( | unsigned long long | candidate, |
double | errorProbability | ||
) |
Miller-Rabin primality test.
Definition at line 36 of file primegenerator.cpp.
|
private |
Calculates "x^b mod m".
Definition at line 100 of file primegenerator.cpp.