summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorweidai <weidai11@users.noreply.github.com>2009-03-04 09:27:52 +0000
committerweidai <weidai11@users.noreply.github.com>2009-03-04 09:27:52 +0000
commite4295fda977bcbddb3d14d344ba45c19c43c6b28 (patch)
treedaab854b2a29bd8884224e9118cecebf04ca53c7
parenta47f06515b523ff17b8fcd3a6a124772813364a0 (diff)
downloadcryptopp-git-e4295fda977bcbddb3d14d344ba45c19c43c6b28.tar.gz
fix compile on ICC 11
-rw-r--r--GNUmakefile6
-rw-r--r--adler32.h3
-rw-r--r--bench.cpp42
-rw-r--r--crc.h3
-rw-r--r--dll.h3
-rw-r--r--regtest.cpp8
-rw-r--r--strciphr.h1
7 files changed, 26 insertions, 40 deletions
diff --git a/GNUmakefile b/GNUmakefile
index d59c71c5..8f075529 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -35,6 +35,12 @@ CXXFLAGS += -march=native -mtune=native
endif
endif
+ifneq ($(INTEL_COMPILER),0)
+# "internal error: backend signals" occurs on some x86 inline assembly with ICC 9 and some x64 inline assembly with ICC 11
+# if you want to use Crypto++'s assembly code with ICC, try enabling it on individual files
+CXXFLAGS += -DCRYPTOPP_DISABLE_ASM
+endif
+
ifeq ($(GAS210_OR_LATER),0) # .intel_syntax wasn't supported until GNU assembler 2.10
CXXFLAGS += -DCRYPTOPP_DISABLE_ASM
else
diff --git a/adler32.h b/adler32.h
index 1cc90ce6..0ed803da 100644
--- a/adler32.h
+++ b/adler32.h
@@ -14,7 +14,8 @@ public:
void Update(const byte *input, size_t length);
void TruncatedFinal(byte *hash, size_t size);
unsigned int DigestSize() const {return DIGESTSIZE;}
- std::string AlgorithmName() const {return "Adler32";}
+ static const char * StaticAlgorithmName() {return "Adler32";}
+ std::string AlgorithmName() const {return StaticAlgorithmName();}
private:
void Reset() {m_s1 = 1; m_s2 = 0;}
diff --git a/bench.cpp b/bench.cpp
index a48d06d7..ca83b30e 100644
--- a/bench.cpp
+++ b/bench.cpp
@@ -3,10 +3,6 @@
#define _CRT_SECURE_NO_DEPRECATE
#include "bench.h"
-#include "crc.h"
-#include "adler32.h"
-#include "wake.h"
-#include "seal.h"
#include "aes.h"
#include "blumshub.h"
#include "rng.h"
@@ -178,34 +174,6 @@ void BenchMarkKeying(SimpleKeyingInterface &c, size_t keyLength, const NameValue
}
//VC60 workaround: compiler bug triggered without the extra dummy parameters
-template <class T>
-void BenchMarkKeyed(const char *name, double timeTotal, const NameValuePairs &params = g_nullNameValuePairs, T *x=NULL)
-{
- T c;
- c.SetKey(key, c.DefaultKeyLength(), CombinedNameValuePairs(params, MakeParameters(Name::IV(), ConstByteArrayParameter(key, c.IVSize()), false)));
- BenchMark(name, c, timeTotal);
- BenchMarkKeying(c, c.DefaultKeyLength(), CombinedNameValuePairs(params, MakeParameters(Name::IV(), ConstByteArrayParameter(key, c.IVSize()), false)));
-}
-
-//VC60 workaround: compiler bug triggered without the extra dummy parameters
-template <class T>
-void BenchMarkKeyedVariable(const char *name, double timeTotal, unsigned int keyLength, const NameValuePairs &params = g_nullNameValuePairs, T *x=NULL)
-{
- T c;
- c.SetKey(key, keyLength, CombinedNameValuePairs(params, MakeParameters(Name::IV(), ConstByteArrayParameter(key, c.IVSize()), false)));
- BenchMark(name, c, timeTotal);
- BenchMarkKeying(c, keyLength, CombinedNameValuePairs(params, MakeParameters(Name::IV(), ConstByteArrayParameter(key, c.IVSize()), false)));
-}
-
-//VC60 workaround: compiler bug triggered without the extra dummy parameters
-template <class T>
-void BenchMarkKeyless(const char *name, double timeTotal, T *x=NULL)
-{
- T c;
- BenchMark(name, c, timeTotal);
-}
-
-//VC60 workaround: compiler bug triggered without the extra dummy parameters
// on VC60 also needs to be named differently from BenchMarkByName
template <class T_FactoryOutput, class T_Interface>
void BenchMarkByName2(const char *factoryName, size_t keyLength = 0, const char *displayName=NULL, const NameValuePairs &params = g_nullNameValuePairs, T_FactoryOutput *x=NULL, T_Interface *y=NULL)
@@ -282,8 +250,8 @@ void BenchmarkAll(double t, double hertz)
BenchMarkByName<MessageAuthenticationCode>("DMAC(AES)");
cout << "\n<TBODY style=\"background: yellow\">";
- BenchMarkKeyless<CRC32>("CRC-32", t);
- BenchMarkKeyless<Adler32>("Adler-32", t);
+ BenchMarkByNameKeyLess<HashTransformation>("CRC32");
+ BenchMarkByNameKeyLess<HashTransformation>("Adler32");
BenchMarkByNameKeyLess<HashTransformation>("MD5");
BenchMarkByNameKeyLess<HashTransformation>("SHA-1");
BenchMarkByNameKeyLess<HashTransformation>("SHA-256");
@@ -303,10 +271,8 @@ void BenchmarkAll(double t, double hertz)
BenchMarkByName<SymmetricCipher>("Salsa20", 0, "Salsa20/8", MakeParameters(Name::Rounds(), 8));
BenchMarkByName<SymmetricCipher>("Sosemanuk");
BenchMarkByName<SymmetricCipher>("MARC4");
- BenchMarkKeyed<SEAL<BigEndian>::Encryption>("SEAL-3.0-BE", t);
- BenchMarkKeyed<SEAL<LittleEndian>::Encryption>("SEAL-3.0-LE", t);
- BenchMarkKeyed<WAKE_OFB<BigEndian>::Encryption>("WAKE-OFB-BE", t);
- BenchMarkKeyed<WAKE_OFB<LittleEndian>::Encryption>("WAKE-OFB-LE", t);
+ BenchMarkByName<SymmetricCipher>("SEAL-3.0-LE");
+ BenchMarkByName<SymmetricCipher>("WAKE-OFB-LE");
cout << "\n<TBODY style=\"background: yellow\">";
BenchMarkByName<SymmetricCipher>("AES/CTR", 16);
diff --git a/crc.h b/crc.h
index 1cacf5b5..f75ea384 100644
--- a/crc.h
+++ b/crc.h
@@ -24,7 +24,8 @@ public:
void Update(const byte *input, size_t length);
void TruncatedFinal(byte *hash, size_t size);
unsigned int DigestSize() const {return DIGESTSIZE;}
- std::string AlgorithmName() const {return "CRC32";}
+ static const char * StaticAlgorithmName() {return "CRC32";}
+ std::string AlgorithmName() const {return StaticAlgorithmName();}
void UpdateByte(byte b) {m_crc = m_tab[CRC32_INDEX(m_crc) ^ b] ^ CRC32_SHIFTED(m_crc);}
byte GetCrcByte(size_t i) const {return ((byte *)&(m_crc))[i];}
diff --git a/dll.h b/dll.h
index c046ca0a..5e42d46f 100644
--- a/dll.h
+++ b/dll.h
@@ -10,6 +10,8 @@
#include "aes.h"
#include "cbcmac.h"
+#include "ccm.h"
+#include "cmac.h"
#include "channels.h"
#include "des.h"
#include "dh.h"
@@ -19,6 +21,7 @@
#include "ecp.h"
#include "files.h"
#include "fips140.h"
+#include "gcm.h"
#include "hex.h"
#include "hmac.h"
#include "modes.h"
diff --git a/regtest.cpp b/regtest.cpp
index 8f85bc9f..6a32e6cf 100644
--- a/regtest.cpp
+++ b/regtest.cpp
@@ -42,6 +42,10 @@
#include "dmac.h"
#include "blowfish.h"
#include "seed.h"
+#include "wake.h"
+#include "seal.h"
+#include "crc.h"
+#include "adler32.h"
USING_NAMESPACE(CryptoPP)
@@ -52,6 +56,8 @@ void RegisterFactories()
return;
RegisterDefaultFactoryFor<SimpleKeyAgreementDomain, DH>();
+ RegisterDefaultFactoryFor<HashTransformation, CRC32>();
+ RegisterDefaultFactoryFor<HashTransformation, Adler32>();
RegisterDefaultFactoryFor<HashTransformation, Weak::MD5>();
RegisterDefaultFactoryFor<HashTransformation, SHA1>();
RegisterDefaultFactoryFor<HashTransformation, SHA224>();
@@ -102,6 +108,8 @@ void RegisterFactories()
RegisterSymmetricCipherDefaultFactories<Salsa20>();
RegisterSymmetricCipherDefaultFactories<Sosemanuk>();
RegisterSymmetricCipherDefaultFactories<Weak::MARC4>();
+ RegisterSymmetricCipherDefaultFactories<WAKE_OFB<LittleEndian> >();
+ RegisterSymmetricCipherDefaultFactories<SEAL<LittleEndian> >();
RegisterAuthenticatedSymmetricCipherDefaultFactories<CCM<AES> >();
RegisterAuthenticatedSymmetricCipherDefaultFactories<GCM<AES> >();
RegisterSymmetricCipherDefaultFactories<CTR_Mode<Camellia> >();
diff --git a/strciphr.h b/strciphr.h
index 9334b0cd..d4ad79a2 100644
--- a/strciphr.h
+++ b/strciphr.h
@@ -39,6 +39,7 @@ class CRYPTOPP_NO_VTABLE AbstractPolicyHolder : public BASE
{
public:
typedef POLICY_INTERFACE PolicyInterface;
+ virtual ~AbstractPolicyHolder() {}
protected:
virtual const POLICY_INTERFACE & GetPolicy() const =0;