Crypto++
8.4
Free C++ class library of cryptographic schemes
|
Go to the documentation of this file.
18 #if CRYPTOPP_MSC_VERSION
19 # pragma warning(push)
20 # pragma warning(disable: 4231 4275)
46 ECP(
const ECP &ecp,
bool convertToMontgomeryRepresentation);
53 : m_fieldPtr(new
Field(modulus)), m_a(a.IsNegative() ? modulus+a : a), m_b(b) {}
75 bool InversionIsFast()
const {
return true;}
80 void SimultaneousMultiply(
Point *results,
const Point &base,
const Integer *exponents,
unsigned int exponentsCount)
const;
83 {
return ScalarMultiply(P, k);}
84 Point CascadeMultiply(
const Integer &k1,
const Point &P,
const Integer &k2,
const Point &Q)
const
85 {
return CascadeScalarMultiply(P, k1, Q, k2);}
91 {
return 1 + (compressed?1:2)*GetField().MaxElementByteLength();}
101 Integer FieldSize()
const {
return GetField().GetModulus();}
102 const Field & GetField()
const {
return *m_fieldPtr;}
103 const FieldElement & GetA()
const {
return m_a;}
104 const FieldElement & GetB()
const {
return m_b;}
107 {
return GetField() == rhs.GetField() && m_a == rhs.m_a && m_b == rhs.m_b;}
111 FieldElement m_a, m_b;
134 bool NeedConversions()
const {
return true;}
136 {
return P.identity ? P :
ECP::Point(m_ec->GetField().ConvertIn(P.x), m_ec->GetField().ConvertIn(P.y));};
138 {
return P.identity ? P :
ECP::Point(m_ec->GetField().ConvertOut(P.x), m_ec->GetField().ConvertOut(P.y));}
148 m_ec.reset(
new ECP(ec,
true));
163 #if CRYPTOPP_MSC_VERSION
164 # pragma warning(pop)
const char * Identity()
ConstByteArrayParameter.
ECP(const Integer &modulus, const FieldElement &a, const FieldElement &b)
Construct an ECP.
Element BERDecodeElement(BufferedTransformation &bt) const
Decodes element in DER format.
void DEREncode(BufferedTransformation &bt) const
DER Encode.
Elliptic Curve over GF(p), where p is prime.
Abstract class for encoding and decoding ellicptic curve points.
Ring of congruence classes modulo n.
ECP(BufferedTransformation &bt)
Construct an ECP from BER encoded parameters.
Element ConvertOut(const Element &P) const
Converts an element between representations.
void SetCurve(const ECP &ec)
Set the elliptic curve.
Classes for automatic resource management.
This file contains helper classes/functions for implementing public key algorithms.
Class file for performing modular arithmetic.
const Point & Add(const Point &P, const Point &Q) const
Adds elements in the group.
Interface for random number generators.
unsigned int EncodedPointSize(bool compressed=false) const
Determines encoded point size.
bool operator==(const OID &lhs, const OID &rhs)
Compare two OIDs for equality.
Elliptic Curve precomputation.
Point BERDecodePoint(BufferedTransformation &bt) const
BER Decodes an elliptic curve point.
Classes for precomputation in a group.
void DEREncodePoint(BufferedTransformation &bt, const Point &P, bool compressed) const
DER Encodes an elliptic curve point.
const ECP & GetCurve() const
Get the elliptic curve.
ECP(const ECP &ecp, bool convertToMontgomeryRepresentation)
Construct an ECP.
bool VerifyPoint(const Point &P) const
Verifies points on elliptic curve.
Elliptical Curve Point over GF(p), where p is prime.
bool Equal(const Point &P, const Point &Q) const
Compare two points.
A pointer which can be copied and cloned.
bool DecodePoint(Point &P, const byte *encodedPoint, size_t len) const
Decodes an elliptic curve point.
bool DecodePoint(Point &P, BufferedTransformation &bt, size_t len) const
Decodes an elliptic curve point.
DL_FixedBasePrecomputation adapter class.
Classes for performing mathematics over different fields.
Crypto++ library namespace.
Element ConvertIn(const Element &P) const
Converts an element between representations.
#define CRYPTOPP_DLL_TEMPLATE_CLASS
Instantiate templates in a dynamic library.
Classes for Elliptic Curve points.
void EncodePoint(BufferedTransformation &bt, const Point &P, bool compressed) const
Encodes an elliptic curve point.
void DEREncodeElement(BufferedTransformation &bt, const Element &v) const
Encodes element in DER format.
Abstract base classes that provide a uniform interface to this library.
void EncodePoint(byte *encodedPoint, const Point &P, bool compressed) const
Encodes an elliptic curve point.
Multiple precision integer with arithmetic operations.
const Point & Inverse(const Point &P) const
Inverts the element in the group.
Multiple precision integer with arithmetic operations.