6 #ifndef CRYPTOPP_NBTHEORY_H 7 #define CRYPTOPP_NBTHEORY_H 17 CRYPTOPP_DLL
const word16 * CRYPTOPP_API
GetPrimeTable(
unsigned int &size);
116 const PrimeSelector *GetSelectorPointer()
const {
return this;}
117 virtual bool IsAcceptable(
const Integer &candidate)
const =0;
132 CRYPTOPP_DLL
unsigned int CRYPTOPP_API PrimeSearchInterval(
const Integer &max);
134 CRYPTOPP_DLL
AlgorithmParameters CRYPTOPP_API MakeParametersForTwoPrimesOfEqualSize(
unsigned int productBitLength);
166 {
return a.InverseMod(b);}
208 {
return a_times_b_mod_c(x, y, m);}
216 {
return a_exp_b_mod_c(x, e, m);}
277 {Generate(delta, rng, pbits, pbits-1);}
288 {Generate(delta, rng, pbits, qbits);}
Integer CRT(const Integer &xp, const Integer &p, const Integer &xq, const Integer &q, const Integer &u)
Chinese Remainder Theorem.
const word16 * GetPrimeTable(unsigned int &size)
The Small Prime table.
Classes for working with NameValuePairs.
bool IsLucasProbablePrime(const Integer &n)
Determine if a number is probably prime.
bool FirstPrime(Integer &p, const Integer &max, const Integer &equiv, const Integer &mod, const PrimeSelector *pSelector)
Finds a random prime of special form.
static Integer Gcd(const Integer &a, const Integer &n)
Calculate greatest common divisor.
bool SmallDivisorsTest(const Integer &p)
Tests whether a number is divisible by a small prime.
bool IsStrongLucasProbablePrime(const Integer &n)
Determine if a number is probably prime.
Abstract base classes that provide a uniform interface to this library.
Integer MaurerProvablePrime(RandomNumberGenerator &rng, unsigned int bits)
Generates a provable prime.
bool IsSmallPrime(const Integer &p)
Tests whether a number is a small prime.
Interface for random number generators.
bool IsFermatProbablePrime(const Integer &n, const Integer &b)
Determine if a number is probably prime.
int Jacobi(const Integer &a, const Integer &b)
Calculate the Jacobi symbol.
PrimeAndGenerator(signed int delta, RandomNumberGenerator &rng, unsigned int pbits)
Construct a PrimeAndGenerator.
Generator of prime numbers of special forms.
Integer ModularSquareRoot(const Integer &a, const Integer &p)
Extract a modular square root.
static const Integer & One()
Integer representing 1.
Integer InverseLucas(const Integer &e, const Integer &m, const Integer &p, const Integer &q, const Integer &u)
Calculate the inverse Lucas value.
bool IsStrongProbablePrime(const Integer &n, const Integer &b)
Determine if a number is probably prime.
Integer MihailescuProvablePrime(RandomNumberGenerator &rng, unsigned int bits)
Generates a provable prime.
Integer GCD(const Integer &a, const Integer &b)
Calculate the greatest common divisor.
const Integer & SubPrime() const
Retrieve second prime.
const Integer & Prime() const
Retrieve first prime.
Integer Lucas(const Integer &e, const Integer &p, const Integer &n)
Calculate the Lucas value.
bool VerifyPrime(RandomNumberGenerator &rng, const Integer &p, unsigned int level=1)
Verifies a number is probably prime.
Application callback to signal suitability of a cabdidate prime.
Multiple precision integer with arithmetic operations.
Integer LCM(const Integer &a, const Integer &b)
Calculate the least common multiple.
Integer ModularMultiplication(const Integer &x, const Integer &y, const Integer &m)
Modular multiplication.
bool IsPrime(const Integer &p)
Verifies a number is probably prime.
PrimeAndGenerator(signed int delta, RandomNumberGenerator &rng, unsigned int pbits, unsigned qbits)
Construct a PrimeAndGenerator.
bool TrialDivision(const Integer &p, unsigned bound)
Tests whether a number is divisible by a small prime.
unsigned int DiscreteLogWorkFactor(unsigned int bitlength)
Estimate work factor.
Integer ModularRoot(const Integer &a, const Integer &dp, const Integer &dq, const Integer &p, const Integer &q, const Integer &u)
Extract a modular root.
Integer EuclideanMultiplicativeInverse(const Integer &a, const Integer &b)
Calculate multiplicative inverse.
bool RelativelyPrime(const Integer &a, const Integer &b)
Determine relative primality.
An object that implements NameValuePairs.
bool RabinMillerTest(RandomNumberGenerator &rng, const Integer &n, unsigned int rounds)
Determine if a number is probably prime.
Multiple precision integer with arithmetic operations.
Crypto++ library namespace.
bool SolveModularQuadraticEquation(Integer &r1, Integer &r2, const Integer &a, const Integer &b, const Integer &c, const Integer &p)
Solve a Modular Quadratic Equation.
Integer ModularExponentiation(const Integer &x, const Integer &e, const Integer &m)
Modular exponentiation.
PrimeAndGenerator()
Construct a PrimeAndGenerator.
unsigned int FactoringWorkFactor(unsigned int bitlength)
Estimate work factor.
const Integer & Generator() const
Retrieve the generator.