summaryrefslogtreecommitdiff
path: root/eccrypto.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2016-10-17 22:00:31 -0400
committerJeffrey Walton <noloader@gmail.com>2016-10-17 22:00:31 -0400
commit54d17c7361dc97313ca0ad54bf07420e33a735c0 (patch)
treee61a6f7451df5f1bb280d7e0bab21b7100551ac3 /eccrypto.h
parentb7423a3bf73aef511ff310631955ff378c6fee7e (diff)
downloadcryptopp-git-54d17c7361dc97313ca0ad54bf07420e33a735c0.tar.gz
Updated CRYPTOPP_ASSERT based on comments
Also see https://github.com/weidai11/cryptopp/commit/399a1546de71f41598c15edada28e7f0d616f541#commitcomment-19448453
Diffstat (limited to 'eccrypto.h')
-rw-r--r--eccrypto.h32
1 files changed, 13 insertions, 19 deletions
diff --git a/eccrypto.h b/eccrypto.h
index 904a35cf..75f26b87 100644
--- a/eccrypto.h
+++ b/eccrypto.h
@@ -38,6 +38,10 @@ public:
typedef Point Element;
typedef IncompatibleCofactorMultiplication DefaultCofactorOption;
+#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
+ virtual ~DL_GroupParameters_EC() {}
+#endif
+
DL_GroupParameters_EC() : m_compress(false), m_encodeAsOID(true) {}
DL_GroupParameters_EC(const OID &oid)
: m_compress(false), m_encodeAsOID(true) {Initialize(oid);}
@@ -133,10 +137,6 @@ public:
void LoadRecommendedParameters(const OID &oid) {Initialize(oid);}
#endif
-#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
- virtual ~DL_GroupParameters_EC() {}
-#endif
-
protected:
unsigned int FieldElementLength() const {return GetCurve().GetField().MaxElementByteLength();}
unsigned int ExponentLength() const {return m_n.ByteCount();}
@@ -154,6 +154,10 @@ class DL_PublicKey_EC : public DL_PublicKeyImpl<DL_GroupParameters_EC<EC> >
public:
typedef typename EC::Point Element;
+#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
+ virtual ~DL_PublicKey_EC() {}
+#endif
+
void Initialize(const DL_GroupParameters_EC<EC> &params, const Element &Q)
{this->AccessGroupParameters() = params; this->SetPublicElement(Q);}
void Initialize(const EC &ec, const Element &G, const Integer &n, const Element &Q)
@@ -162,10 +166,6 @@ public:
// X509PublicKey
void BERDecodePublicKey(BufferedTransformation &bt, bool parametersPresent, size_t size);
void DEREncodePublicKey(BufferedTransformation &bt) const;
-
-#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
- virtual ~DL_PublicKey_EC() {}
-#endif
};
//! EC private key
@@ -175,6 +175,10 @@ class DL_PrivateKey_EC : public DL_PrivateKeyImpl<DL_GroupParameters_EC<EC> >
public:
typedef typename EC::Point Element;
+#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
+ virtual ~DL_PrivateKey_EC() {}
+#endif
+
void Initialize(const DL_GroupParameters_EC<EC> &params, const Integer &x)
{this->AccessGroupParameters() = params; this->SetPrivateExponent(x);}
void Initialize(const EC &ec, const Element &G, const Integer &n, const Integer &x)
@@ -187,10 +191,6 @@ public:
// PKCS8PrivateKey
void BERDecodePrivateKey(BufferedTransformation &bt, bool parametersPresent, size_t size);
void DEREncodePrivateKey(BufferedTransformation &bt) const;
-
-#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
- virtual ~DL_PrivateKey_EC() {}
-#endif
};
//! Elliptic Curve Diffie-Hellman, AKA <a href="http://www.weidai.com/scan-mirror/ka.html#ECDH">ECDH</a>
@@ -340,13 +340,7 @@ struct ECIES
virtual ~ECIES() {}
#endif
-#if (CRYPTOPP_GCC_VERSION >= 40500) || (CRYPTOPP_LLVM_CLANG_VERSION >= 20800)
-} __attribute__((deprecated ("ECIES will be changing in the near future due to (1) an implementation bug and (2) an interop issue")));
-#elif (CRYPTOPP_GCC_VERSION)
-} __attribute__((deprecated));
-#else
-};
-#endif
+} CRYPTOPP_DEPRECATED ("ECIES will be changing in the near future due to an interop issue");
NAMESPACE_END