6 #ifndef CRYPTOPP_NBTHEORY_H 7 #define CRYPTOPP_NBTHEORY_H 16 CRYPTOPP_DLL const word16 * CRYPTOPP_API GetPrimeTable(
unsigned int &size);
48 CRYPTOPP_DLL
bool CRYPTOPP_API SmallDivisorsTest(const
Integer &p);
51 CRYPTOPP_DLL
bool CRYPTOPP_API IsFermatProbablePrime(const
Integer &n, const
Integer &b);
52 CRYPTOPP_DLL
bool CRYPTOPP_API IsLucasProbablePrime(const
Integer &n);
54 CRYPTOPP_DLL
bool CRYPTOPP_API IsStrongProbablePrime(const
Integer &n, const
Integer &b);
55 CRYPTOPP_DLL
bool CRYPTOPP_API IsStrongLucasProbablePrime(const
Integer &n);
83 const PrimeSelector *GetSelectorPointer()
const {
return this;}
84 virtual bool IsAcceptable(
const Integer &candidate)
const =0;
99 CRYPTOPP_DLL
unsigned int CRYPTOPP_API PrimeSearchInterval(
const Integer &max);
101 CRYPTOPP_DLL
AlgorithmParameters CRYPTOPP_API MakeParametersForTwoPrimesOfEqualSize(
unsigned int productBitLength);
119 CRYPTOPP_DLL
int CRYPTOPP_API Jacobi(
const Integer &a,
const Integer &b);
127 {
return a_exp_b_mod_c(a, e, m);}
141 CRYPTOPP_DLL
unsigned int CRYPTOPP_API DiscreteLogWorkFactor(
unsigned int bitlength);
142 CRYPTOPP_DLL
unsigned int CRYPTOPP_API FactoringWorkFactor(
unsigned int bitlength);
155 {Generate(delta, rng, pbits, pbits-1);}
159 {Generate(delta, rng, pbits, qbits);}
163 const Integer& Prime()
const {
return p;}
164 const Integer& SubPrime()
const {
return q;}
165 const Integer& Generator()
const {
return g;}
Classes for working with NameValuePairs.
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)
greatest common divisor
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.
generator of prime numbers of special forms
static const Integer & One()
Integer representing 1.
Integer MihailescuProvablePrime(RandomNumberGenerator &rng, unsigned int bits)
Generates a provable prime.
bool VerifyPrime(RandomNumberGenerator &rng, const Integer &p, unsigned int level=1)
Verifies a prime number.
Application callback to signal suitability of a cabdidate prime.
Multiple precision integer with arithmetic operations.
bool IsPrime(const Integer &p)
Verifies a prime number.
bool TrialDivision(const Integer &p, unsigned bound)
An object that implements NameValuePairs.
Integer InverseMod(const Integer &n) const
calculate multiplicative inverse of *this mod n
Crypto++ library namespace.