6 #ifndef CRYPTOPP_NBTHEORY_H 7 #define CRYPTOPP_NBTHEORY_H 84 virtual bool IsAcceptable(
const Integer &candidate)
const =0;
163 {Generate(delta, rng, pbits, pbits-1);}
174 {Generate(delta, rng, pbits, qbits);}
Classes for working with NameValuePairs.
CRYPTOPP_DLL bool CRYPTOPP_API FirstPrime(Integer &p, const Integer &max, const Integer &equiv, const Integer &mod, const PrimeSelector *pSelector)
Finds a random prime of special form.
CRYPTOPP_DLL bool CRYPTOPP_API RabinMillerTest(RandomNumberGenerator &rng, const Integer &w, unsigned int rounds)
static Integer CRYPTOPP_API Gcd(const Integer &a, const Integer &n)
greatest common divisor
CRYPTOPP_DLL Integer CRYPTOPP_API MihailescuProvablePrime(RandomNumberGenerator &rng, unsigned int bits)
Generates a provable prime.
#define NAMESPACE_BEGIN(x)
CRYPTOPP_DLL Integer CRYPTOPP_API ModularRoot(const Integer &a, const Integer &dp, const Integer &dq, const Integer &p, const Integer &q, const Integer &u)
Abstract base classes that provide a uniform interface to this library.
CRYPTOPP_DLL bool CRYPTOPP_API IsPrime(const Integer &p)
Verifies a prime number.
Interface for random number generators.
PrimeAndGenerator(signed int delta, RandomNumberGenerator &rng, unsigned int pbits)
Construct a PrimeAndGenerator.
Generator of prime numbers of special forms.
static const Integer &CRYPTOPP_API One()
Integer representing 1.
Integer ModularExponentiation(const Integer &a, const Integer &e, const Integer &m)
CRYPTOPP_DLL Integer CRYPTOPP_API MaurerProvablePrime(RandomNumberGenerator &rng, unsigned int bits)
Generates a provable prime.
Integer GCD(const Integer &a, const Integer &b)
CRYPTOPP_DLL bool CRYPTOPP_API IsLucasProbablePrime(const Integer &n)
const Integer & Generator() const
Retrieve the generator.
CRYPTOPP_DLL AlgorithmParameters CRYPTOPP_API MakeParametersForTwoPrimesOfEqualSize(unsigned int productBitLength)
CRYPTOPP_DLL Integer CRYPTOPP_API ModularSquareRoot(const Integer &a, const Integer &p)
Application callback to signal suitability of a cabdidate prime.
Multiple precision integer with arithmetic operations.
CRYPTOPP_DLL bool CRYPTOPP_API IsStrongLucasProbablePrime(const Integer &n)
Integer LCM(const Integer &a, const Integer &b)
CRYPTOPP_DLL bool CRYPTOPP_API SolveModularQuadraticEquation(Integer &r1, Integer &r2, const Integer &a, const Integer &b, const Integer &c, const Integer &p)
PrimeAndGenerator(signed int delta, RandomNumberGenerator &rng, unsigned int pbits, unsigned qbits)
Construct a PrimeAndGenerator.
CRYPTOPP_DLL Integer CRYPTOPP_API InverseLucas(const Integer &e, const Integer &m, const Integer &p, const Integer &q, const Integer &u)
CRYPTOPP_DLL bool CRYPTOPP_API IsFermatProbablePrime(const Integer &n, const Integer &b)
CRYPTOPP_DLL bool CRYPTOPP_API TrialDivision(const Integer &p, unsigned bound)
CRYPTOPP_DLL unsigned int CRYPTOPP_API PrimeSearchInterval(const Integer &max)
Integer EuclideanMultiplicativeInverse(const Integer &a, const Integer &b)
CRYPTOPP_DLL unsigned int CRYPTOPP_API FactoringWorkFactor(unsigned int bitlength)
uint8_t const size_t const size
CRYPTOPP_DLL Integer CRYPTOPP_API Lucas(const Integer &e, const Integer &p, const Integer &n)
bool RelativelyPrime(const Integer &a, const Integer &b)
An object that implements NameValuePairs.
Integer InverseMod(const Integer &n) const
calculate multiplicative inverse of *this mod n
CRYPTOPP_DLL bool CRYPTOPP_API IsSmallPrime(const Integer &p)
Tests whether a number is a small prime.
CRYPTOPP_DLL bool CRYPTOPP_API IsStrongProbablePrime(const Integer &n, const Integer &b)
Multiple precision integer with arithmetic operations.
CRYPTOPP_DLL bool CRYPTOPP_API VerifyPrime(RandomNumberGenerator &rng, const Integer &p, unsigned int level=1)
Verifies a prime number.
Integer a_exp_b_mod_c(const Integer &x, const Integer &e, const Integer &m)
const Integer & Prime() const
Retrieve first prime.
CRYPTOPP_DLL Integer CRYPTOPP_API CRT(const Integer &xp, const Integer &p, const Integer &xq, const Integer &q, const Integer &u)
PrimeAndGenerator()
Construct a PrimeAndGenerator.
const PrimeSelector * GetSelectorPointer() const
CRYPTOPP_DLL const word16 *CRYPTOPP_API GetPrimeTable(unsigned int &size)
CRYPTOPP_DLL unsigned int CRYPTOPP_API DiscreteLogWorkFactor(unsigned int bitlength)
const Integer & SubPrime() const
Retrieve second prime.
CRYPTOPP_DLL int CRYPTOPP_API Jacobi(const Integer &a, const Integer &b)
CRYPTOPP_DLL bool CRYPTOPP_API SmallDivisorsTest(const Integer &p)