summaryrefslogtreecommitdiff
path: root/ecp.h
diff options
context:
space:
mode:
Diffstat (limited to 'ecp.h')
-rw-r--r--ecp.h28
1 files changed, 14 insertions, 14 deletions
diff --git a/ecp.h b/ecp.h
index c1814739..b4bde16f 100644
--- a/ecp.h
+++ b/ecp.h
@@ -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;
};