From 54d17c7361dc97313ca0ad54bf07420e33a735c0 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Mon, 17 Oct 2016 22:00:31 -0400 Subject: Updated CRYPTOPP_ASSERT based on comments Also see https://github.com/weidai11/cryptopp/commit/399a1546de71f41598c15edada28e7f0d616f541#commitcomment-19448453 --- ec2n.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'ec2n.h') diff --git a/ec2n.h b/ec2n.h index 959c1e92..da783734 100644 --- a/ec2n.h +++ b/ec2n.h @@ -21,21 +21,21 @@ NAMESPACE_BEGIN(CryptoPP) //! Elliptic Curve Point struct CRYPTOPP_DLL EC2NPoint { +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~EC2NPoint() {} +#endif + EC2NPoint() : identity(true) {} EC2NPoint(const PolynomialMod2 &x, const PolynomialMod2 &y) - : identity(false), x(x), y(y) {} + : x(x), y(y), identity(false) {} bool operator==(const EC2NPoint &t) const {return (identity && t.identity) || (!identity && !t.identity && x==t.x && y==t.y);} bool operator< (const EC2NPoint &t) const {return identity ? !t.identity : (!t.identity && (x; @@ -48,6 +48,10 @@ public: typedef Field::Element FieldElement; typedef EC2NPoint Point; +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~EC2N() {} +#endif + EC2N() {} EC2N(const Field &field, const Field::Element &a, const Field::Element &b) : m_field(field), m_a(a), m_b(b) {} @@ -92,10 +96,6 @@ public: bool operator==(const EC2N &rhs) const {return GetField() == rhs.GetField() && m_a == rhs.m_a && m_b == rhs.m_b;} -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~EC2N() {} -#endif - private: clonable_ptr m_field; FieldElement m_a, m_b; @@ -113,6 +113,10 @@ template<> class EcPrecomputation : public DL_GroupPrecomputation & GetGroup() const {return m_ec;} Element BERDecodeElement(BufferedTransformation &bt) const {return m_ec.BERDecodePoint(bt);} @@ -122,10 +126,6 @@ public: void SetCurve(const EC2N &ec) {m_ec = ec;} const EC2N & GetCurve() const {return m_ec;} -#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 - virtual ~EcPrecomputation() {} -#endif - private: EC2N m_ec; }; -- cgit v1.2.1