diff options
author | Jeffrey Walton <noloader@gmail.com> | 2016-10-17 22:00:31 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2016-10-17 22:00:31 -0400 |
commit | 54d17c7361dc97313ca0ad54bf07420e33a735c0 (patch) | |
tree | e61a6f7451df5f1bb280d7e0bab21b7100551ac3 /ecp.h | |
parent | b7423a3bf73aef511ff310631955ff378c6fee7e (diff) | |
download | cryptopp-git-54d17c7361dc97313ca0ad54bf07420e33a735c0.tar.gz |
Updated CRYPTOPP_ASSERT based on comments
Also see https://github.com/weidai11/cryptopp/commit/399a1546de71f41598c15edada28e7f0d616f541#commitcomment-19448453
Diffstat (limited to 'ecp.h')
-rw-r--r-- | ecp.h | 28 |
1 files changed, 14 insertions, 14 deletions
@@ -19,21 +19,21 @@ NAMESPACE_BEGIN(CryptoPP) //! Elliptical Curve Point
struct CRYPTOPP_DLL ECPPoint
{
+#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
+ virtual ~ECPPoint() {}
+#endif
+
ECPPoint() : identity(true) {}
ECPPoint(const Integer &x, const Integer &y)
- : identity(false), x(x), y(y) {}
+ : x(x), y(y), identity(false) {}
bool operator==(const ECPPoint &t) const
{return (identity && t.identity) || (!identity && !t.identity && x==t.x && y==t.y);}
bool operator< (const ECPPoint &t) const
{return identity ? !t.identity : (!t.identity && (x<t.x || (x==t.x && y<t.y)));}
-#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
- virtual ~ECPPoint() {}
-#endif
-
- bool identity;
Integer x, y;
+ bool identity;
};
CRYPTOPP_DLL_TEMPLATE_CLASS AbstractGroup<ECPPoint>;
@@ -46,6 +46,10 @@ public: typedef Integer FieldElement;
typedef ECPPoint Point;
+#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
+ virtual ~ECP() {}
+#endif
+
ECP() {}
ECP(const ECP &ecp, bool convertToMontgomeryRepresentation = false);
ECP(const Integer &modulus, const FieldElement &a, const FieldElement &b)
@@ -94,10 +98,6 @@ public: bool operator==(const ECP &rhs) const
{return GetField() == rhs.GetField() && m_a == rhs.m_a && m_b == rhs.m_b;}
-#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
- virtual ~ECP() {}
-#endif
-
private:
clonable_ptr<Field> m_fieldPtr;
FieldElement m_a, m_b;
@@ -115,6 +115,10 @@ template<> class EcPrecomputation<ECP> : public DL_GroupPrecomputation<ECP::Poin public:
typedef ECP EllipticCurve;
+#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
+ virtual ~EcPrecomputation() {}
+#endif
+
// DL_GroupPrecomputation
bool NeedConversions() const {return true;}
Element ConvertIn(const Element &P) const
@@ -133,10 +137,6 @@ public: }
const ECP & GetCurve() const {return *m_ecOriginal;}
-#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
- virtual ~EcPrecomputation() {}
-#endif
-
private:
value_ptr<ECP> m_ec, m_ecOriginal;
};
|