23 : c1(encodedElement, size/2), c2(encodedElement+size/2, size/2) {}
27 c1.Encode(encodedElement, size/2);
28 c2.Encode(encodedElement+size/2, size/2);
31 bool operator==(
const GFP2Element &rhs)
const {
return c1 == rhs.
c1 && c2 == rhs.
c2;}
40 static const GFP2Element & Zero();
56 throw InvalidArgument(
"GFP2_ONB: modulus must be equivalent to 2 mod 3");
GFP2Element ConvertIn(const GFP2Element &a) const
bool operator==(const GFP2Element &rhs) const
An invalid argument was detected.
const Element & Double(const Element &a) const
Doubles an element in the group.
const Element & SpecialOperation1(const Element &a) const
const Element & Multiply(const Element &a, const Element &b) const
Multiplies elements in the group.
bool NotZero() const
Determines if the Integer is non-0.
static const GFP2Element & Zero()
bool operator!=(const GFP2Element &rhs) const
#define NAMESPACE_BEGIN(x)
const Element & Inverse(const Element &a) const
Inverts the element in the group.
Abstract base classes that provide a uniform interface to this library.
Element Exponentiate(const Element &a, const Integer &e) const
Raises a base to an exponent in the group.
GFP2Element ConvertOut(const GFP2Element &a) const
Interface for random number generators.
const Element & MultiplicativeInverse(const Element &a) const
Calculate the multiplicative inverse of an element in the group.
Classes for performing mathematics over different fields.
void Encode(byte *encodedElement, unsigned int size)
void swap(GFP2Element &a)
bool operator==(const ::CryptoPP::OID &lhs, const ::CryptoPP::OID &rhs)
const Integer & GetModulus() const
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
const Element & Identity() const
Provides the Identity element.
const Element & Subtract(const Element &a, const Element &b) const
Subtracts elements in the group.
bool Equal(const GFP2Element &a, const GFP2Element &b) const
Compare two elements for equality.
void swap(Integer &a)
Swaps this Integer with another Integer.
const Element & Add(const Element &a, const Element &b) const
Adds elements in the group.
Multiple precision integer with arithmetic operations.
GFP2Element(const Integer &c1, const Integer &c2)
GFP2Element(const byte *encodedElement, unsigned int size)
virtual Element CascadeExponentiate(const Element &x, const Integer &e1, const Element &y, const Integer &e2) const
TODO.
#define CRYPTOPP_ASSERT(exp)
static void CRYPTOPP_API Divide(Integer &r, Integer &q, const Integer &a, const Integer &d)
calculate r and q such that (a == d*q + r) && (0 <= r < abs(d))
bool IsUnit(const Element &a) const
Determines whether an element is a unit in the group.
uint8_t const size_t const size
GFP2_ONB(const Integer &p)
Multiple precision integer with arithmetic operations.
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.
const Element & MultiplicativeIdentity() const
Retrieves the multiplicative identity.
GFP2Element XTR_Exponentiate(const GFP2Element &b, const Integer &e, const Integer &p)
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.
const Element & Square(const Element &a) const
Square an element in the group.
Element & Reduce(Element &a, const Element &b) const
Reduces an element in the congruence class.