CluE  1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
CluE::PrimeGenerator Class Reference

Generates numbers which are (most likely) prime numbers. More...

#include <primegenerator.h>

Collaboration diagram for CluE::PrimeGenerator:
Collaboration graph

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...
 

Detailed Description

Generates numbers which are (most likely) prime numbers.

Definition at line 15 of file primegenerator.h.

Member Function Documentation

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.

unsigned long long CluE::PrimeGenerator::potMod ( unsigned long long  x,
unsigned long long  b,
unsigned long long  m 
)
private

Calculates "x^b mod m".

See also
Schneier, Bruce (1996). Applied Cryptography: Protocols, Algorithms, and Source Code in C, Second Edition (2nd ed.), p. 224. Wiley. ISBN 978-0471117094.

Definition at line 100 of file primegenerator.cpp.


The documentation for this class was generated from the following files: