8 #ifndef CRYPTOPP_EC2N_H 9 #define CRYPTOPP_EC2N_H 41 : m_field(field), m_a(a), m_b(b) {}
52 bool Equal(
const Point &
P,
const Point &
Q)
const;
53 const Point& Identity()
const;
54 const Point& Inverse(
const Point &P)
const;
56 const Point&
Add(
const Point &P,
const Point &Q)
const;
57 const Point& Double(
const Point &P)
const;
60 {
return ScalarMultiply(P, k);}
62 {
return CascadeScalarMultiply(P, k1, Q, k2);}
65 bool VerifyPoint(
const Point &P)
const;
68 {
return 1 + (compressed?1:2)*m_field->MaxElementByteLength();}
71 bool DecodePoint(Point &P,
const byte *encodedPoint,
size_t len)
const;
72 void EncodePoint(
byte *encodedPoint,
const Point &P,
bool compressed)
const;
79 const Field &
GetField()
const {
return *m_field;}
80 const FieldElement &
GetA()
const {
return m_a;}
81 const FieldElement &
GetB()
const {
return m_b;}
88 FieldElement m_a,
m_b;
Field::Element FieldElement
bool GetField(std::istream &is, std::string &name, std::string &value)
Point CascadeMultiply(const Integer &k1, const Point &P, const Integer &k2, const Point &Q) const
#define NAMESPACE_BEGIN(x)
#define CRYPTOPP_DLL_TEMPLATE_CLASS
Abstract base classes that provide a uniform interface to this library.
Classes for automatic resource management.
Interface for random number generators.
int Add(word *C, const word *A, const word *B, size_t N)
Classes for Elliptic Curve points.
void DEREncodeElement(BufferedTransformation &bt, const Element &v) const
Integer FieldSize() const
Classes for performing mathematics over different fields.
const AbstractGroup< Element > & GetGroup() const
void SetCurve(const EC2N &ec)
const FieldElement & GetB() const
Element BERDecodeElement(BufferedTransformation &bt) const
EC2N(const Field &field, const Field::Element &a, const Field::Element &b)
Construct an EC2N.
unsigned int EncodedPointSize(bool compressed=false) const
Determines encoded point size.
Point Multiply(const Integer &k, const Point &P) const
EuclideanDomainOf< PolynomialMod2 >::Element Element
A pointer which can be copied and cloned.
static Integer CRYPTOPP_API Power2(size_t e)
Exponentiates to a power of 2.
clonable_ptr< Field > m_field
Multiple precision integer with arithmetic operations.
Elliptic Curve over GF(2^n)
ANONYMOUS_NAMESPACE_BEGIN const CryptoPP::GF2_32 field
Classes and functions for schemes over GF(2^n)
Classes for precomputation in a group.
bool operator==(const EC2N &rhs) const
GF(2^n) with Polynomial Basis.
Abstract class for encoding and decoding ellicptic curve points.
bool InversionIsFast() const
Determine if inversion is fast.
Elliptic Curve precomputation.
Multiple precision integer with arithmetic operations.
virtual ~EcPrecomputation()
Elliptical Curve Point over GF(2^n)
const EC2N & GetCurve() const
const Field & GetField() const
const FieldElement & GetA() const