5 #ifndef CRYPTOPP_IMPORTS 20 m_field->BERDecodeElement(seq, m_a);
21 m_field->BERDecodeElement(seq, m_b);
50 if (encodedPointLen < 1 || !bt.
Get(type))
77 z =
m_field->SolveQuadraticEquation(P.
y);
79 z.SetCoefficient(0, type & 1);
89 unsigned int len =
m_field->MaxElementByteLength();
106 bt.
Put(2 + (!P.
x ? 0 :
m_field->Divide(P.
y, P.
x).GetBit(0)));
111 unsigned int len =
m_field->MaxElementByteLength();
146 pass = pass &&
m_a.CoefficientCount() <=
m_field->MaxElementBitLength();
147 pass = pass &&
m_b.CoefficientCount() <=
m_field->MaxElementBitLength();
150 pass = pass &&
m_field->GetModulus().IsIrreducible();
159 (x.CoefficientCount() <=
m_field->MaxElementBitLength()
160 && y.CoefficientCount() <=
m_field->MaxElementBitLength()
Field::Element FieldElement
void swap(PolynomialMod2 &a)
Restricts the instantiation of a class to one static object without locks.
size_t BERDecodeBitString(BufferedTransformation &bt, SecByteBlock &str, unsigned int &unusedBits)
DER decode bit string.
bool VerifyPoint(const Point &P) const
Verifies points on elliptic curve.
bool Equal(const Point &P, const Point &Q) const
Compare two elements for equality.
#define NAMESPACE_BEGIN(x)
bool DecodePoint(Point &P, BufferedTransformation &bt, size_t len) const
Decodes an elliptic curve point.
size_type size() const
Provides the count of elements in the SecBlock.
Interface for random number generators.
size_t BERDecodeOctetString(BufferedTransformation &bt, SecByteBlock &str)
BER decode octet string.
Classes for Elliptic Curves over binary fields.
Copy input to a memory buffer.
size_t DEREncodeOctetString(BufferedTransformation &bt, const byte *str, size_t strLen)
ASN Strings.
void DEREncode(BufferedTransformation &bt) const
Encode the fields fieldID and curve of the sequence ECParameters.
unsigned int EncodedPointSize(bool compressed=false) const
Determines encoded point size.
void DEREncodePoint(BufferedTransformation &bt, const Point &P, bool compressed) const
DER Encodes an elliptic curve point.
const Point & Inverse(const Point &P) const
Inverts the element in the group.
clonable_ptr< Field > m_field
void Encode(byte *output, size_t outputLen) const
encode in big-endian format
Elliptic Curve over GF(2^n)
String-based implementation of Store interface.
#define CRYPTOPP_ASSERT(exp)
void BERDecodeError()
Raises a BERDecodeErr.
Classes and functions for working with ANS.1 objects.
bool ValidateParameters(RandomNumberGenerator &rng, unsigned int level=3) const
const Point & Double(const Point &P) const
Doubles an element in the group.
Implementation of BufferedTransformation's attachment interface.
const Point & Identity() const
Provides the Identity element.
void EncodePoint(byte *encodedPoint, const Point &P, bool compressed) const
Encodes an elliptic curve point.
#define pass(a, b, c, mul, X)
PlatformStyle::TableColorType type
#define CRYPTOPP_UNUSED(x)
void Decode(const byte *input, size_t inputLen)
Point BERDecodePoint(BufferedTransformation &bt) const
BER Decodes an elliptic curve point.
Multiple precision integer with arithmetic operations.
Elliptical Curve Point over GF(2^n)
const Point & Add(const Point &P, const Point &Q) const
Adds elements in the group.
GF2NP * BERDecodeGF2NP(BufferedTransformation &bt)
lword TotalPutLength()
Provides the number of bytes written to the Sink.