summaryrefslogtreecommitdiff
path: root/ecp.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2016-11-04 11:13:07 -0400
committerJeffrey Walton <noloader@gmail.com>2016-11-04 11:13:07 -0400
commit7363c49a675afeb8a1f8268713c341811c4ad3bd (patch)
tree7307c5a2802f87d6995fd6902f2ca8b293aea100 /ecp.h
parent456bd2b1b7ea3dc9e840f1392374aeb489aee3f8 (diff)
downloadcryptopp-git-7363c49a675afeb8a1f8268713c341811c4ad3bd.tar.gz
Add ecpoint.h header file. Add EncodedPoint interface. Add documntation
Diffstat (limited to 'ecp.h')
-rw-r--r--ecp.h31
1 files changed, 2 insertions, 29 deletions
diff --git a/ecp.h b/ecp.h
index 471dc71c..93ab6267 100644
--- a/ecp.h
+++ b/ecp.h
@@ -10,43 +10,16 @@
#include "integer.h"
#include "algebra.h"
#include "modarith.h"
+#include "ecpoint.h"
#include "eprecomp.h"
#include "smartptr.h"
#include "pubkey.h"
NAMESPACE_BEGIN(CryptoPP)
-//! \class ECPPoint
-//! \brief Elliptical Curve Point over GF(p), where p is prime
-struct CRYPTOPP_DLL ECPPoint
-{
-#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
- virtual ~ECPPoint() {}
-#endif
-
- //! \brief Construct an ECPPoint
- //! \details identity is set to <tt>true</tt>
- ECPPoint() : identity(true) {}
-
- //! \brief Construct an ECPPoint from coordinates
- //! \details identity is set to <tt>false</tt>
- ECPPoint(const Integer &x, const Integer &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)));}
-
- Integer x, y;
- bool identity;
-};
-
-CRYPTOPP_DLL_TEMPLATE_CLASS AbstractGroup<ECPPoint>;
-
//! \class ECP
//! \brief Elliptic Curve over GF(p), where p is prime
-class CRYPTOPP_DLL ECP : public AbstractGroup<ECPPoint>
+class CRYPTOPP_DLL ECP : public AbstractGroup<ECPPoint>, public EncodedPoint<ECPPoint>
{
public:
typedef ModularArithmetic Field;