36 }
while (!p.
Randomize(rng, minP, maxP,
Integer::PRIME,
CRT(rng.
GenerateBit()?r1:
r2, q, 2, 3,
EuclideanMultiplicativeInverse(p, 3)), 3*q));
58 unsigned int bitCount = e.
BitCount();
63 unsigned int lowest1bit;
64 for (lowest1bit=0; e.
GetBit(lowest1bit) == 0; lowest1bit++) {}
73 for (i = e.
BitCount() - 1; i>lowest1bit; i--)
const Element & SpecialOperation1(const Element &a) const
a number which is probabilistically prime
Restricts the instantiation of a class to one static object without locks.
bool GetBit(size_t i) const
Provides the i-th bit of the Integer.
void XTR_FindPrimesAndGenerator(RandomNumberGenerator &rng, Integer &p, Integer &q, GFP2Element &g, unsigned int pbits, unsigned int qbits)
Creates primes p,q and generator g for XTR.
#define NAMESPACE_BEGIN(x)
GFP2Element ConvertOut(const GFP2Element &a) const
Interface for random number generators.
void Randomize(RandomNumberGenerator &rng, size_t bitCount)
Set this Integer to random integer.
Integer CRT(const Integer &xp, const Integer &p, const Integer &xq, const Integer &q, const Integer &u)
Classes for performing mathematics over different fields.
void swap(GFP2Element &a)
Element & Accumulate(Element &a, const Element &b) const
TODO.
void RaiseToPthPower(Element &a) const
const Element & SpecialOperation2(const Element &x, const Element &y, const Element &z) const
unsigned int BitCount() const
Determines the number of bits required to represent the Integer.
bool SolveModularQuadraticEquation(Integer &r1, Integer &r2, const Integer &a, const Integer &b, const Integer &c, const Integer &p)
Integer Squared() const
Multiply this integer by itself.
The XTR public key system.
static Integer CRYPTOPP_API Power2(size_t e)
Exponentiates to a power of 2.
Multiple precision integer with arithmetic operations.
#define CRYPTOPP_ASSERT(exp)
Classes and functions for number theoretic operations.
Integer EuclideanMultiplicativeInverse(const Integer &a, const Integer &b)
virtual unsigned int GenerateBit()
Generate new random bit and return it.
#define CRYPTOPP_UNUSED(x)
Multiple precision integer with arithmetic operations.
static const Integer &CRYPTOPP_API Zero()
Integer representing 0.
GFP2Element ConvertIn(const Integer &a) const
Class file for performing modular arithmetic.
const Element & PthPower(const Element &a) const
GF(p^2), optimal normal basis.
GFP2Element XTR_Exponentiate(const GFP2Element &b, const Integer &e, const Integer &p)