summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--3way.cpp2
-rw-r--r--arc4.cpp2
-rw-r--r--chacha.cpp2
-rw-r--r--dh.cpp2
-rw-r--r--dh2.cpp2
-rw-r--r--ec2n.h28
-rw-r--r--eccrypto.cpp2
-rw-r--r--eccrypto.h32
-rw-r--r--ecp.h28
-rw-r--r--elgamal.cpp2
-rw-r--r--esign.cpp2
-rw-r--r--files.cpp2
-rw-r--r--gf2n.cpp2
-rw-r--r--gfpcrypt.cpp2
-rw-r--r--integer.cpp4
-rw-r--r--luc.cpp2
-rw-r--r--md5.cpp2
-rw-r--r--modes.cpp6
-rw-r--r--mqv.cpp2
-rw-r--r--rsa.cpp2
-rw-r--r--salsa.cpp2
-rw-r--r--seal.cpp2
-rw-r--r--test.cpp2
-rw-r--r--trap.h10
-rw-r--r--validat1.cpp6
-rw-r--r--validat2.cpp2
-rw-r--r--validate.h2
-rw-r--r--wake.cpp2
-rw-r--r--whrlpool.cpp2
29 files changed, 76 insertions, 82 deletions
diff --git a/3way.cpp b/3way.cpp
index 86ba0efb..a02b5803 100644
--- a/3way.cpp
+++ b/3way.cpp
@@ -7,7 +7,7 @@
NAMESPACE_BEGIN(CryptoPP)
-#if CRYPTOPP_DEBUG && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
+#if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
void ThreeWay_TestInstantiations()
{
ThreeWay::Encryption x1;
diff --git a/arc4.cpp b/arc4.cpp
index 9a3e38c5..3f3b588c 100644
--- a/arc4.cpp
+++ b/arc4.cpp
@@ -13,7 +13,7 @@
NAMESPACE_BEGIN(CryptoPP)
namespace Weak1 {
-#if CRYPTOPP_DEBUG && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
+#if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
void ARC4_TestInstantiations()
{
ARC4 x;
diff --git a/chacha.cpp b/chacha.cpp
index 2ed71118..def596b4 100644
--- a/chacha.cpp
+++ b/chacha.cpp
@@ -18,7 +18,7 @@ NAMESPACE_BEGIN(CryptoPP)
a += b; d ^= a; d = rotlFixed<word32>(d, 8); \
c += d; b ^= c; b = rotlFixed<word32>(b, 7);
-#if CRYPTOPP_DEBUG && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
+#if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
void ChaCha_TestInstantiations()
{
ChaCha8::Encryption x1;
diff --git a/dh.cpp b/dh.cpp
index f35649ca..b33132b0 100644
--- a/dh.cpp
+++ b/dh.cpp
@@ -8,7 +8,7 @@
NAMESPACE_BEGIN(CryptoPP)
-#if CRYPTOPP_DEBUG && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
+#if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
void DH_TestInstantiations()
{
DH dh1;
diff --git a/dh2.cpp b/dh2.cpp
index ee802df9..b8060968 100644
--- a/dh2.cpp
+++ b/dh2.cpp
@@ -5,7 +5,7 @@
NAMESPACE_BEGIN(CryptoPP)
-#if CRYPTOPP_DEBUG && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
+#if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
void DH2_TestInstantiations()
{
DH2 dh(*(SimpleKeyAgreementDomain*)NULL);
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<t.x || (x==t.x && y<t.y)));}
-#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
- virtual ~EC2NPoint() {}
-#endif
-
- bool identity;
PolynomialMod2 x, y;
+ bool identity;
};
CRYPTOPP_DLL_TEMPLATE_CLASS AbstractGroup<EC2NPoint>;
@@ -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<Field> m_field;
FieldElement m_a, m_b;
@@ -113,6 +113,10 @@ template<> class EcPrecomputation<EC2N> : public DL_GroupPrecomputation<EC2N::Po
public:
typedef EC2N EllipticCurve;
+#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
+ virtual ~EcPrecomputation() {}
+#endif
+
// DL_GroupPrecomputation
const AbstractGroup<Element> & 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;
};
diff --git a/eccrypto.cpp b/eccrypto.cpp
index 4c2640b0..19395a2c 100644
--- a/eccrypto.cpp
+++ b/eccrypto.cpp
@@ -31,7 +31,7 @@
NAMESPACE_BEGIN(CryptoPP)
#if 0
-#if CRYPTOPP_DEBUG && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
+#if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
static void ECDSA_TestInstantiations()
{
ECDSA<EC2N>::Signer t1;
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
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;
};
diff --git a/elgamal.cpp b/elgamal.cpp
index ca3dcccc..650a4cc5 100644
--- a/elgamal.cpp
+++ b/elgamal.cpp
@@ -7,7 +7,7 @@
NAMESPACE_BEGIN(CryptoPP)
-#if CRYPTOPP_DEBUG && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
+#if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
void ElGamal_TestInstantiations()
{
ElGamalEncryptor test1(1, 1, 1);
diff --git a/esign.cpp b/esign.cpp
index 5d5c4fc2..58ee56d7 100644
--- a/esign.cpp
+++ b/esign.cpp
@@ -18,7 +18,7 @@
NAMESPACE_BEGIN(CryptoPP)
-#if CRYPTOPP_DEBUG && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
+#if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
void ESIGN_TestInstantiations()
{
ESIGN<SHA>::Verifier x1(1, 1);
diff --git a/files.cpp b/files.cpp
index 9f34ef3b..9a5168bb 100644
--- a/files.cpp
+++ b/files.cpp
@@ -10,7 +10,7 @@
NAMESPACE_BEGIN(CryptoPP)
-#if CRYPTOPP_DEBUG && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
+#if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
void Files_TestInstantiations()
{
FileStore f0;
diff --git a/gf2n.cpp b/gf2n.cpp
index 92915da6..9bcf4ef1 100644
--- a/gf2n.cpp
+++ b/gf2n.cpp
@@ -325,7 +325,7 @@ PolynomialMod2 PolynomialMod2::Modulo(const PolynomialMod2 &b) const
PolynomialMod2& PolynomialMod2::operator<<=(unsigned int n)
{
-#if CRYPTOPP_DEBUG
+#if defined(CRYPTOPP_DEBUG)
int x; CRYPTOPP_UNUSED(x);
CRYPTOPP_ASSERT(SafeConvert(n,x));
#endif
diff --git a/gfpcrypt.cpp b/gfpcrypt.cpp
index f49be2f9..80fbd1b8 100644
--- a/gfpcrypt.cpp
+++ b/gfpcrypt.cpp
@@ -20,7 +20,7 @@
NAMESPACE_BEGIN(CryptoPP)
-#if CRYPTOPP_DEBUG && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
+#if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
void TestInstantiations_gfpcrypt()
{
GDSA<SHA>::Signer test;
diff --git a/integer.cpp b/integer.cpp
index e1d59f8b..e4d7993c 100644
--- a/integer.cpp
+++ b/integer.cpp
@@ -2637,7 +2637,7 @@ static inline void AtomicDivide(word *Q, const word *A, const word *B)
Q[1] = SubatomicDivide(T+1, B[0], B[1]);
Q[0] = SubatomicDivide(T, B[0], B[1]);
-#if CRYPTOPP_DEBUG
+#if defined(CRYPTOPP_DEBUG)
// multiply quotient and divisor and add remainder, make sure it equals dividend
CRYPTOPP_ASSERT(!T[2] && !T[3] && (T[1] < B[1] || (T[1]==B[1] && T[0]<B[0])));
word P[4];
@@ -2656,7 +2656,7 @@ static inline void AtomicDivide(word *Q, const word *A, const word *B)
Q[0] = q.GetLowHalf();
Q[1] = q.GetHighHalf();
-#if CRYPTOPP_DEBUG
+#if defined(CRYPTOPP_DEBUG)
if (B[0] || B[1])
{
// multiply quotient and divisor and add remainder, make sure it equals dividend
diff --git a/luc.cpp b/luc.cpp
index 013f972d..707b6f5e 100644
--- a/luc.cpp
+++ b/luc.cpp
@@ -10,7 +10,7 @@
NAMESPACE_BEGIN(CryptoPP)
-#if CRYPTOPP_DEBUG && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
+#if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
void LUC_TestInstantiations()
{
LUC_HMP<SHA>::Signer t1;
diff --git a/md5.cpp b/md5.cpp
index a5758d17..3bdc7379 100644
--- a/md5.cpp
+++ b/md5.cpp
@@ -9,7 +9,7 @@
NAMESPACE_BEGIN(CryptoPP)
namespace Weak1 {
-#if CRYPTOPP_DEBUG && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
+#if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
void MD5_TestInstantiations()
{
MD5 x;
diff --git a/modes.cpp b/modes.cpp
index 5937588e..8441cd1f 100644
--- a/modes.cpp
+++ b/modes.cpp
@@ -7,13 +7,13 @@
#include "modes.h"
#include "misc.h"
-//#if CRYPTOPP_DEBUG
+#if defined(CRYPTOPP_DEBUG)
#include "des.h"
-//#endif
+#endif
NAMESPACE_BEGIN(CryptoPP)
-#if CRYPTOPP_DEBUG && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
+#if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
void Modes_TestInstantiations()
{
CFB_Mode<DES>::Encryption m0;
diff --git a/mqv.cpp b/mqv.cpp
index 6232ea83..3bf6a252 100644
--- a/mqv.cpp
+++ b/mqv.cpp
@@ -9,7 +9,7 @@
NAMESPACE_BEGIN(CryptoPP)
-#if CRYPTOPP_DEBUG && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
+#if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
void TestInstantiations_MQV()
{
MQV mqv;
diff --git a/rsa.cpp b/rsa.cpp
index f151b403..24532c7b 100644
--- a/rsa.cpp
+++ b/rsa.cpp
@@ -10,7 +10,7 @@
#include "algparam.h"
#include "fips140.h"
-#if CRYPTOPP_DEBUG && !defined(CRYPTOPP_DOXYGEN_PROCESSING) && !defined(CRYPTOPP_IS_DLL)
+#if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) && !defined(CRYPTOPP_IS_DLL)
#include "pssr.h"
NAMESPACE_BEGIN(CryptoPP)
void RSA_TestInstantiations()
diff --git a/salsa.cpp b/salsa.cpp
index 0196627a..528d8615 100644
--- a/salsa.cpp
+++ b/salsa.cpp
@@ -32,7 +32,7 @@
NAMESPACE_BEGIN(CryptoPP)
-#if CRYPTOPP_DEBUG && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
+#if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
void Salsa20_TestInstantiations()
{
Salsa20::Encryption x1;
diff --git a/seal.cpp b/seal.cpp
index ccc8af19..99aef772 100644
--- a/seal.cpp
+++ b/seal.cpp
@@ -10,7 +10,7 @@
NAMESPACE_BEGIN(CryptoPP)
-#if CRYPTOPP_DEBUG && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
+#if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
void SEAL_TestInstantiations()
{
SEAL<>::Encryption x;
diff --git a/test.cpp b/test.cpp
index 97d8731b..dbde50c2 100644
--- a/test.cpp
+++ b/test.cpp
@@ -126,7 +126,7 @@ RandomNumberGenerator & GlobalRNG()
}
// See misc.h and trap.h for comments and usage
-#if CRYPTOPP_DEBUG && defined(UNIX_SIGNALS_AVAILABLE)
+#if defined(CRYPTOPP_DEBUG) && defined(UNIX_SIGNALS_AVAILABLE)
static const SignalHandler<SIGTRAP, false> s_dummyHandler;
// static const DebugTrapHandler s_dummyHandler;
#endif
diff --git a/trap.h b/trap.h
index 89a6be71..62b14349 100644
--- a/trap.h
+++ b/trap.h
@@ -18,7 +18,7 @@
#include "config.h"
-#if CRYPTOPP_DEBUG
+#if defined(CRYPTOPP_DEBUG)
# include <iostream>
# include <sstream>
# if defined(UNIX_SIGNALS_AVAILABLE)
@@ -46,7 +46,7 @@
//! \details An example of using \ref CRYPTOPP_ASSERT "CRYPTOPP_ASSERT" and DebugTrapHandler is shown below. The library's
//! test program, <tt>cryptest.exe</tt> (from test.cpp), exercises the structure:
//! <pre>
-//! #if CRYPTOPP_DEBUG && (defined(CRYPTOPP_BSD_AVAILABLE) || defined(CRYPTOPP_UNIX_AVAILABLE))
+//! #if defined(CRYPTOPP_DEBUG) && defined(UNIX_SIGNALS_AVAILABLE)
//! static const DebugTrapHandler g_dummyHandler;
//! #endif
//!
@@ -62,7 +62,7 @@
# define CRYPTOPP_ASSERT(exp) { ... }
#endif
-#if CRYPTOPP_DEBUG && defined(UNIX_SIGNALS_AVAILABLE)
+#if defined(CRYPTOPP_DEBUG) && defined(UNIX_SIGNALS_AVAILABLE)
# define CRYPTOPP_ASSERT(exp) { \
if (!(exp)) { \
std::ostringstream oss; \
@@ -89,7 +89,7 @@
// Remove CRYPTOPP_ASSERT in non-debug builds.
// Can't use CRYPTOPP_UNUSED due to circular dependency
#ifndef CRYPTOPP_ASSERT
-# define CRYPTOPP_ASSERT(exp) ((void)(exp))
+# define CRYPTOPP_ASSERT(exp) ((void)0)
#endif
NAMESPACE_BEGIN(CryptoPP)
@@ -119,7 +119,7 @@ NAMESPACE_BEGIN(CryptoPP)
//! \details An example of using \ref CRYPTOPP_ASSERT "CRYPTOPP_ASSERT" and DebugTrapHandler is shown below. The library's
//! test program, <tt>cryptest.exe</tt> (from test.cpp), exercises the structure:
//! <pre>
-//! #if CRYPTOPP_DEBUG && (defined(CRYPTOPP_BSD_AVAILABLE) || defined(CRYPTOPP_UNIX_AVAILABLE))
+//! #if defined(CRYPTOPP_DEBUG) && defined(UNIX_SIGNALS_AVAILABLE)
//! static const DebugTrapHandler g_dummyHandler;
//! #endif
//!
diff --git a/validat1.cpp b/validat1.cpp
index 9b7fcf54..fdda7957 100644
--- a/validat1.cpp
+++ b/validat1.cpp
@@ -78,7 +78,7 @@ bool ValidateAll(bool thorough)
pass=TestRDSEED() && pass;
#endif
-#if CRYPTOPP_DEBUG && !defined(CRYPTOPP_IMPORTS)
+#if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_IMPORTS)
// http://github.com/weidai11/cryptopp/issues/92
pass=TestSecBlock() && pass;
// http://github.com/weidai11/cryptopp/issues/64
@@ -330,7 +330,7 @@ bool TestSettings()
return pass;
}
-#if CRYPTOPP_DEBUG && !defined(CRYPTOPP_IMPORTS)
+#if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_IMPORTS)
bool TestSecBlock()
{
cout << "\nTesting SecBlock...\n\n";
@@ -1264,7 +1264,7 @@ bool TestSecBlock()
}
#endif
-#if CRYPTOPP_DEBUG && !defined(CRYPTOPP_IMPORTS)
+#if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_IMPORTS)
bool TestHuffmanCodes()
{
cout << "\nTesting Huffman codes...\n\n";
diff --git a/validat2.cpp b/validat2.cpp
index 847491f4..16b98147 100644
--- a/validat2.cpp
+++ b/validat2.cpp
@@ -794,7 +794,7 @@ bool ValidateBlumGoldwasser()
}
*/
-#if CRYPTOPP_DEBUG && !defined(CRYPTOPP_IMPORTS)
+#if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_IMPORTS)
// Issue 64: "PolynomialMod2::operator<<=", http://github.com/weidai11/cryptopp/issues/64
bool TestPolynomialMod2()
{
diff --git a/validate.h b/validate.h
index 3c9ac617..c3d22525 100644
--- a/validate.h
+++ b/validate.h
@@ -90,7 +90,7 @@ bool ValidateEC2N();
bool ValidateECDSA();
bool ValidateESIGN();
-#if CRYPTOPP_DEBUG
+#if defined(CRYPTOPP_DEBUG)
bool TestSecBlock();
bool TestPolynomialMod2();
bool TestHuffmanCodes();
diff --git a/wake.cpp b/wake.cpp
index bdcee981..87a1f66b 100644
--- a/wake.cpp
+++ b/wake.cpp
@@ -7,7 +7,7 @@
NAMESPACE_BEGIN(CryptoPP)
-#if CRYPTOPP_DEBUG && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
+#if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
void WAKE_TestInstantiations()
{
WAKE_OFB<>::Encryption x2;
diff --git a/whrlpool.cpp b/whrlpool.cpp
index 853e1bc4..dc7c7c94 100644
--- a/whrlpool.cpp
+++ b/whrlpool.cpp
@@ -85,7 +85,7 @@
NAMESPACE_BEGIN(CryptoPP)
-#if CRYPTOPP_DEBUG && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
+#if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
void Whirlpool_TestInstantiations()
{
Whirlpool x;