Crypto++
5.6.5
Free C++ class library of cryptographic schemes
|
Go to the documentation of this file.
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);
112 {
return a.InverseMod(b);}
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;}
An object that implements NameValuePairs.
static const Integer & One()
Integer representing 1.
static Integer Gcd(const Integer &a, const Integer &n)
greatest common divisor
Integer MaurerProvablePrime(RandomNumberGenerator &rng, unsigned int bits)
Generates a provable prime.
Interface for random number generators.
bool IsSmallPrime(const Integer &p)
Tests whether a number is a small prime.
Application callback to signal suitability of a cabdidate prime.
bool FirstPrime(Integer &p, const Integer &max, const Integer &equiv, const Integer &mod, const PrimeSelector *pSelector)
Finds a random prime of special form.
bool VerifyPrime(RandomNumberGenerator &rng, const Integer &p, unsigned int level=1)
Verifies a prime number.
generator of prime numbers of special forms
bool TrialDivision(const Integer &p, unsigned bound)
bool IsPrime(const Integer &p)
Verifies a prime number.
Crypto++ library namespace.
Integer MihailescuProvablePrime(RandomNumberGenerator &rng, unsigned int bits)
Generates a provable prime.
Abstract base classes that provide a uniform interface to this library.
Classes for working with NameValuePairs.
Multiple precision integer with arithmetic operations.
Multiple precision integer with arithmetic operations.