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);
82 const PrimeSelector *GetSelectorPointer()
const {
return this;}
83 virtual bool IsAcceptable(
const Integer &candidate)
const =0;
98 CRYPTOPP_DLL
unsigned int CRYPTOPP_API PrimeSearchInterval(
const Integer &max);
100 CRYPTOPP_DLL
AlgorithmParameters CRYPTOPP_API MakeParametersForTwoPrimesOfEqualSize(
unsigned int productBitLength);
111 {
return a.InverseMod(b);}
118 CRYPTOPP_DLL
int CRYPTOPP_API Jacobi(
const Integer &a,
const Integer &b);
126 {
return a_exp_b_mod_c(a, e, m);}
140 CRYPTOPP_DLL
unsigned int CRYPTOPP_API DiscreteLogWorkFactor(
unsigned int bitlength);
141 CRYPTOPP_DLL
unsigned int CRYPTOPP_API FactoringWorkFactor(
unsigned int bitlength);
161 {Generate(delta, rng, pbits, pbits-1);}
172 {Generate(delta, rng, pbits, qbits);}
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.
PrimeAndGenerator(signed int delta, RandomNumberGenerator &rng, unsigned int pbits)
Construct a PrimeAndGenerator.
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.
const Integer & SubPrime() const
Retrieve second prime.
const Integer & Prime() const
Retrieve first 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.
PrimeAndGenerator(signed int delta, RandomNumberGenerator &rng, unsigned int pbits, unsigned qbits)
Construct a PrimeAndGenerator.
bool TrialDivision(const Integer &p, unsigned bound)
An object that implements NameValuePairs.
Multiple precision integer with arithmetic operations.
Crypto++ library namespace.
PrimeAndGenerator()
Construct a PrimeAndGenerator.
const Integer & Generator() const
Retrieve the generator.