diff --git a/GNUmakefile b/GNUmakefile index 12b1542c..f1db629b 100755 --- a/GNUmakefile +++ b/GNUmakefile @@ -30,9 +30,9 @@ IS_DARWIN := $(shell $(CXX) -dumpmachine 2>&1 | $(EGREP) -i -c "Darwin") IS_NETBSD := $(shell $(CXX) -dumpmachine 2>&1 | $(EGREP) -i -c "NetBSD") SUN_COMPILER := $(shell $(CXX) -V 2>&1 | $(EGREP) -i -c "CC: Sun") -GCC_COMPILER := $(shell $(CXX) --version 2>&1 | $(EGREP) -i -v "clang" | $(EGREP) -i -c "(gcc|g\+\+)") +GCC_COMPILER := $(shell $(CXX) --version 2>&1 | $(EGREP) -i -c "(gcc|g\+\+)") CLANG_COMPILER := $(shell $(CXX) --version 2>&1 | $(EGREP) -i -c "clang") -INTEL_COMPILER := $(shell $(CXX) --version 2>&1 | $(EGREP) -i -c "\(icc\)") +INTEL_COMPILER := $(shell $(CXX) --version 2>&1 | $(EGREP) -c "\(ICC\)") MACPORTS_COMPILER := $(shell $(CXX) --version 2>&1 | $(EGREP) -i -c "macports") # Sun Studio 12.0 (0x0510) and 12.3 (0x0512) @@ -179,9 +179,6 @@ ifeq ($(GCC_COMPILER)$(MACPORTS_COMPILER),11) ifneq ($(findstring -Wa,-q,$(CXXFLAGS)),-Wa,-q) CXXFLAGS += -Wa,-q endif -ifneq ($(findstring -Wa,-q,$(CXXFLAGS)),-DCRYPTOPP_CLANG_INTEGRATED_ASSEMBLER) -CXXFLAGS += -DCRYPTOPP_CLANG_INTEGRATED_ASSEMBLER=1 -endif endif # Allow use of "/" operator for GNU Assembler. diff --git a/blake2.cpp b/blake2.cpp index 0cb858b1..77eef8ce 100644 --- a/blake2.cpp +++ b/blake2.cpp @@ -35,7 +35,7 @@ NAMESPACE_BEGIN(CryptoPP) // Apple Clang 6.0/Clang 3.5 does not have SSSE3 intrinsics // http://llvm.org/bugs/show_bug.cgi?id=20213 -#if (defined(CRYPTOPP_APPLE_CLANG_VERSION) && (CRYPTOPP_APPLE_CLANG_VERSION <= 60000)) || (defined(CRYPTOPP_LLVM_CLANG_VERSION) && (CRYPTOPP_LLVM_CLANG_VERSION <= 30500)) +#if (defined(CRYPTOPP_APPLE_CLANG_VERSION) && (CRYPTOPP_APPLE_CLANG_VERSION <= 60000)) || (defined(CRYPTOPP_CLANG_VERSION) && (CRYPTOPP_CLANG_VERSION <= 30500)) # undef CRYPTOPP_BOOL_SSE4_INTRINSICS_AVAILABLE #endif diff --git a/config.h b/config.h index 9a40f2ba..7ac17fda 100644 --- a/config.h +++ b/config.h @@ -63,9 +63,7 @@ // Define this to choose the FIPS 202 version of SHA3, and not the original version of SHA3. NIST selected Keccak as SHA3 // in January 2013. SHA3 was finalized in FIPS 202 in August 2015, and it was a modified version of the original selection. // If CRYPTOPP_USE_FIPS_202_SHA3 is defined, then sha3_fips_202.txt test vectors will be used instead of sha3.txt. -// #ifndef CRYPTOPP_USE_FIPS_202_SHA3 -// # define CRYPTOPP_USE_FIPS_202_SHA3 -// #endif +// #define CRYPTOPP_USE_FIPS_202_SHA3 // ***************** Less Important Settings *************** @@ -238,11 +236,9 @@ const lword LWORD_MAX = W64LIT(0xffffffffffffffff); // Apple and LLVM's Clang. Apple Clang version 7.0 roughly equals LLVM Clang version 3.7 #if defined(__clang__ ) && !defined(__apple_build_version__) - #define CRYPTOPP_LLVM_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) - #define CRYPTOPP_CLANG_INTEGRATED_ASSEMBLER 1 + #define CRYPTOPP_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) #elif defined(__clang__ ) && defined(__apple_build_version__) #define CRYPTOPP_APPLE_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) - #define CRYPTOPP_CLANG_INTEGRATED_ASSEMBLER 1 #endif #ifdef _MSC_VER @@ -250,13 +246,13 @@ const lword LWORD_MAX = W64LIT(0xffffffffffffffff); #endif // Need GCC 4.6/Clang 1.7/Apple Clang 2.0 or above due to "GCC diagnostic {push|pop}" -#if (CRYPTOPP_GCC_VERSION >= 40600) || (CRYPTOPP_LLVM_CLANG_VERSION >= 10700) || (CRYPTOPP_APPLE_CLANG_VERSION >= 20000) +#if (CRYPTOPP_GCC_VERSION >= 40600) || (CRYPTOPP_CLANG_VERSION >= 10700) || (CRYPTOPP_APPLE_CLANG_VERSION >= 20000) #define CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE 1 #endif // Clang due to "Inline assembly operands don't work with .intel_syntax", http://llvm.org/bugs/show_bug.cgi?id=24232 // TODO: supply the upper version when LLVM fixes it. We set it to 20.0 for compilation purposes. -#if (defined(CRYPTOPP_LLVM_CLANG_VERSION) && CRYPTOPP_LLVM_CLANG_VERSION <= 200000) || (defined(CRYPTOPP_APPLE_CLANG_VERSION) && CRYPTOPP_APPLE_CLANG_VERSION <= 200000) || defined(CRYPTOPP_CLANG_INTEGRATED_ASSEMBLER) +#if (defined(CRYPTOPP_CLANG_VERSION) && CRYPTOPP_CLANG_VERSION <= 200000) || (defined(CRYPTOPP_APPLE_CLANG_VERSION) && CRYPTOPP_APPLE_CLANG_VERSION <= 200000) #define CRYPTOPP_DISABLE_INTEL_ASM 1 #endif @@ -730,7 +726,7 @@ NAMESPACE_END // ************** Deprecated *************** -#if (CRYPTOPP_GCC_VERSION >= 40500) || (CRYPTOPP_LLVM_CLANG_VERSION >= 20800) +#if (CRYPTOPP_GCC_VERSION >= 40500) || (CRYPTOPP_CLANG_VERSION >= 20800) # define CRYPTOPP_DEPRECATED(msg) __attribute__((deprecated (msg))); #elif (CRYPTOPP_GCC_VERSION) # define CRYPTOPP_DEPRECATED(msg) __attribute__((deprecated)); @@ -783,7 +779,7 @@ NAMESPACE_END # define CRYPTOPP_CXX11_SYNCHRONIZATION 1 #elif defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1200) # define CRYPTOPP_CXX11_SYNCHRONIZATION 1 -#elif (CRYPTOPP_LLVM_CLANG_VERSION >= 30300) || (CRYPTOPP_APPLE_CLANG_VERSION >= 50000) +#elif (CRYPTOPP_CLANG_VERSION >= 30300) || (CRYPTOPP_APPLE_CLANG_VERSION >= 50000) # define CRYPTOPP_CXX11_SYNCHRONIZATION 1 #elif (CRYPTOPP_GCC_VERSION >= 40400) # define CRYPTOPP_CXX11_SYNCHRONIZATION 1 diff --git a/config.recommend b/config.recommend index 15b7e781..c9064240 100644 --- a/config.recommend +++ b/config.recommend @@ -63,9 +63,7 @@ // Define this to choose the FIPS 202 version of SHA3, and not the original version of SHA3. NIST selected Keccak as SHA3 // in January 2013. SHA3 was finalized in FIPS 202 in August 2015, and it was a modified version of the original selection. // If CRYPTOPP_USE_FIPS_202_SHA3 is defined, then sha3_fips_202.txt test vectors will be used instead of sha3.txt. -#ifndef CRYPTOPP_USE_FIPS_202_SHA3 -# define CRYPTOPP_USE_FIPS_202_SHA3 -#endif +#define CRYPTOPP_USE_FIPS_202_SHA3 // ***************** Less Important Settings *************** @@ -238,7 +236,7 @@ const lword LWORD_MAX = W64LIT(0xffffffffffffffff); // Apple and LLVM's Clang. Apple Clang version 7.0 roughly equals LLVM Clang version 3.7 #if defined(__clang__ ) && !defined(__apple_build_version__) - #define CRYPTOPP_LLVM_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) + #define CRYPTOPP_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) #elif defined(__clang__ ) && defined(__apple_build_version__) #define CRYPTOPP_APPLE_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) #endif @@ -248,13 +246,13 @@ const lword LWORD_MAX = W64LIT(0xffffffffffffffff); #endif // Need GCC 4.6/Clang 1.7/Apple Clang 2.0 or above due to "GCC diagnostic {push|pop}" -#if (CRYPTOPP_GCC_VERSION >= 40600) || (CRYPTOPP_LLVM_CLANG_VERSION >= 10700) || (CRYPTOPP_APPLE_CLANG_VERSION >= 20000) +#if (CRYPTOPP_GCC_VERSION >= 40600) || (CRYPTOPP_CLANG_VERSION >= 10700) || (CRYPTOPP_APPLE_CLANG_VERSION >= 20000) #define CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE 1 #endif // Clang due to "Inline assembly operands don't work with .intel_syntax", http://llvm.org/bugs/show_bug.cgi?id=24232 // TODO: supply the upper version when LLVM fixes it. We set it to 20.0 for compilation purposes. -#if (defined(CRYPTOPP_LLVM_CLANG_VERSION) && CRYPTOPP_LLVM_CLANG_VERSION <= 200000) || (defined(CRYPTOPP_APPLE_CLANG_VERSION) && CRYPTOPP_APPLE_CLANG_VERSION <= 200000) +#if (defined(CRYPTOPP_CLANG_VERSION) && CRYPTOPP_CLANG_VERSION <= 200000) || (defined(CRYPTOPP_APPLE_CLANG_VERSION) && CRYPTOPP_APPLE_CLANG_VERSION <= 200000) #define CRYPTOPP_DISABLE_INTEL_ASM 1 #endif @@ -726,7 +724,7 @@ NAMESPACE_END // ************** Deprecated *************** -#if (CRYPTOPP_GCC_VERSION >= 40500) || (CRYPTOPP_LLVM_CLANG_VERSION >= 20800) +#if (CRYPTOPP_GCC_VERSION >= 40500) || (CRYPTOPP_CLANG_VERSION >= 20800) # define CRYPTOPP_DEPRECATED(msg) __attribute__((deprecated (msg))); #elif (CRYPTOPP_GCC_VERSION) # define CRYPTOPP_DEPRECATED(msg) __attribute__((deprecated)); @@ -779,7 +777,7 @@ NAMESPACE_END # define CRYPTOPP_CXX11_SYNCHRONIZATION 1 #elif defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1200) # define CRYPTOPP_CXX11_SYNCHRONIZATION 1 -#elif (CRYPTOPP_LLVM_CLANG_VERSION >= 30300) || (CRYPTOPP_APPLE_CLANG_VERSION >= 50000) +#elif (CRYPTOPP_CLANG_VERSION >= 30300) || (CRYPTOPP_APPLE_CLANG_VERSION >= 50000) # define CRYPTOPP_CXX11_SYNCHRONIZATION 1 #elif (CRYPTOPP_GCC_VERSION >= 40400) # define CRYPTOPP_CXX11_SYNCHRONIZATION 1 diff --git a/cpu.cpp b/cpu.cpp index b13dd255..7c39cccd 100644 --- a/cpu.cpp +++ b/cpu.cpp @@ -27,7 +27,7 @@ NAMESPACE_BEGIN(CryptoPP) #ifndef CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY // MacPorts/GCC does not provide constructor(priority). Apple/GCC and Fink/GCC do provide it. -#define HAVE_GCC_CONSTRUCTOR1 (__GNUC__ && (CRYPTOPP_INIT_PRIORITY > 0) && ((CRYPTOPP_GCC_VERSION >= 40300) || (CRYPTOPP_LLVM_CLANG_VERSION >= 20900) || (_INTEL_COMPILER >= 300)) && !(MACPORTS_GCC_COMPILER > 0)) +#define HAVE_GCC_CONSTRUCTOR1 (__GNUC__ && (CRYPTOPP_INIT_PRIORITY > 0) && ((CRYPTOPP_GCC_VERSION >= 40300) || (CRYPTOPP_CLANG_VERSION >= 20900) || (_INTEL_COMPILER >= 300)) && !(MACPORTS_GCC_COMPILER > 0)) #define HAVE_GCC_CONSTRUCTOR0 (__GNUC__ && (CRYPTOPP_INIT_PRIORITY > 0) && !(MACPORTS_GCC_COMPILER > 0)) extern "C" { diff --git a/cpu.h b/cpu.h index b1414a91..890f53db 100644 --- a/cpu.h +++ b/cpu.h @@ -2,7 +2,9 @@ //! \file cpu.h //! \brief Functions for CPU features and intrinsics -//! \details The functions are used in X86/X32/X64 and NEON code paths +//! \details At the moment, the functions are used heavily in X86/X32/X64 code paths +// for SSE, SSE2 and SSE4. The funtions are also used on occassion for AArch32 +//! and AArch64 code paths for NEON. #ifndef CRYPTOPP_CPU_H #define CRYPTOPP_CPU_H @@ -50,7 +52,7 @@ #endif // PUSHFB needs Clang 3.3 and Apple Clang 5.0. -#if !defined(__GNUC__) || defined(__SSSE3__)|| defined(__INTEL_COMPILER) || (CRYPTOPP_LLVM_CLANG_VERSION >= 30300) || (CRYPTOPP_APPLE_CLANG_VERSION >= 50000) +#if !defined(__GNUC__) || defined(__SSSE3__)|| defined(__INTEL_COMPILER) || (CRYPTOPP_CLANG_VERSION >= 30300) || (CRYPTOPP_APPLE_CLANG_VERSION >= 50000) #include #else NAMESPACE_BEGIN(CryptoPP) @@ -64,7 +66,7 @@ NAMESPACE_END #endif // tmmintrin.h // PEXTRD needs Clang 3.3 and Apple Clang 5.0. -#if !defined(__GNUC__) || defined(__SSE4_1__)|| defined(__INTEL_COMPILER) || (CRYPTOPP_LLVM_CLANG_VERSION >= 30300) || (CRYPTOPP_APPLE_CLANG_VERSION >= 50000) +#if !defined(__GNUC__) || defined(__SSE4_1__)|| defined(__INTEL_COMPILER) || (CRYPTOPP_CLANG_VERSION >= 30300) || (CRYPTOPP_APPLE_CLANG_VERSION >= 50000) #include #else NAMESPACE_BEGIN(CryptoPP) @@ -85,7 +87,7 @@ NAMESPACE_END #endif // smmintrin.h // AES needs Clang 2.8 and Apple Clang 4.6. PCLMUL needs Clang 3.4 and Apple Clang 6.0 -#if !defined(__GNUC__) || (defined(__AES__) && defined(__PCLMUL__)) || defined(__INTEL_COMPILER) || (CRYPTOPP_LLVM_CLANG_VERSION >= 30400) || (CRYPTOPP_APPLE_CLANG_VERSION >= 60000) +#if !defined(__GNUC__) || (defined(__AES__) && defined(__PCLMUL__)) || defined(__INTEL_COMPILER) || (CRYPTOPP_CLANG_VERSION >= 30400) || (CRYPTOPP_APPLE_CLANG_VERSION >= 60000) #include #else NAMESPACE_BEGIN(CryptoPP) @@ -139,13 +141,11 @@ NAMESPACE_END NAMESPACE_BEGIN(CryptoPP) -#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64 || CRYPTOPP_DOXYGEN_PROCESSING +#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64 #define CRYPTOPP_CPUID_AVAILABLE -// Hide from Doxygen -#ifndef CRYPTOPP_DOXYGEN_PROCESSING -// These should not be used directly +// these should not be used directly extern CRYPTOPP_DLL bool g_x86DetectionDone; extern CRYPTOPP_DLL bool g_hasMMX; extern CRYPTOPP_DLL bool g_hasISSE; @@ -166,12 +166,7 @@ extern CRYPTOPP_DLL word32 g_cacheLineSize; CRYPTOPP_DLL void CRYPTOPP_API DetectX86Features(); CRYPTOPP_DLL bool CRYPTOPP_API CpuId(word32 input, word32 output[4]); -#endif // CRYPTOPP_DOXYGEN_PROCESSING -//! \brief Determines MMX availability -//! \returns true if MMX is determined to be available, false otherwise -//! \details MMX, SSE and SSE2 are core processor features for x86_64, and -//! the function always returns true for the platform. inline bool HasMMX() { #if CRYPTOPP_BOOL_X64 @@ -183,10 +178,6 @@ inline bool HasMMX() #endif } -//! \brief Determines SSE availability -//! \returns true if SSE is determined to be available, false otherwise -//! \details MMX, SSE and SSE2 are core processor features for x86_64, and -//! the function always returns true for the platform. inline bool HasISSE() { #if CRYPTOPP_BOOL_X64 @@ -198,10 +189,6 @@ inline bool HasISSE() #endif } -//! \brief Determines SSE2 availability -//! \returns true if SSE2 is determined to be available, false otherwise -//! \details MMX, SSE and SSE2 are core processor features for x86_64, and -//! the function always returns true for the platform. inline bool HasSSE2() { #if CRYPTOPP_BOOL_X64 @@ -213,10 +200,6 @@ inline bool HasSSE2() #endif } -//! \brief Determines SSSE3 availability -//! \returns true if SSSE3 is determined to be available, false otherwise -//! \details HasSSSE3() is a runtime check performed using CPUID -//! \note Some Clang compilers incorrectly omit SSSE3 even though its native to the processor. inline bool HasSSSE3() { if (!g_x86DetectionDone) @@ -224,9 +207,6 @@ inline bool HasSSSE3() return g_hasSSSE3; } -//! \brief Determines SSE4 availability -//! \returns true if SSE4.1 and SSE4.2 are determined to be available, false otherwise -//! \details HasSSE4() is a runtime check performed using CPUID which requires both SSE4.1 and SSE4.2 inline bool HasSSE4() { if (!g_x86DetectionDone) @@ -234,9 +214,6 @@ inline bool HasSSE4() return g_hasSSE4; } -//! \brief Determines AES-NI availability -//! \returns true if AES-NI is determined to be available, false otherwise -//! \details HasAESNI() is a runtime check performed using CPUID inline bool HasAESNI() { if (!g_x86DetectionDone) @@ -244,9 +221,6 @@ inline bool HasAESNI() return g_hasAESNI; } -//! \brief Determines Carryless Multiply availability -//! \returns true if pclmulqdq is determined to be available, false otherwise -//! \details HasCLMUL() is a runtime check performed using CPUID inline bool HasCLMUL() { if (!g_x86DetectionDone) @@ -254,9 +228,6 @@ inline bool HasCLMUL() return g_hasCLMUL; } -//! \brief Determines if the CPU is an Intel P4 -//! \returns true if the CPU is a P4, false otherwise -//! \details IsP4() is a runtime check performed using CPUID inline bool IsP4() { if (!g_x86DetectionDone) @@ -264,9 +235,6 @@ inline bool IsP4() return g_isP4; } -//! \brief Determines RDRAND availability -//! \returns true if RDRAND is determined to be available, false otherwise -//! \details HasRDRAND() is a runtime check performed using CPUID inline bool HasRDRAND() { if (!g_x86DetectionDone) @@ -274,9 +242,6 @@ inline bool HasRDRAND() return g_hasRDRAND; } -//! \brief Determines RDSEED availability -//! \returns true if RDSEED is determined to be available, false otherwise -//! \details HasRDSEED() is a runtime check performed using CPUID inline bool HasRDSEED() { if (!g_x86DetectionDone) @@ -284,9 +249,6 @@ inline bool HasRDSEED() return g_hasRDSEED; } -//! \brief Determines Padlock RNG availability -//! \returns true if VIA Padlock RNG is determined to be available, false otherwise -//! \details HasPadlockRNG() is a runtime check performed using CPUID inline bool HasPadlockRNG() { if (!g_x86DetectionDone) @@ -294,9 +256,6 @@ inline bool HasPadlockRNG() return g_hasPadlockRNG; } -//! \brief Determines Padlock ACE availability -//! \returns true if VIA Padlock ACE is determined to be available, false otherwise -//! \details HasPadlockACE() is a runtime check performed using CPUID inline bool HasPadlockACE() { if (!g_x86DetectionDone) @@ -304,9 +263,6 @@ inline bool HasPadlockACE() return g_hasPadlockACE; } -//! \brief Determines Padlock ACE2 availability -//! \returns true if VIA Padlock ACE2 is determined to be available, false otherwise -//! \details HasPadlockACE2() is a runtime check performed using CPUID inline bool HasPadlockACE2() { if (!g_x86DetectionDone) @@ -314,9 +270,6 @@ inline bool HasPadlockACE2() return g_hasPadlockACE2; } -//! \brief Determines Padlock PHE availability -//! \returns true if VIA Padlock PHE is determined to be available, false otherwise -//! \details HasPadlockPHE() is a runtime check performed using CPUID inline bool HasPadlockPHE() { if (!g_x86DetectionDone) @@ -324,9 +277,6 @@ inline bool HasPadlockPHE() return g_hasPadlockPHE; } -//! \brief Determines Padlock PMM availability -//! \returns true if VIA Padlock PMM is determined to be available, false otherwise -//! \details HasPadlockPMM() is a runtime check performed using CPUID inline bool HasPadlockPMM() { if (!g_x86DetectionDone) @@ -334,13 +284,6 @@ inline bool HasPadlockPMM() return g_hasPadlockPMM; } -//! \brief Provides the cache line size -//! \returns lower bound on the size of a cache line in bytes, if available -//! \details GetCacheLineSize() returns the lower bound on the size of a cache line, if it -//! is available. If the value is not available at runtime, then 32 is returned for a 32-bit -//! processor and 64 is returned for a 64-bit processor. -//! \details x86/x32/x64 uses CPUID to determine the value and its usually accurate. The ARM -//! processor equivalent is a privileged instruction, so a compile time value is returned. inline int GetCacheLineSize() { if (!g_x86DetectionDone) @@ -472,7 +415,7 @@ inline int GetCacheLineSize() #else #define CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY -#if defined(CRYPTOPP_LLVM_CLANG_VERSION) || defined(CRYPTOPP_APPLE_CLANG_VERSION) || defined(CRYPTOPP_CLANG_INTEGRATED_ASSEMBLER) +#if defined(CRYPTOPP_CLANG_VERSION) || defined(CRYPTOPP_APPLE_CLANG_VERSION) #define NEW_LINE "\n" #define INTEL_PREFIX ".intel_syntax;" #define INTEL_NOPREFIX ".intel_syntax;" diff --git a/cryptest.sh b/cryptest.sh index d177cd1e..f88287d4 100755 --- a/cryptest.sh +++ b/cryptest.sh @@ -128,8 +128,6 @@ fi SUN_COMPILER=$("$CXX" -V 2>&1 | "$EGREP" -i -c "CC: Sun") GCC_COMPILER=$("$CXX" --version 2>&1 | "$EGREP" -i -c "(gcc|g\+\+)") -INTEL_COMPILER=$("$CXX" --version 2>&1 | "$EGREP" -i -c "\(ICC\)") -MACPORTS_COMPILER=$("$CXX" --version 2>&1 | "$EGREP" -i -c "MacPorts") CLANG_COMPILER=$("$CXX" --version 2>&1 | "$EGREP" -i -c "clang") if [[ ($("$CXX" -dM -E - /dev/null | "$EGREP" -c '(__x64_64__|__amd64__)') -ne "0") && ($("$CXX" -dM -E -/dev/null | "$EGREP" -c '(__ILP32|__ILP32)') -ne "0") ]]; then @@ -137,7 +135,6 @@ if [[ ($("$CXX" -dM -E - /dev/null | "$EGREP" -c '(__x64_64__|__amd fi # Now that the compiler is fixed, see if its GCC 5.1 or above with -Wabi, -Wabi-tag and -Wodr -GCC_60_OR_ABOVE=$("$CXX" -v 2>&1 | "$EGREP" -i -c 'gcc version (6\.[0-9]|[7-9])') GCC_51_OR_ABOVE=$("$CXX" -v 2>&1 | "$EGREP" -i -c 'gcc version (5\.[1-9]|[6-9])') GCC_48_COMPILER=$("$CXX" -v 2>&1 | "$EGREP" -i -c 'gcc version 4\.8') # SunCC 12.2 and below needs one set of CXXFLAGS; SunCC 12.3 and above needs another set of CXXFLAGS @@ -227,14 +224,6 @@ if [[ (-z "$HAVE_CXX03") ]]; then fi fi -if [[ (-z "$HAVE_GNU03") ]]; then - HAVE_GNU03=0 - "$CXX" -DCRYPTOPP_ADHOC_MAIN -std=gnu++03 adhoc.cpp -o "$TMP/adhoc.exe" > /dev/null 2>&1 - if [[ "$?" -eq "0" ]]; then - HAVE_GNU03=1 - fi -fi - HAVE_O3=0 OPT_O3= "$CXX" -DCRYPTOPP_ADHOC_MAIN -O3 adhoc.cpp -o "$TMP/adhoc.exe" > /dev/null 2>&1 @@ -507,7 +496,6 @@ fi # C++03, C++11, C++14 and C++17 echo | tee -a "$TEST_RESULTS" echo "HAVE_CXX03: $HAVE_CXX03" | tee -a "$TEST_RESULTS" -echo "HAVE_GNU03: $HAVE_GNU03" | tee -a "$TEST_RESULTS" echo "HAVE_CXX11: $HAVE_CXX11" | tee -a "$TEST_RESULTS" echo "HAVE_GNU11: $HAVE_GNU11" | tee -a "$TEST_RESULTS" if [[ ("$HAVE_CXX14" -ne "0" || "$HAVE_CXX17" -ne "0" || "$HAVE_GNU14" -ne "0" || "$HAVE_GNU17" -ne "0") ]]; then @@ -708,9 +696,6 @@ if [[ ("$GCC_COMPILER" -ne "0") ]]; then "-Wno-unknown-pragmas" "-Wstrict-aliasing=3" "-Wstrict-overflow" "-Waggressive-loop-optimizations" "-Wcast-align" "-Wwrite-strings" "-Wformat=2" "-Wformat-security" "-Wtrampolines") - if [[ ("$GCC_60_OR_ABOVE" -ne "0") ]]; then - ELEVATED_CXXFLAGS+=("-Wshift-negative-value -Wshift-overflow=2 -Wnull-dereference -Wduplicated-cond -Wodr-type-mismatch") - fi if [[ ("$GCC_51_OR_ABOVE" -ne "0") ]]; then ELEVATED_CXXFLAGS+=("-Wabi" "-Wodr") fi @@ -970,65 +955,6 @@ if [[ "$HAVE_CXX03" -ne "0" ]]; then fi fi -############################################ -# gnu++03 debug and release build -if [[ "$HAVE_GNU03" -ne "0" ]]; then - - ############################################ - # Debug build - echo - echo "************************************" | tee -a "$TEST_RESULTS" - echo "Testing: debug, gnu++03" | tee -a "$TEST_RESULTS" - echo - - unset CXXFLAGS - "$MAKE" clean > /dev/null 2>&1 - rm -f adhoc.cpp > /dev/null 2>&1 - - export CXXFLAGS="$DEBUG_CXXFLAGS -std=gnu++03 ${RETAINED_CXXFLAGS[@]}" - "$MAKE" "${MAKEARGS[@]}" CXX="$CXX" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" - - if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then - echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS" - else - ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" - if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then - echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS" - fi - ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" - if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then - echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS" - fi - fi - - ############################################ - # Release build - echo - echo "************************************" | tee -a "$TEST_RESULTS" - echo "Testing: release, gnu++03" | tee -a "$TEST_RESULTS" - echo - - unset CXXFLAGS - "$MAKE" clean > /dev/null 2>&1 - rm -f adhoc.cpp > /dev/null 2>&1 - - export CXXFLAGS="$RELEASE_CXXFLAGS -std=gnu++03 ${RETAINED_CXXFLAGS[@]}" - "$MAKE" "${MAKEARGS[@]}" CXX="$CXX" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" - - if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then - echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS" - else - ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" - if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then - echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS" - fi - ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" - if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then - echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS" - fi - fi -fi - ############################################ # c++11 debug and release build if [[ "$HAVE_CXX11" -ne "0" ]]; then @@ -3958,75 +3884,6 @@ if [[ ("$INTEL_COMPILER" -eq "0") ]]; then fi fi -############################################ -# Perform a quick check with MacPorts compilers, if available. -if [[ ("$MACPORTS_COMPILER" -eq "0") ]]; then - - MACPORTS_CXX=$(find /opt/local/bin -name 'g++*' 2>/dev/null | head -1) - if [[ (-z "$MACPORTS_CXX") ]]; then - "$MACPORTS_CXX" -x c++ -DCRYPTOPP_ADHOC_MAIN adhoc.cpp.proto -o "$TMP/adhoc.exe" > /dev/null 2>&1 - if [[ "$?" -eq "0" ]]; then - - ############################################ - # GCC build - echo - echo "************************************" | tee -a "$TEST_RESULTS" - echo "Testing: MacPorts GCC compiler" | tee -a "$TEST_RESULTS" - echo - - unset CXXFLAGS - "$MAKE" clean > /dev/null 2>&1 - rm -f adhoc.cpp > /dev/null 2>&1 - - "$MAKE" "${MAKEARGS[@]}" CXX="$MACPORTS_CXX" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" - if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then - echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS" - else - ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" - if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then - echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS" - fi - ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" - if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then - echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS" - fi - fi - fi - fi - - MACPORTS_CXX=$(find /opt/local/bin -name 'clang++*' 2>/dev/null | head -1) - if [[ (-z "$MACPORTS_CXX") ]]; then - "$MACPORTS_CXX" -x c++ -DCRYPTOPP_ADHOC_MAIN adhoc.cpp.proto -o "$TMP/adhoc.exe" > /dev/null 2>&1 - if [[ "$?" -eq "0" ]]; then - - ############################################ - # Clang build - echo - echo "************************************" | tee -a "$TEST_RESULTS" - echo "Testing: MacPorts Clang compiler" | tee -a "$TEST_RESULTS" - echo - - unset CXXFLAGS - "$MAKE" clean > /dev/null 2>&1 - rm -f adhoc.cpp > /dev/null 2>&1 - - "$MAKE" "${MAKEARGS[@]}" CXX="$MACPORTS_CXX" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" - if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then - echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS" - else - ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" - if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then - echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS" - fi - ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" - if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then - echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS" - fi - fi - fi - fi -fi - ############################################ # Perform a quick check with Xcode compiler, if available. if [[ "$IS_DARWIN" -ne "0" ]]; then @@ -4233,14 +4090,14 @@ fi # Report warnings echo -echo "************************************************" | tee -a "$TEST_RESULTS" "$WARN_RESULTS" -echo | tee -a "$TEST_RESULTS" "$WARN_RESULTS" +echo "************************************************" | tee -a "$WARN_RESULTS" +echo | tee -a "$WARN_RESULTS" WCOUNT=$("$EGREP" -a '(warning:)' $WARN_RESULTS | "$GREP" -v 'deprecated-declarations' | wc -l | "$AWK" '{print $1}') if (( "$WCOUNT" == "0" )); then - echo "No warnings detected" | tee -a "$TEST_RESULTS" "$WARN_RESULTS" | tee -a "$TEST_RESULTS" "$WARN_RESULTS" + echo "No warnings detected" | tee -a "$WARN_RESULTS" | tee -a "$WARN_RESULTS" else - echo "$WCOUNT warnings detected. See $WARN_RESULTS for details" | tee -a "$TEST_RESULTS" "$WARN_RESULTS" + echo "$WCOUNT warnings detected. See $WARN_RESULTS for details" | tee -a "$WARN_RESULTS" # "$EGREP" -an '(warning:)' $WARN_RESULTS | "$GREP" -v 'deprecated-declarations' fi @@ -4249,8 +4106,8 @@ fi echo echo "************************************************" | tee -a "$TEST_RESULTS" "$WARN_RESULTS" -echo | tee -a "$TEST_RESULTS" "$WARN_RESULTS" +echo echo "Testing started: $TEST_BEGIN" | tee -a "$TEST_RESULTS" "$WARN_RESULTS" echo "Testing finished: $TEST_END" | tee -a "$TEST_RESULTS" "$WARN_RESULTS" echo diff --git a/default.h b/default.h index 6b30f2e4..00ec6647 100644 --- a/default.h +++ b/default.h @@ -48,7 +48,7 @@ private: SecByteBlock m_passphrase; CBC_Mode::Encryption m_cipher; -#if (CRYPTOPP_GCC_VERSION >= 40500) || (CRYPTOPP_LLVM_CLANG_VERSION >= 20800) +#if (CRYPTOPP_GCC_VERSION >= 40500) || (CRYPTOPP_CLANG_VERSION >= 20800) } __attribute__((deprecated ("DefaultEncryptor will be changing in the near future because the algorithms are no longer secure"))); #elif (CRYPTOPP_GCC_VERSION) } __attribute__((deprecated)); @@ -68,7 +68,7 @@ public: //! \param attachment a BufferedTransformation to attach to this object //! \param throwException a flag specifiying whether an Exception should be thrown on error DefaultDecryptor(const char *passphrase, BufferedTransformation *attachment = NULL, bool throwException=true); - + //! \brief Constructs a DefaultDecryptor //! \param passphrase a byte string password //! \param passphraseLength the length of the byte string password @@ -79,7 +79,7 @@ public: class Err : public Exception { public: - Err(const std::string &s) + Err(const std::string &s) : Exception(DATA_INTEGRITY_CHECK_FAILED, s) {} }; class KeyBadErr : public Err {public: KeyBadErr() : Err("DefaultDecryptor: cannot decrypt message with this passphrase") {}}; @@ -101,7 +101,7 @@ private: member_ptr m_decryptor; bool m_throwException; -#if (CRYPTOPP_GCC_VERSION >= 40500) || (CRYPTOPP_LLVM_CLANG_VERSION >= 20800) +#if (CRYPTOPP_GCC_VERSION >= 40500) || (CRYPTOPP_CLANG_VERSION >= 20800) } __attribute__((deprecated ("DefaultDecryptor will be changing in the near future because the algorithms are no longer secure"))); #elif (CRYPTOPP_GCC_VERSION) } __attribute__((deprecated)); @@ -139,7 +139,7 @@ protected: private: member_ptr m_mac; -#if (CRYPTOPP_GCC_VERSION >= 40500) || (CRYPTOPP_LLVM_CLANG_VERSION >= 20800) +#if (CRYPTOPP_GCC_VERSION >= 40500) || (CRYPTOPP_CLANG_VERSION >= 20800) } __attribute__((deprecated ("DefaultEncryptorWithMAC will be changing in the near future because the algorithms are no longer secure"))); #elif (CRYPTOPP_GCC_VERSION) } __attribute__((deprecated)); @@ -188,7 +188,7 @@ private: HashVerifier *m_hashVerifier; bool m_throwException; -#if (CRYPTOPP_GCC_VERSION >= 40500) || (CRYPTOPP_LLVM_CLANG_VERSION >= 20800) +#if (CRYPTOPP_GCC_VERSION >= 40500) || (CRYPTOPP_CLANG_VERSION >= 20800) } __attribute__((deprecated ("DefaultDecryptorWithMAC will be changing in the near future because the algorithms are no longer secure"))); #elif (CRYPTOPP_GCC_VERSION) } __attribute__((deprecated)); diff --git a/eccrypto.h b/eccrypto.h index a809f661..6642dec5 100644 --- a/eccrypto.h +++ b/eccrypto.h @@ -132,7 +132,7 @@ public: const Integer& GetBasePointOrder() const {return this->GetSubgroupOrder();} void LoadRecommendedParameters(const OID &oid) {Initialize(oid);} #endif - + #ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 virtual ~DL_GroupParameters_EC() {} #endif @@ -162,7 +162,7 @@ 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 @@ -187,7 +187,7 @@ 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 @@ -198,7 +198,7 @@ template , COFACTOR_OPTION> Domain; - + #ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 virtual ~ECDH() {} #endif @@ -209,7 +209,7 @@ template , COFACTOR_OPTION> Domain; - + #ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 virtual ~ECMQV() {} #endif @@ -259,7 +259,7 @@ struct DL_Keys_EC { typedef DL_PublicKey_EC PublicKey; typedef DL_PrivateKey_EC PrivateKey; - + #ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 virtual ~DL_Keys_EC() {} #endif @@ -274,7 +274,7 @@ struct DL_Keys_ECDSA { typedef DL_PublicKey_EC PublicKey; typedef DL_PrivateKey_WithSignaturePairwiseConsistencyTest, ECDSA > PrivateKey; - + #ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 virtual ~DL_Keys_ECDSA() {} #endif @@ -286,7 +286,7 @@ class DL_Algorithm_ECDSA : public DL_Algorithm_GDSA { public: static const char * CRYPTOPP_API StaticAlgorithmName() {return "ECDSA";} - + #ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 virtual ~DL_Algorithm_ECDSA() {} #endif @@ -298,7 +298,7 @@ class DL_Algorithm_ECNR : public DL_Algorithm_NR { public: static const char * CRYPTOPP_API StaticAlgorithmName() {return "ECNR";} - + #ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 virtual ~DL_Algorithm_ECNR() {} #endif @@ -336,12 +336,12 @@ struct ECIES ECIES > { static std::string CRYPTOPP_API StaticAlgorithmName() {return "ECIES";} // TODO: fix this after name is standardized - + #ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 virtual ~ECIES() {} #endif - -#if (CRYPTOPP_GCC_VERSION >= 40500) || (CRYPTOPP_LLVM_CLANG_VERSION >= 20800) + +#if (CRYPTOPP_GCC_VERSION >= 40500) || (CRYPTOPP_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)); diff --git a/gcm.cpp b/gcm.cpp index fd6731f0..fd82bddb 100644 --- a/gcm.cpp +++ b/gcm.cpp @@ -13,7 +13,7 @@ #ifndef CRYPTOPP_GENERATE_X64_MASM // Clang 3.3 integrated assembler crash on Linux -#if (defined(CRYPTOPP_LLVM_CLANG_VERSION) && (CRYPTOPP_LLVM_CLANG_VERSION < 30400)) || defined(CRYPTOPP_CLANG_INTEGRATED_ASSEMBLER) +#if defined(CRYPTOPP_CLANG_VERSION) && (CRYPTOPP_CLANG_VERSION < 30400) # undef CRYPTOPP_X86_ASM_AVAILABLE # undef CRYPTOPP_X32_ASM_AVAILABLE # undef CRYPTOPP_X64_ASM_AVAILABLE @@ -703,9 +703,9 @@ size_t GCM_Base::AuthenticateBlocks(const byte *data, size_t len) AS2( pxor xmm5, xmm2 ) AS2( psrldq xmm0, 15 ) -#if (CRYPTOPP_LLVM_CLANG_VERSION >= 30600) || (CRYPTOPP_APPLE_CLANG_VERSION >= 70000) +#if (CRYPTOPP_CLANG_VERSION >= 30600) || (CRYPTOPP_APPLE_CLANG_VERSION >= 70000) AS2( movd edi, xmm0 ) -#elif (defined(CRYPTOPP_LLVM_CLANG_VERSION) || defined(CRYPTOPP_APPLE_CLANG_VERSION)) && defined(CRYPTOPP_X64_ASM_AVAILABLE) +#elif (defined(CRYPTOPP_CLANG_VERSION) || defined(CRYPTOPP_APPLE_CLANG_VERSION)) && defined(CRYPTOPP_X64_ASM_AVAILABLE) AS2( mov WORD_REG(di), xmm0 ) #else // GNU Assembler AS2( movd WORD_REG(di), xmm0 ) @@ -718,9 +718,9 @@ size_t GCM_Base::AuthenticateBlocks(const byte *data, size_t len) AS2( pxor xmm4, xmm5 ) AS2( psrldq xmm1, 15 ) -#if (CRYPTOPP_LLVM_CLANG_VERSION >= 30600) || (CRYPTOPP_APPLE_CLANG_VERSION >= 70000) +#if (CRYPTOPP_CLANG_VERSION >= 30600) || (CRYPTOPP_APPLE_CLANG_VERSION >= 70000) AS2( movd edi, xmm1 ) -#elif (defined(CRYPTOPP_LLVM_CLANG_VERSION) || defined(CRYPTOPP_APPLE_CLANG_VERSION)) && defined(CRYPTOPP_X64_ASM_AVAILABLE) +#elif (defined(CRYPTOPP_CLANG_VERSION) || defined(CRYPTOPP_APPLE_CLANG_VERSION)) && defined(CRYPTOPP_X64_ASM_AVAILABLE) AS2( mov WORD_REG(di), xmm1 ) #else AS2( movd WORD_REG(di), xmm1 ) @@ -729,9 +729,9 @@ size_t GCM_Base::AuthenticateBlocks(const byte *data, size_t len) AS2( shl eax, 8 ) AS2( psrldq xmm0, 15 ) -#if (CRYPTOPP_LLVM_CLANG_VERSION >= 30600) || (CRYPTOPP_APPLE_CLANG_VERSION >= 70000) +#if (CRYPTOPP_CLANG_VERSION >= 30600) || (CRYPTOPP_APPLE_CLANG_VERSION >= 70000) AS2( movd edi, xmm0 ) -#elif (defined(CRYPTOPP_LLVM_CLANG_VERSION) || defined(CRYPTOPP_APPLE_CLANG_VERSION)) && defined(CRYPTOPP_X64_ASM_AVAILABLE) +#elif (defined(CRYPTOPP_CLANG_VERSION) || defined(CRYPTOPP_APPLE_CLANG_VERSION)) && defined(CRYPTOPP_X64_ASM_AVAILABLE) AS2( mov WORD_REG(di), xmm0 ) #else AS2( movd WORD_REG(di), xmm0 ) diff --git a/misc.h b/misc.h index e3980441..655100f6 100644 --- a/misc.h +++ b/misc.h @@ -63,18 +63,12 @@ #if defined(__GNUC__) && defined(__BMI__) # include # if defined(__clang__) -#ifndef _tzcnt_u32 # define _tzcnt_u32(x) __tzcnt_u32(x) -#endif -#ifndef _tzcnt_u64 # define _tzcnt_u64(x) __tzcnt_u64(x) -#endif -#ifndef _blsr_u32 # define _blsr_u32(x) __blsr_u32(x) -#endif #ifndef _blsr_u64 # define _blsr_u64(x) __blsr_u64(x) -#endif +# endif # endif #endif @@ -471,7 +465,7 @@ template inline const T& STDMAX(const T& a, const T& b) #if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wsign-compare" -# if (CRYPTOPP_LLVM_CLANG_VERSION >= 20800) || (CRYPTOPP_APPLE_CLANG_VERSION >= 30000) +# if (CRYPTOPP_CLANG_VERSION >= 20800) || (CRYPTOPP_APPLE_CLANG_VERSION >= 30000) # pragma GCC diagnostic ignored "-Wtautological-compare" # elif (CRYPTOPP_GCC_VERSION >= 40300) # pragma GCC diagnostic ignored "-Wtype-limits" diff --git a/panama.h b/panama.h index e7f20c95..b7db323a 100644 --- a/panama.h +++ b/panama.h @@ -11,7 +11,7 @@ #include "secblock.h" // Clang 3.3 integrated assembler crash on Linux. Clang 3.4 due to compiler error with .intel_syntax -#if CRYPTOPP_BOOL_X32 || (defined(CRYPTOPP_LLVM_CLANG_VERSION) && (CRYPTOPP_LLVM_CLANG_VERSION < 30500)) +#if CRYPTOPP_BOOL_X32 || (defined(CRYPTOPP_CLANG_VERSION) && (CRYPTOPP_CLANG_VERSION < 30500)) # define CRYPTOPP_DISABLE_PANAMA_ASM #endif @@ -128,7 +128,7 @@ struct PanamaCipherInfo : public FixedKeyLength<32, SimpleKeyingInterface::UNIQU //! _ template -class PanamaCipherPolicy : public AdditiveCipherConcretePolicy, +class PanamaCipherPolicy : public AdditiveCipherConcretePolicy, public PanamaCipherInfo, protected Panama { diff --git a/rdrand.cpp b/rdrand.cpp index 4edb1bd8..6149315e 100644 --- a/rdrand.cpp +++ b/rdrand.cpp @@ -67,8 +67,8 @@ #endif #if defined(CRYPTOPP_CPUID_AVAILABLE) -# define MSC_INTRIN_COMPILER ((CRYPTOPP_MSC_VERSION >= 1700) || (CRYPTOPP_LLVM_CLANG_VERSION >= 30200) || (_INTEL_COMPILER >= 1210)) -# define GCC_INTRIN_COMPILER ((CRYPTOPP_GCC_VERSION >= 40600) || (CRYPTOPP_LLVM_CLANG_VERSION >= 30200) || (_INTEL_COMPILER >= 1210)) +# define MSC_INTRIN_COMPILER ((CRYPTOPP_MSC_VERSION >= 1700) || (CRYPTOPP_CLANG_VERSION >= 30200) || (_INTEL_COMPILER >= 1210)) +# define GCC_INTRIN_COMPILER ((CRYPTOPP_GCC_VERSION >= 40600) || (CRYPTOPP_CLANG_VERSION >= 30200) || (_INTEL_COMPILER >= 1210)) #else # define MSC_INTRIN_COMPILER 0 # define GCC_INTRIN_COMPILER 0 diff --git a/rijndael.h b/rijndael.h index 50fdf1eb..ed856d94 100644 --- a/rijndael.h +++ b/rijndael.h @@ -12,7 +12,7 @@ #include "secblock.h" // Clang 3.3 integrated assembler crash on Linux -#if CRYPTOPP_BOOL_X32 || (defined(CRYPTOPP_LLVM_CLANG_VERSION) && (CRYPTOPP_LLVM_CLANG_VERSION < 30400)) +#if CRYPTOPP_BOOL_X32 || (defined(CRYPTOPP_CLANG_VERSION) && (CRYPTOPP_CLANG_VERSION < 30400)) # define CRYPTOPP_DISABLE_RIJNDAEL_ASM #endif diff --git a/sha.h b/sha.h index c70d9d1f..544e8056 100644 --- a/sha.h +++ b/sha.h @@ -11,7 +11,7 @@ #include "iterhash.h" // Clang 3.3 integrated assembler crash on Linux -#if defined(CRYPTOPP_LLVM_CLANG_VERSION) && (CRYPTOPP_LLVM_CLANG_VERSION < 30400) +#if defined(CRYPTOPP_CLANG_VERSION) && (CRYPTOPP_CLANG_VERSION < 30400) # define CRYPTOPP_DISABLE_SHA_ASM #endif diff --git a/wait.h b/wait.h index e274b19f..13e6ba33 100644 --- a/wait.h +++ b/wait.h @@ -32,13 +32,6 @@ # endif #endif -// http://connect.microsoft.com/VisualStudio/feedback/details/1581706 -// and http://github.com/weidai11/cryptopp/issues/214 -#if CRYPTOPP_MSC_VERSION == 1900 -# pragma warning(push) -# pragma warning(disable: 4589) -#endif - NAMESPACE_BEGIN(CryptoPP) class Tracer @@ -230,10 +223,6 @@ private: NAMESPACE_END -#if CRYPTOPP_MSC_VERSION == 1900 -# pragma warning(pop) -#endif - #endif #endif