fix compile on ICC 11
parent
a47f06515b
commit
e4295fda97
|
|
@ -35,6 +35,12 @@ CXXFLAGS += -march=native -mtune=native
|
||||||
endif
|
endif
|
||||||
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
|
ifeq ($(GAS210_OR_LATER),0) # .intel_syntax wasn't supported until GNU assembler 2.10
|
||||||
CXXFLAGS += -DCRYPTOPP_DISABLE_ASM
|
CXXFLAGS += -DCRYPTOPP_DISABLE_ASM
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,8 @@ public:
|
||||||
void Update(const byte *input, size_t length);
|
void Update(const byte *input, size_t length);
|
||||||
void TruncatedFinal(byte *hash, size_t size);
|
void TruncatedFinal(byte *hash, size_t size);
|
||||||
unsigned int DigestSize() const {return DIGESTSIZE;}
|
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:
|
private:
|
||||||
void Reset() {m_s1 = 1; m_s2 = 0;}
|
void Reset() {m_s1 = 1; m_s2 = 0;}
|
||||||
|
|
|
||||||
42
bench.cpp
42
bench.cpp
|
|
@ -3,10 +3,6 @@
|
||||||
#define _CRT_SECURE_NO_DEPRECATE
|
#define _CRT_SECURE_NO_DEPRECATE
|
||||||
|
|
||||||
#include "bench.h"
|
#include "bench.h"
|
||||||
#include "crc.h"
|
|
||||||
#include "adler32.h"
|
|
||||||
#include "wake.h"
|
|
||||||
#include "seal.h"
|
|
||||||
#include "aes.h"
|
#include "aes.h"
|
||||||
#include "blumshub.h"
|
#include "blumshub.h"
|
||||||
#include "rng.h"
|
#include "rng.h"
|
||||||
|
|
@ -177,34 +173,6 @@ void BenchMarkKeying(SimpleKeyingInterface &c, size_t keyLength, const NameValue
|
||||||
OutputResultKeying(iterations, timeTaken);
|
OutputResultKeying(iterations, timeTaken);
|
||||||
}
|
}
|
||||||
|
|
||||||
//VC60 workaround: compiler bug triggered without the extra dummy parameters
|
|
||||||
template <class T>
|
|
||||||
void BenchMarkKeyed(const char *name, double timeTotal, const NameValuePairs ¶ms = 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 ¶ms = 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
|
//VC60 workaround: compiler bug triggered without the extra dummy parameters
|
||||||
// on VC60 also needs to be named differently from BenchMarkByName
|
// on VC60 also needs to be named differently from BenchMarkByName
|
||||||
template <class T_FactoryOutput, class T_Interface>
|
template <class T_FactoryOutput, class T_Interface>
|
||||||
|
|
@ -282,8 +250,8 @@ void BenchmarkAll(double t, double hertz)
|
||||||
BenchMarkByName<MessageAuthenticationCode>("DMAC(AES)");
|
BenchMarkByName<MessageAuthenticationCode>("DMAC(AES)");
|
||||||
|
|
||||||
cout << "\n<TBODY style=\"background: yellow\">";
|
cout << "\n<TBODY style=\"background: yellow\">";
|
||||||
BenchMarkKeyless<CRC32>("CRC-32", t);
|
BenchMarkByNameKeyLess<HashTransformation>("CRC32");
|
||||||
BenchMarkKeyless<Adler32>("Adler-32", t);
|
BenchMarkByNameKeyLess<HashTransformation>("Adler32");
|
||||||
BenchMarkByNameKeyLess<HashTransformation>("MD5");
|
BenchMarkByNameKeyLess<HashTransformation>("MD5");
|
||||||
BenchMarkByNameKeyLess<HashTransformation>("SHA-1");
|
BenchMarkByNameKeyLess<HashTransformation>("SHA-1");
|
||||||
BenchMarkByNameKeyLess<HashTransformation>("SHA-256");
|
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>("Salsa20", 0, "Salsa20/8", MakeParameters(Name::Rounds(), 8));
|
||||||
BenchMarkByName<SymmetricCipher>("Sosemanuk");
|
BenchMarkByName<SymmetricCipher>("Sosemanuk");
|
||||||
BenchMarkByName<SymmetricCipher>("MARC4");
|
BenchMarkByName<SymmetricCipher>("MARC4");
|
||||||
BenchMarkKeyed<SEAL<BigEndian>::Encryption>("SEAL-3.0-BE", t);
|
BenchMarkByName<SymmetricCipher>("SEAL-3.0-LE");
|
||||||
BenchMarkKeyed<SEAL<LittleEndian>::Encryption>("SEAL-3.0-LE", t);
|
BenchMarkByName<SymmetricCipher>("WAKE-OFB-LE");
|
||||||
BenchMarkKeyed<WAKE_OFB<BigEndian>::Encryption>("WAKE-OFB-BE", t);
|
|
||||||
BenchMarkKeyed<WAKE_OFB<LittleEndian>::Encryption>("WAKE-OFB-LE", t);
|
|
||||||
|
|
||||||
cout << "\n<TBODY style=\"background: yellow\">";
|
cout << "\n<TBODY style=\"background: yellow\">";
|
||||||
BenchMarkByName<SymmetricCipher>("AES/CTR", 16);
|
BenchMarkByName<SymmetricCipher>("AES/CTR", 16);
|
||||||
|
|
|
||||||
3
crc.h
3
crc.h
|
|
@ -24,7 +24,8 @@ public:
|
||||||
void Update(const byte *input, size_t length);
|
void Update(const byte *input, size_t length);
|
||||||
void TruncatedFinal(byte *hash, size_t size);
|
void TruncatedFinal(byte *hash, size_t size);
|
||||||
unsigned int DigestSize() const {return DIGESTSIZE;}
|
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);}
|
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];}
|
byte GetCrcByte(size_t i) const {return ((byte *)&(m_crc))[i];}
|
||||||
|
|
|
||||||
3
dll.h
3
dll.h
|
|
@ -10,6 +10,8 @@
|
||||||
|
|
||||||
#include "aes.h"
|
#include "aes.h"
|
||||||
#include "cbcmac.h"
|
#include "cbcmac.h"
|
||||||
|
#include "ccm.h"
|
||||||
|
#include "cmac.h"
|
||||||
#include "channels.h"
|
#include "channels.h"
|
||||||
#include "des.h"
|
#include "des.h"
|
||||||
#include "dh.h"
|
#include "dh.h"
|
||||||
|
|
@ -19,6 +21,7 @@
|
||||||
#include "ecp.h"
|
#include "ecp.h"
|
||||||
#include "files.h"
|
#include "files.h"
|
||||||
#include "fips140.h"
|
#include "fips140.h"
|
||||||
|
#include "gcm.h"
|
||||||
#include "hex.h"
|
#include "hex.h"
|
||||||
#include "hmac.h"
|
#include "hmac.h"
|
||||||
#include "modes.h"
|
#include "modes.h"
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,10 @@
|
||||||
#include "dmac.h"
|
#include "dmac.h"
|
||||||
#include "blowfish.h"
|
#include "blowfish.h"
|
||||||
#include "seed.h"
|
#include "seed.h"
|
||||||
|
#include "wake.h"
|
||||||
|
#include "seal.h"
|
||||||
|
#include "crc.h"
|
||||||
|
#include "adler32.h"
|
||||||
|
|
||||||
USING_NAMESPACE(CryptoPP)
|
USING_NAMESPACE(CryptoPP)
|
||||||
|
|
||||||
|
|
@ -52,6 +56,8 @@ void RegisterFactories()
|
||||||
return;
|
return;
|
||||||
|
|
||||||
RegisterDefaultFactoryFor<SimpleKeyAgreementDomain, DH>();
|
RegisterDefaultFactoryFor<SimpleKeyAgreementDomain, DH>();
|
||||||
|
RegisterDefaultFactoryFor<HashTransformation, CRC32>();
|
||||||
|
RegisterDefaultFactoryFor<HashTransformation, Adler32>();
|
||||||
RegisterDefaultFactoryFor<HashTransformation, Weak::MD5>();
|
RegisterDefaultFactoryFor<HashTransformation, Weak::MD5>();
|
||||||
RegisterDefaultFactoryFor<HashTransformation, SHA1>();
|
RegisterDefaultFactoryFor<HashTransformation, SHA1>();
|
||||||
RegisterDefaultFactoryFor<HashTransformation, SHA224>();
|
RegisterDefaultFactoryFor<HashTransformation, SHA224>();
|
||||||
|
|
@ -102,6 +108,8 @@ void RegisterFactories()
|
||||||
RegisterSymmetricCipherDefaultFactories<Salsa20>();
|
RegisterSymmetricCipherDefaultFactories<Salsa20>();
|
||||||
RegisterSymmetricCipherDefaultFactories<Sosemanuk>();
|
RegisterSymmetricCipherDefaultFactories<Sosemanuk>();
|
||||||
RegisterSymmetricCipherDefaultFactories<Weak::MARC4>();
|
RegisterSymmetricCipherDefaultFactories<Weak::MARC4>();
|
||||||
|
RegisterSymmetricCipherDefaultFactories<WAKE_OFB<LittleEndian> >();
|
||||||
|
RegisterSymmetricCipherDefaultFactories<SEAL<LittleEndian> >();
|
||||||
RegisterAuthenticatedSymmetricCipherDefaultFactories<CCM<AES> >();
|
RegisterAuthenticatedSymmetricCipherDefaultFactories<CCM<AES> >();
|
||||||
RegisterAuthenticatedSymmetricCipherDefaultFactories<GCM<AES> >();
|
RegisterAuthenticatedSymmetricCipherDefaultFactories<GCM<AES> >();
|
||||||
RegisterSymmetricCipherDefaultFactories<CTR_Mode<Camellia> >();
|
RegisterSymmetricCipherDefaultFactories<CTR_Mode<Camellia> >();
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ class CRYPTOPP_NO_VTABLE AbstractPolicyHolder : public BASE
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef POLICY_INTERFACE PolicyInterface;
|
typedef POLICY_INTERFACE PolicyInterface;
|
||||||
|
virtual ~AbstractPolicyHolder() {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual const POLICY_INTERFACE & GetPolicy() const =0;
|
virtual const POLICY_INTERFACE & GetPolicy() const =0;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue