18#if CRYPTOPP_MSC_VERSION
20# pragma warning(disable: 4231 4275)
30 typedef Field::Element FieldElement;
42 EC2N(
const Field &field,
const Field::Element &a,
const Field::Element &b)
43 : m_field(field), m_a(a), m_b(b) {}
62 {
return ScalarMultiply(P, k);}
63 Point CascadeMultiply(
const Integer &k1,
const Point &P,
const Integer &k2,
const Point &Q)
const
64 {
return CascadeScalarMultiply(P, k1, Q, k2);}
70 {
return 1 + (compressed?1:2)*m_field->MaxElementByteLength();}
81 const Field & GetField()
const {
return *m_field;}
82 const FieldElement & GetA()
const {
return m_a;}
83 const FieldElement & GetB()
const {
return m_b;}
86 {
return GetField() == rhs.GetField() && m_a == rhs.m_a && m_b == rhs.m_b;}
90 FieldElement m_a, m_b;
132#if CRYPTOPP_MSC_VERSION
Classes for performing mathematics over different fields.
bool operator==(const OID &lhs, const OID &rhs)
Compare two OIDs for equality.
DL_FixedBasePrecomputation adapter class.
Elliptic Curve over GF(2^n)
bool DecodePoint(Point &P, const byte *encodedPoint, size_t len) const
Decodes an elliptic curve point.
bool VerifyPoint(const Point &P) const
Verifies points on elliptic curve.
const Point & Identity() const
Provides the Identity element.
const Point & Double(const Point &P) const
Doubles an element in the group.
void EncodePoint(BufferedTransformation &bt, const Point &P, bool compressed) const
Encodes an elliptic curve point.
unsigned int EncodedPointSize(bool compressed=false) const
Determines encoded point size.
bool Equal(const Point &P, const Point &Q) const
Compare two elements for equality.
bool DecodePoint(Point &P, BufferedTransformation &bt, size_t len) const
Decodes an elliptic curve point.
void DEREncodePoint(BufferedTransformation &bt, const Point &P, bool compressed) const
DER Encodes an elliptic curve point.
bool InversionIsFast() const
Determine if inversion is fast.
EC2N(const Field &field, const Field::Element &a, const Field::Element &b)
Construct an EC2N.
void EncodePoint(byte *encodedPoint, const Point &P, bool compressed) const
Encodes an elliptic curve point.
EC2N(BufferedTransformation &bt)
Construct an EC2N from BER encoded parameters.
void DEREncode(BufferedTransformation &bt) const
Encode the fields fieldID and curve of the sequence ECParameters.
Point BERDecodePoint(BufferedTransformation &bt) const
BER Decodes an elliptic curve point.
const Point & Inverse(const Point &P) const
Inverts the element in the group.
const Point & Add(const Point &P, const Point &Q) const
Adds elements in the group.
const AbstractGroup< Element > & GetGroup() const
Retrieves AbstractGroup interface.
Element BERDecodeElement(BufferedTransformation &bt) const
Decodes element in DER format.
void SetCurve(const EC2N &ec)
Set the elliptic curve.
const EC2N & GetCurve() const
Get the elliptic curve.
void DEREncodeElement(BufferedTransformation &bt, const Element &v) const
Encodes element in DER format.
Elliptic Curve precomputation.
Abstract class for encoding and decoding ellicptic curve points.
GF(2^n) with Polynomial Basis.
Multiple precision integer with arithmetic operations.
static Integer Power2(size_t e)
Exponentiates to a power of 2.
Interface for random number generators.
A pointer which can be copied and cloned.
#define CRYPTOPP_DLL_TEMPLATE_CLASS
Instantiate templates in a dynamic library.
Abstract base classes that provide a uniform interface to this library.
Classes for Elliptic Curve points.
Classes for precomputation in a group.
Classes and functions for schemes over GF(2^n)
Multiple precision integer with arithmetic operations.
Crypto++ library namespace.
This file contains helper classes/functions for implementing public key algorithms.
Classes for automatic resource management.
Elliptical Curve Point over GF(2^n)