mirror of
https://github.com/shadps4-emu/ext-cryptopp.git
synced 2024-11-23 09:59:42 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
762c315566
@ -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")
|
IS_NETBSD := $(shell $(CXX) -dumpmachine 2>&1 | $(EGREP) -i -c "NetBSD")
|
||||||
|
|
||||||
SUN_COMPILER := $(shell $(CXX) -V 2>&1 | $(EGREP) -i -c "CC: Sun")
|
SUN_COMPILER := $(shell $(CXX) -V 2>&1 | $(EGREP) -i -c "CC: Sun")
|
||||||
GCC_COMPILER := $(shell $(CXX) --version 2>&1 | $(EGREP) -i -c "(gcc|g\+\+)")
|
GCC_COMPILER := $(shell $(CXX) --version 2>&1 | $(EGREP) -i -v "clang" | $(EGREP) -i -c "(gcc|g\+\+)")
|
||||||
CLANG_COMPILER := $(shell $(CXX) --version 2>&1 | $(EGREP) -i -c "clang")
|
CLANG_COMPILER := $(shell $(CXX) --version 2>&1 | $(EGREP) -i -c "clang")
|
||||||
INTEL_COMPILER := $(shell $(CXX) --version 2>&1 | $(EGREP) -c "\(ICC\)")
|
INTEL_COMPILER := $(shell $(CXX) --version 2>&1 | $(EGREP) -i -c "\(icc\)")
|
||||||
MACPORTS_COMPILER := $(shell $(CXX) --version 2>&1 | $(EGREP) -i -c "macports")
|
MACPORTS_COMPILER := $(shell $(CXX) --version 2>&1 | $(EGREP) -i -c "macports")
|
||||||
|
|
||||||
# Sun Studio 12.0 (0x0510) and 12.3 (0x0512)
|
# Sun Studio 12.0 (0x0510) and 12.3 (0x0512)
|
||||||
@ -179,6 +179,9 @@ ifeq ($(GCC_COMPILER)$(MACPORTS_COMPILER),11)
|
|||||||
ifneq ($(findstring -Wa,-q,$(CXXFLAGS)),-Wa,-q)
|
ifneq ($(findstring -Wa,-q,$(CXXFLAGS)),-Wa,-q)
|
||||||
CXXFLAGS += -Wa,-q
|
CXXFLAGS += -Wa,-q
|
||||||
endif
|
endif
|
||||||
|
ifneq ($(findstring -Wa,-q,$(CXXFLAGS)),-DCRYPTOPP_CLANG_INTEGRATED_ASSEMBLER)
|
||||||
|
CXXFLAGS += -DCRYPTOPP_CLANG_INTEGRATED_ASSEMBLER=1
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Allow use of "/" operator for GNU Assembler.
|
# Allow use of "/" operator for GNU Assembler.
|
||||||
|
@ -35,7 +35,7 @@ NAMESPACE_BEGIN(CryptoPP)
|
|||||||
|
|
||||||
// Apple Clang 6.0/Clang 3.5 does not have SSSE3 intrinsics
|
// Apple Clang 6.0/Clang 3.5 does not have SSSE3 intrinsics
|
||||||
// http://llvm.org/bugs/show_bug.cgi?id=20213
|
// http://llvm.org/bugs/show_bug.cgi?id=20213
|
||||||
#if (defined(CRYPTOPP_APPLE_CLANG_VERSION) && (CRYPTOPP_APPLE_CLANG_VERSION <= 60000)) || (defined(CRYPTOPP_CLANG_VERSION) && (CRYPTOPP_CLANG_VERSION <= 30500))
|
#if (defined(CRYPTOPP_APPLE_CLANG_VERSION) && (CRYPTOPP_APPLE_CLANG_VERSION <= 60000)) || (defined(CRYPTOPP_LLVM_CLANG_VERSION) && (CRYPTOPP_LLVM_CLANG_VERSION <= 30500))
|
||||||
# undef CRYPTOPP_BOOL_SSE4_INTRINSICS_AVAILABLE
|
# undef CRYPTOPP_BOOL_SSE4_INTRINSICS_AVAILABLE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
14
config.h
14
config.h
@ -63,7 +63,9 @@
|
|||||||
// Define this to choose the FIPS 202 version of SHA3, and not the original version of SHA3. NIST selected Keccak as SHA3
|
// 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.
|
// 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.
|
// 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
|
// # define CRYPTOPP_USE_FIPS_202_SHA3
|
||||||
|
// #endif
|
||||||
|
|
||||||
// ***************** Less Important Settings ***************
|
// ***************** Less Important Settings ***************
|
||||||
|
|
||||||
@ -236,9 +238,11 @@ const lword LWORD_MAX = W64LIT(0xffffffffffffffff);
|
|||||||
|
|
||||||
// Apple and LLVM's Clang. Apple Clang version 7.0 roughly equals LLVM Clang version 3.7
|
// Apple and LLVM's Clang. Apple Clang version 7.0 roughly equals LLVM Clang version 3.7
|
||||||
#if defined(__clang__ ) && !defined(__apple_build_version__)
|
#if defined(__clang__ ) && !defined(__apple_build_version__)
|
||||||
#define CRYPTOPP_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
|
#define CRYPTOPP_LLVM_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
|
||||||
|
#define CRYPTOPP_CLANG_INTEGRATED_ASSEMBLER 1
|
||||||
#elif defined(__clang__ ) && defined(__apple_build_version__)
|
#elif defined(__clang__ ) && defined(__apple_build_version__)
|
||||||
#define CRYPTOPP_APPLE_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
|
#define CRYPTOPP_APPLE_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
|
||||||
|
#define CRYPTOPP_CLANG_INTEGRATED_ASSEMBLER 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
@ -246,13 +250,13 @@ const lword LWORD_MAX = W64LIT(0xffffffffffffffff);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Need GCC 4.6/Clang 1.7/Apple Clang 2.0 or above due to "GCC diagnostic {push|pop}"
|
// 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_CLANG_VERSION >= 10700) || (CRYPTOPP_APPLE_CLANG_VERSION >= 20000)
|
#if (CRYPTOPP_GCC_VERSION >= 40600) || (CRYPTOPP_LLVM_CLANG_VERSION >= 10700) || (CRYPTOPP_APPLE_CLANG_VERSION >= 20000)
|
||||||
#define CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE 1
|
#define CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Clang due to "Inline assembly operands don't work with .intel_syntax", http://llvm.org/bugs/show_bug.cgi?id=24232
|
// 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.
|
// TODO: supply the upper version when LLVM fixes it. We set it to 20.0 for compilation purposes.
|
||||||
#if (defined(CRYPTOPP_CLANG_VERSION) && CRYPTOPP_CLANG_VERSION <= 200000) || (defined(CRYPTOPP_APPLE_CLANG_VERSION) && CRYPTOPP_APPLE_CLANG_VERSION <= 200000)
|
#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)
|
||||||
#define CRYPTOPP_DISABLE_INTEL_ASM 1
|
#define CRYPTOPP_DISABLE_INTEL_ASM 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -726,7 +730,7 @@ NAMESPACE_END
|
|||||||
|
|
||||||
// ************** Deprecated ***************
|
// ************** Deprecated ***************
|
||||||
|
|
||||||
#if (CRYPTOPP_GCC_VERSION >= 40500) || (CRYPTOPP_CLANG_VERSION >= 20800)
|
#if (CRYPTOPP_GCC_VERSION >= 40500) || (CRYPTOPP_LLVM_CLANG_VERSION >= 20800)
|
||||||
# define CRYPTOPP_DEPRECATED(msg) __attribute__((deprecated (msg)));
|
# define CRYPTOPP_DEPRECATED(msg) __attribute__((deprecated (msg)));
|
||||||
#elif (CRYPTOPP_GCC_VERSION)
|
#elif (CRYPTOPP_GCC_VERSION)
|
||||||
# define CRYPTOPP_DEPRECATED(msg) __attribute__((deprecated));
|
# define CRYPTOPP_DEPRECATED(msg) __attribute__((deprecated));
|
||||||
@ -779,7 +783,7 @@ NAMESPACE_END
|
|||||||
# define CRYPTOPP_CXX11_SYNCHRONIZATION 1
|
# define CRYPTOPP_CXX11_SYNCHRONIZATION 1
|
||||||
#elif defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1200)
|
#elif defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1200)
|
||||||
# define CRYPTOPP_CXX11_SYNCHRONIZATION 1
|
# define CRYPTOPP_CXX11_SYNCHRONIZATION 1
|
||||||
#elif (CRYPTOPP_CLANG_VERSION >= 30300) || (CRYPTOPP_APPLE_CLANG_VERSION >= 50000)
|
#elif (CRYPTOPP_LLVM_CLANG_VERSION >= 30300) || (CRYPTOPP_APPLE_CLANG_VERSION >= 50000)
|
||||||
# define CRYPTOPP_CXX11_SYNCHRONIZATION 1
|
# define CRYPTOPP_CXX11_SYNCHRONIZATION 1
|
||||||
#elif (CRYPTOPP_GCC_VERSION >= 40400)
|
#elif (CRYPTOPP_GCC_VERSION >= 40400)
|
||||||
# define CRYPTOPP_CXX11_SYNCHRONIZATION 1
|
# define CRYPTOPP_CXX11_SYNCHRONIZATION 1
|
||||||
|
@ -63,7 +63,9 @@
|
|||||||
// Define this to choose the FIPS 202 version of SHA3, and not the original version of SHA3. NIST selected Keccak as SHA3
|
// 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.
|
// 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.
|
// 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
|
# define CRYPTOPP_USE_FIPS_202_SHA3
|
||||||
|
#endif
|
||||||
|
|
||||||
// ***************** Less Important Settings ***************
|
// ***************** Less Important Settings ***************
|
||||||
|
|
||||||
@ -236,7 +238,7 @@ const lword LWORD_MAX = W64LIT(0xffffffffffffffff);
|
|||||||
|
|
||||||
// Apple and LLVM's Clang. Apple Clang version 7.0 roughly equals LLVM Clang version 3.7
|
// Apple and LLVM's Clang. Apple Clang version 7.0 roughly equals LLVM Clang version 3.7
|
||||||
#if defined(__clang__ ) && !defined(__apple_build_version__)
|
#if defined(__clang__ ) && !defined(__apple_build_version__)
|
||||||
#define CRYPTOPP_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
|
#define CRYPTOPP_LLVM_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
|
||||||
#elif defined(__clang__ ) && defined(__apple_build_version__)
|
#elif defined(__clang__ ) && defined(__apple_build_version__)
|
||||||
#define CRYPTOPP_APPLE_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
|
#define CRYPTOPP_APPLE_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
|
||||||
#endif
|
#endif
|
||||||
@ -246,13 +248,13 @@ const lword LWORD_MAX = W64LIT(0xffffffffffffffff);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Need GCC 4.6/Clang 1.7/Apple Clang 2.0 or above due to "GCC diagnostic {push|pop}"
|
// 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_CLANG_VERSION >= 10700) || (CRYPTOPP_APPLE_CLANG_VERSION >= 20000)
|
#if (CRYPTOPP_GCC_VERSION >= 40600) || (CRYPTOPP_LLVM_CLANG_VERSION >= 10700) || (CRYPTOPP_APPLE_CLANG_VERSION >= 20000)
|
||||||
#define CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE 1
|
#define CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Clang due to "Inline assembly operands don't work with .intel_syntax", http://llvm.org/bugs/show_bug.cgi?id=24232
|
// 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.
|
// TODO: supply the upper version when LLVM fixes it. We set it to 20.0 for compilation purposes.
|
||||||
#if (defined(CRYPTOPP_CLANG_VERSION) && CRYPTOPP_CLANG_VERSION <= 200000) || (defined(CRYPTOPP_APPLE_CLANG_VERSION) && CRYPTOPP_APPLE_CLANG_VERSION <= 200000)
|
#if (defined(CRYPTOPP_LLVM_CLANG_VERSION) && CRYPTOPP_LLVM_CLANG_VERSION <= 200000) || (defined(CRYPTOPP_APPLE_CLANG_VERSION) && CRYPTOPP_APPLE_CLANG_VERSION <= 200000)
|
||||||
#define CRYPTOPP_DISABLE_INTEL_ASM 1
|
#define CRYPTOPP_DISABLE_INTEL_ASM 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -724,7 +726,7 @@ NAMESPACE_END
|
|||||||
|
|
||||||
// ************** Deprecated ***************
|
// ************** Deprecated ***************
|
||||||
|
|
||||||
#if (CRYPTOPP_GCC_VERSION >= 40500) || (CRYPTOPP_CLANG_VERSION >= 20800)
|
#if (CRYPTOPP_GCC_VERSION >= 40500) || (CRYPTOPP_LLVM_CLANG_VERSION >= 20800)
|
||||||
# define CRYPTOPP_DEPRECATED(msg) __attribute__((deprecated (msg)));
|
# define CRYPTOPP_DEPRECATED(msg) __attribute__((deprecated (msg)));
|
||||||
#elif (CRYPTOPP_GCC_VERSION)
|
#elif (CRYPTOPP_GCC_VERSION)
|
||||||
# define CRYPTOPP_DEPRECATED(msg) __attribute__((deprecated));
|
# define CRYPTOPP_DEPRECATED(msg) __attribute__((deprecated));
|
||||||
@ -777,7 +779,7 @@ NAMESPACE_END
|
|||||||
# define CRYPTOPP_CXX11_SYNCHRONIZATION 1
|
# define CRYPTOPP_CXX11_SYNCHRONIZATION 1
|
||||||
#elif defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1200)
|
#elif defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1200)
|
||||||
# define CRYPTOPP_CXX11_SYNCHRONIZATION 1
|
# define CRYPTOPP_CXX11_SYNCHRONIZATION 1
|
||||||
#elif (CRYPTOPP_CLANG_VERSION >= 30300) || (CRYPTOPP_APPLE_CLANG_VERSION >= 50000)
|
#elif (CRYPTOPP_LLVM_CLANG_VERSION >= 30300) || (CRYPTOPP_APPLE_CLANG_VERSION >= 50000)
|
||||||
# define CRYPTOPP_CXX11_SYNCHRONIZATION 1
|
# define CRYPTOPP_CXX11_SYNCHRONIZATION 1
|
||||||
#elif (CRYPTOPP_GCC_VERSION >= 40400)
|
#elif (CRYPTOPP_GCC_VERSION >= 40400)
|
||||||
# define CRYPTOPP_CXX11_SYNCHRONIZATION 1
|
# define CRYPTOPP_CXX11_SYNCHRONIZATION 1
|
||||||
|
2
cpu.cpp
2
cpu.cpp
@ -27,7 +27,7 @@ NAMESPACE_BEGIN(CryptoPP)
|
|||||||
#ifndef CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY
|
#ifndef CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY
|
||||||
|
|
||||||
// MacPorts/GCC does not provide constructor(priority). Apple/GCC and Fink/GCC do provide it.
|
// 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_CLANG_VERSION >= 20900) || (_INTEL_COMPILER >= 300)) && !(MACPORTS_GCC_COMPILER > 0))
|
#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_CONSTRUCTOR0 (__GNUC__ && (CRYPTOPP_INIT_PRIORITY > 0) && !(MACPORTS_GCC_COMPILER > 0))
|
#define HAVE_GCC_CONSTRUCTOR0 (__GNUC__ && (CRYPTOPP_INIT_PRIORITY > 0) && !(MACPORTS_GCC_COMPILER > 0))
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
75
cpu.h
75
cpu.h
@ -2,9 +2,7 @@
|
|||||||
|
|
||||||
//! \file cpu.h
|
//! \file cpu.h
|
||||||
//! \brief Functions for CPU features and intrinsics
|
//! \brief Functions for CPU features and intrinsics
|
||||||
//! \details At the moment, the functions are used heavily in X86/X32/X64 code paths
|
//! \details The functions are used in X86/X32/X64 and NEON 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
|
#ifndef CRYPTOPP_CPU_H
|
||||||
#define CRYPTOPP_CPU_H
|
#define CRYPTOPP_CPU_H
|
||||||
@ -52,7 +50,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// PUSHFB needs Clang 3.3 and Apple Clang 5.0.
|
// PUSHFB needs Clang 3.3 and Apple Clang 5.0.
|
||||||
#if !defined(__GNUC__) || defined(__SSSE3__)|| defined(__INTEL_COMPILER) || (CRYPTOPP_CLANG_VERSION >= 30300) || (CRYPTOPP_APPLE_CLANG_VERSION >= 50000)
|
#if !defined(__GNUC__) || defined(__SSSE3__)|| defined(__INTEL_COMPILER) || (CRYPTOPP_LLVM_CLANG_VERSION >= 30300) || (CRYPTOPP_APPLE_CLANG_VERSION >= 50000)
|
||||||
#include <tmmintrin.h>
|
#include <tmmintrin.h>
|
||||||
#else
|
#else
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
@ -66,7 +64,7 @@ NAMESPACE_END
|
|||||||
#endif // tmmintrin.h
|
#endif // tmmintrin.h
|
||||||
|
|
||||||
// PEXTRD needs Clang 3.3 and Apple Clang 5.0.
|
// PEXTRD needs Clang 3.3 and Apple Clang 5.0.
|
||||||
#if !defined(__GNUC__) || defined(__SSE4_1__)|| defined(__INTEL_COMPILER) || (CRYPTOPP_CLANG_VERSION >= 30300) || (CRYPTOPP_APPLE_CLANG_VERSION >= 50000)
|
#if !defined(__GNUC__) || defined(__SSE4_1__)|| defined(__INTEL_COMPILER) || (CRYPTOPP_LLVM_CLANG_VERSION >= 30300) || (CRYPTOPP_APPLE_CLANG_VERSION >= 50000)
|
||||||
#include <smmintrin.h>
|
#include <smmintrin.h>
|
||||||
#else
|
#else
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
@ -87,7 +85,7 @@ NAMESPACE_END
|
|||||||
#endif // smmintrin.h
|
#endif // smmintrin.h
|
||||||
|
|
||||||
// AES needs Clang 2.8 and Apple Clang 4.6. PCLMUL needs Clang 3.4 and Apple Clang 6.0
|
// 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_CLANG_VERSION >= 30400) || (CRYPTOPP_APPLE_CLANG_VERSION >= 60000)
|
#if !defined(__GNUC__) || (defined(__AES__) && defined(__PCLMUL__)) || defined(__INTEL_COMPILER) || (CRYPTOPP_LLVM_CLANG_VERSION >= 30400) || (CRYPTOPP_APPLE_CLANG_VERSION >= 60000)
|
||||||
#include <wmmintrin.h>
|
#include <wmmintrin.h>
|
||||||
#else
|
#else
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
@ -141,11 +139,13 @@ NAMESPACE_END
|
|||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64
|
#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64 || CRYPTOPP_DOXYGEN_PROCESSING
|
||||||
|
|
||||||
#define CRYPTOPP_CPUID_AVAILABLE
|
#define CRYPTOPP_CPUID_AVAILABLE
|
||||||
|
|
||||||
// these should not be used directly
|
// Hide from Doxygen
|
||||||
|
#ifndef CRYPTOPP_DOXYGEN_PROCESSING
|
||||||
|
// These should not be used directly
|
||||||
extern CRYPTOPP_DLL bool g_x86DetectionDone;
|
extern CRYPTOPP_DLL bool g_x86DetectionDone;
|
||||||
extern CRYPTOPP_DLL bool g_hasMMX;
|
extern CRYPTOPP_DLL bool g_hasMMX;
|
||||||
extern CRYPTOPP_DLL bool g_hasISSE;
|
extern CRYPTOPP_DLL bool g_hasISSE;
|
||||||
@ -166,7 +166,12 @@ extern CRYPTOPP_DLL word32 g_cacheLineSize;
|
|||||||
|
|
||||||
CRYPTOPP_DLL void CRYPTOPP_API DetectX86Features();
|
CRYPTOPP_DLL void CRYPTOPP_API DetectX86Features();
|
||||||
CRYPTOPP_DLL bool CRYPTOPP_API CpuId(word32 input, word32 output[4]);
|
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()
|
inline bool HasMMX()
|
||||||
{
|
{
|
||||||
#if CRYPTOPP_BOOL_X64
|
#if CRYPTOPP_BOOL_X64
|
||||||
@ -178,6 +183,10 @@ inline bool HasMMX()
|
|||||||
#endif
|
#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()
|
inline bool HasISSE()
|
||||||
{
|
{
|
||||||
#if CRYPTOPP_BOOL_X64
|
#if CRYPTOPP_BOOL_X64
|
||||||
@ -189,6 +198,10 @@ inline bool HasISSE()
|
|||||||
#endif
|
#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()
|
inline bool HasSSE2()
|
||||||
{
|
{
|
||||||
#if CRYPTOPP_BOOL_X64
|
#if CRYPTOPP_BOOL_X64
|
||||||
@ -200,6 +213,10 @@ inline bool HasSSE2()
|
|||||||
#endif
|
#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()
|
inline bool HasSSSE3()
|
||||||
{
|
{
|
||||||
if (!g_x86DetectionDone)
|
if (!g_x86DetectionDone)
|
||||||
@ -207,6 +224,9 @@ inline bool HasSSSE3()
|
|||||||
return g_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()
|
inline bool HasSSE4()
|
||||||
{
|
{
|
||||||
if (!g_x86DetectionDone)
|
if (!g_x86DetectionDone)
|
||||||
@ -214,6 +234,9 @@ inline bool HasSSE4()
|
|||||||
return g_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()
|
inline bool HasAESNI()
|
||||||
{
|
{
|
||||||
if (!g_x86DetectionDone)
|
if (!g_x86DetectionDone)
|
||||||
@ -221,6 +244,9 @@ inline bool HasAESNI()
|
|||||||
return g_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()
|
inline bool HasCLMUL()
|
||||||
{
|
{
|
||||||
if (!g_x86DetectionDone)
|
if (!g_x86DetectionDone)
|
||||||
@ -228,6 +254,9 @@ inline bool HasCLMUL()
|
|||||||
return g_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()
|
inline bool IsP4()
|
||||||
{
|
{
|
||||||
if (!g_x86DetectionDone)
|
if (!g_x86DetectionDone)
|
||||||
@ -235,6 +264,9 @@ inline bool IsP4()
|
|||||||
return g_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()
|
inline bool HasRDRAND()
|
||||||
{
|
{
|
||||||
if (!g_x86DetectionDone)
|
if (!g_x86DetectionDone)
|
||||||
@ -242,6 +274,9 @@ inline bool HasRDRAND()
|
|||||||
return g_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()
|
inline bool HasRDSEED()
|
||||||
{
|
{
|
||||||
if (!g_x86DetectionDone)
|
if (!g_x86DetectionDone)
|
||||||
@ -249,6 +284,9 @@ inline bool HasRDSEED()
|
|||||||
return g_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()
|
inline bool HasPadlockRNG()
|
||||||
{
|
{
|
||||||
if (!g_x86DetectionDone)
|
if (!g_x86DetectionDone)
|
||||||
@ -256,6 +294,9 @@ inline bool HasPadlockRNG()
|
|||||||
return g_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()
|
inline bool HasPadlockACE()
|
||||||
{
|
{
|
||||||
if (!g_x86DetectionDone)
|
if (!g_x86DetectionDone)
|
||||||
@ -263,6 +304,9 @@ inline bool HasPadlockACE()
|
|||||||
return g_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()
|
inline bool HasPadlockACE2()
|
||||||
{
|
{
|
||||||
if (!g_x86DetectionDone)
|
if (!g_x86DetectionDone)
|
||||||
@ -270,6 +314,9 @@ inline bool HasPadlockACE2()
|
|||||||
return g_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()
|
inline bool HasPadlockPHE()
|
||||||
{
|
{
|
||||||
if (!g_x86DetectionDone)
|
if (!g_x86DetectionDone)
|
||||||
@ -277,6 +324,9 @@ inline bool HasPadlockPHE()
|
|||||||
return g_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()
|
inline bool HasPadlockPMM()
|
||||||
{
|
{
|
||||||
if (!g_x86DetectionDone)
|
if (!g_x86DetectionDone)
|
||||||
@ -284,6 +334,13 @@ inline bool HasPadlockPMM()
|
|||||||
return g_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()
|
inline int GetCacheLineSize()
|
||||||
{
|
{
|
||||||
if (!g_x86DetectionDone)
|
if (!g_x86DetectionDone)
|
||||||
@ -415,7 +472,7 @@ inline int GetCacheLineSize()
|
|||||||
#else
|
#else
|
||||||
#define CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY
|
#define CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY
|
||||||
|
|
||||||
#if defined(CRYPTOPP_CLANG_VERSION) || defined(CRYPTOPP_APPLE_CLANG_VERSION)
|
#if defined(CRYPTOPP_LLVM_CLANG_VERSION) || defined(CRYPTOPP_APPLE_CLANG_VERSION) || defined(CRYPTOPP_CLANG_INTEGRATED_ASSEMBLER)
|
||||||
#define NEW_LINE "\n"
|
#define NEW_LINE "\n"
|
||||||
#define INTEL_PREFIX ".intel_syntax;"
|
#define INTEL_PREFIX ".intel_syntax;"
|
||||||
#define INTEL_NOPREFIX ".intel_syntax;"
|
#define INTEL_NOPREFIX ".intel_syntax;"
|
||||||
|
153
cryptest.sh
153
cryptest.sh
@ -128,6 +128,8 @@ fi
|
|||||||
|
|
||||||
SUN_COMPILER=$("$CXX" -V 2>&1 | "$EGREP" -i -c "CC: Sun")
|
SUN_COMPILER=$("$CXX" -V 2>&1 | "$EGREP" -i -c "CC: Sun")
|
||||||
GCC_COMPILER=$("$CXX" --version 2>&1 | "$EGREP" -i -c "(gcc|g\+\+)")
|
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")
|
CLANG_COMPILER=$("$CXX" --version 2>&1 | "$EGREP" -i -c "clang")
|
||||||
|
|
||||||
if [[ ($("$CXX" -dM -E - </dev/null 2>/dev/null | "$EGREP" -c '(__x64_64__|__amd64__)') -ne "0") && ($("$CXX" -dM -E -</dev/null 2>/dev/null | "$EGREP" -c '(__ILP32|__ILP32)') -ne "0") ]]; then
|
if [[ ($("$CXX" -dM -E - </dev/null 2>/dev/null | "$EGREP" -c '(__x64_64__|__amd64__)') -ne "0") && ($("$CXX" -dM -E -</dev/null 2>/dev/null | "$EGREP" -c '(__ILP32|__ILP32)') -ne "0") ]]; then
|
||||||
@ -135,6 +137,7 @@ if [[ ($("$CXX" -dM -E - </dev/null 2>/dev/null | "$EGREP" -c '(__x64_64__|__amd
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Now that the compiler is fixed, see if its GCC 5.1 or above with -Wabi, -Wabi-tag and -Wodr
|
# 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_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')
|
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
|
# SunCC 12.2 and below needs one set of CXXFLAGS; SunCC 12.3 and above needs another set of CXXFLAGS
|
||||||
@ -224,6 +227,14 @@ if [[ (-z "$HAVE_CXX03") ]]; then
|
|||||||
fi
|
fi
|
||||||
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
|
HAVE_O3=0
|
||||||
OPT_O3=
|
OPT_O3=
|
||||||
"$CXX" -DCRYPTOPP_ADHOC_MAIN -O3 adhoc.cpp -o "$TMP/adhoc.exe" > /dev/null 2>&1
|
"$CXX" -DCRYPTOPP_ADHOC_MAIN -O3 adhoc.cpp -o "$TMP/adhoc.exe" > /dev/null 2>&1
|
||||||
@ -496,6 +507,7 @@ fi
|
|||||||
# C++03, C++11, C++14 and C++17
|
# C++03, C++11, C++14 and C++17
|
||||||
echo | tee -a "$TEST_RESULTS"
|
echo | tee -a "$TEST_RESULTS"
|
||||||
echo "HAVE_CXX03: $HAVE_CXX03" | 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_CXX11: $HAVE_CXX11" | tee -a "$TEST_RESULTS"
|
||||||
echo "HAVE_GNU11: $HAVE_GNU11" | 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
|
if [[ ("$HAVE_CXX14" -ne "0" || "$HAVE_CXX17" -ne "0" || "$HAVE_GNU14" -ne "0" || "$HAVE_GNU17" -ne "0") ]]; then
|
||||||
@ -696,6 +708,9 @@ if [[ ("$GCC_COMPILER" -ne "0") ]]; then
|
|||||||
"-Wno-unknown-pragmas" "-Wstrict-aliasing=3" "-Wstrict-overflow" "-Waggressive-loop-optimizations"
|
"-Wno-unknown-pragmas" "-Wstrict-aliasing=3" "-Wstrict-overflow" "-Waggressive-loop-optimizations"
|
||||||
"-Wcast-align" "-Wwrite-strings" "-Wformat=2" "-Wformat-security" "-Wtrampolines")
|
"-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
|
if [[ ("$GCC_51_OR_ABOVE" -ne "0") ]]; then
|
||||||
ELEVATED_CXXFLAGS+=("-Wabi" "-Wodr")
|
ELEVATED_CXXFLAGS+=("-Wabi" "-Wodr")
|
||||||
fi
|
fi
|
||||||
@ -955,6 +970,65 @@ if [[ "$HAVE_CXX03" -ne "0" ]]; then
|
|||||||
fi
|
fi
|
||||||
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
|
# c++11 debug and release build
|
||||||
if [[ "$HAVE_CXX11" -ne "0" ]]; then
|
if [[ "$HAVE_CXX11" -ne "0" ]]; then
|
||||||
@ -3884,6 +3958,75 @@ if [[ ("$INTEL_COMPILER" -eq "0") ]]; then
|
|||||||
fi
|
fi
|
||||||
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.
|
# Perform a quick check with Xcode compiler, if available.
|
||||||
if [[ "$IS_DARWIN" -ne "0" ]]; then
|
if [[ "$IS_DARWIN" -ne "0" ]]; then
|
||||||
@ -4090,14 +4233,14 @@ fi
|
|||||||
# Report warnings
|
# Report warnings
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "************************************************" | tee -a "$WARN_RESULTS"
|
echo "************************************************" | tee -a "$TEST_RESULTS" "$WARN_RESULTS"
|
||||||
echo | tee -a "$WARN_RESULTS"
|
echo | tee -a "$TEST_RESULTS" "$WARN_RESULTS"
|
||||||
|
|
||||||
WCOUNT=$("$EGREP" -a '(warning:)' $WARN_RESULTS | "$GREP" -v 'deprecated-declarations' | wc -l | "$AWK" '{print $1}')
|
WCOUNT=$("$EGREP" -a '(warning:)' $WARN_RESULTS | "$GREP" -v 'deprecated-declarations' | wc -l | "$AWK" '{print $1}')
|
||||||
if (( "$WCOUNT" == "0" )); then
|
if (( "$WCOUNT" == "0" )); then
|
||||||
echo "No warnings detected" | tee -a "$WARN_RESULTS" | tee -a "$WARN_RESULTS"
|
echo "No warnings detected" | tee -a "$TEST_RESULTS" "$WARN_RESULTS" | tee -a "$TEST_RESULTS" "$WARN_RESULTS"
|
||||||
else
|
else
|
||||||
echo "$WCOUNT warnings detected. See $WARN_RESULTS for details" | tee -a "$WARN_RESULTS"
|
echo "$WCOUNT warnings detected. See $WARN_RESULTS for details" | tee -a "$TEST_RESULTS" "$WARN_RESULTS"
|
||||||
# "$EGREP" -an '(warning:)' $WARN_RESULTS | "$GREP" -v 'deprecated-declarations'
|
# "$EGREP" -an '(warning:)' $WARN_RESULTS | "$GREP" -v 'deprecated-declarations'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -4106,8 +4249,8 @@ fi
|
|||||||
|
|
||||||
echo
|
echo
|
||||||
echo "************************************************" | tee -a "$TEST_RESULTS" "$WARN_RESULTS"
|
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 started: $TEST_BEGIN" | tee -a "$TEST_RESULTS" "$WARN_RESULTS"
|
||||||
echo "Testing finished: $TEST_END" | tee -a "$TEST_RESULTS" "$WARN_RESULTS"
|
echo "Testing finished: $TEST_END" | tee -a "$TEST_RESULTS" "$WARN_RESULTS"
|
||||||
echo
|
echo
|
||||||
|
@ -48,7 +48,7 @@ private:
|
|||||||
SecByteBlock m_passphrase;
|
SecByteBlock m_passphrase;
|
||||||
CBC_Mode<DefaultBlockCipher>::Encryption m_cipher;
|
CBC_Mode<DefaultBlockCipher>::Encryption m_cipher;
|
||||||
|
|
||||||
#if (CRYPTOPP_GCC_VERSION >= 40500) || (CRYPTOPP_CLANG_VERSION >= 20800)
|
#if (CRYPTOPP_GCC_VERSION >= 40500) || (CRYPTOPP_LLVM_CLANG_VERSION >= 20800)
|
||||||
} __attribute__((deprecated ("DefaultEncryptor will be changing in the near future because the algorithms are no longer secure")));
|
} __attribute__((deprecated ("DefaultEncryptor will be changing in the near future because the algorithms are no longer secure")));
|
||||||
#elif (CRYPTOPP_GCC_VERSION)
|
#elif (CRYPTOPP_GCC_VERSION)
|
||||||
} __attribute__((deprecated));
|
} __attribute__((deprecated));
|
||||||
@ -101,7 +101,7 @@ private:
|
|||||||
member_ptr<FilterWithBufferedInput> m_decryptor;
|
member_ptr<FilterWithBufferedInput> m_decryptor;
|
||||||
bool m_throwException;
|
bool m_throwException;
|
||||||
|
|
||||||
#if (CRYPTOPP_GCC_VERSION >= 40500) || (CRYPTOPP_CLANG_VERSION >= 20800)
|
#if (CRYPTOPP_GCC_VERSION >= 40500) || (CRYPTOPP_LLVM_CLANG_VERSION >= 20800)
|
||||||
} __attribute__((deprecated ("DefaultDecryptor will be changing in the near future because the algorithms are no longer secure")));
|
} __attribute__((deprecated ("DefaultDecryptor will be changing in the near future because the algorithms are no longer secure")));
|
||||||
#elif (CRYPTOPP_GCC_VERSION)
|
#elif (CRYPTOPP_GCC_VERSION)
|
||||||
} __attribute__((deprecated));
|
} __attribute__((deprecated));
|
||||||
@ -139,7 +139,7 @@ protected:
|
|||||||
private:
|
private:
|
||||||
member_ptr<DefaultMAC> m_mac;
|
member_ptr<DefaultMAC> m_mac;
|
||||||
|
|
||||||
#if (CRYPTOPP_GCC_VERSION >= 40500) || (CRYPTOPP_CLANG_VERSION >= 20800)
|
#if (CRYPTOPP_GCC_VERSION >= 40500) || (CRYPTOPP_LLVM_CLANG_VERSION >= 20800)
|
||||||
} __attribute__((deprecated ("DefaultEncryptorWithMAC will be changing in the near future because the algorithms are no longer secure")));
|
} __attribute__((deprecated ("DefaultEncryptorWithMAC will be changing in the near future because the algorithms are no longer secure")));
|
||||||
#elif (CRYPTOPP_GCC_VERSION)
|
#elif (CRYPTOPP_GCC_VERSION)
|
||||||
} __attribute__((deprecated));
|
} __attribute__((deprecated));
|
||||||
@ -188,7 +188,7 @@ private:
|
|||||||
HashVerifier *m_hashVerifier;
|
HashVerifier *m_hashVerifier;
|
||||||
bool m_throwException;
|
bool m_throwException;
|
||||||
|
|
||||||
#if (CRYPTOPP_GCC_VERSION >= 40500) || (CRYPTOPP_CLANG_VERSION >= 20800)
|
#if (CRYPTOPP_GCC_VERSION >= 40500) || (CRYPTOPP_LLVM_CLANG_VERSION >= 20800)
|
||||||
} __attribute__((deprecated ("DefaultDecryptorWithMAC will be changing in the near future because the algorithms are no longer secure")));
|
} __attribute__((deprecated ("DefaultDecryptorWithMAC will be changing in the near future because the algorithms are no longer secure")));
|
||||||
#elif (CRYPTOPP_GCC_VERSION)
|
#elif (CRYPTOPP_GCC_VERSION)
|
||||||
} __attribute__((deprecated));
|
} __attribute__((deprecated));
|
||||||
|
@ -341,7 +341,7 @@ struct ECIES
|
|||||||
virtual ~ECIES() {}
|
virtual ~ECIES() {}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (CRYPTOPP_GCC_VERSION >= 40500) || (CRYPTOPP_CLANG_VERSION >= 20800)
|
#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")));
|
} __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)
|
#elif (CRYPTOPP_GCC_VERSION)
|
||||||
} __attribute__((deprecated));
|
} __attribute__((deprecated));
|
||||||
|
14
gcm.cpp
14
gcm.cpp
@ -13,7 +13,7 @@
|
|||||||
#ifndef CRYPTOPP_GENERATE_X64_MASM
|
#ifndef CRYPTOPP_GENERATE_X64_MASM
|
||||||
|
|
||||||
// Clang 3.3 integrated assembler crash on Linux
|
// Clang 3.3 integrated assembler crash on Linux
|
||||||
#if defined(CRYPTOPP_CLANG_VERSION) && (CRYPTOPP_CLANG_VERSION < 30400)
|
#if (defined(CRYPTOPP_LLVM_CLANG_VERSION) && (CRYPTOPP_LLVM_CLANG_VERSION < 30400)) || defined(CRYPTOPP_CLANG_INTEGRATED_ASSEMBLER)
|
||||||
# undef CRYPTOPP_X86_ASM_AVAILABLE
|
# undef CRYPTOPP_X86_ASM_AVAILABLE
|
||||||
# undef CRYPTOPP_X32_ASM_AVAILABLE
|
# undef CRYPTOPP_X32_ASM_AVAILABLE
|
||||||
# undef CRYPTOPP_X64_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( pxor xmm5, xmm2 )
|
||||||
|
|
||||||
AS2( psrldq xmm0, 15 )
|
AS2( psrldq xmm0, 15 )
|
||||||
#if (CRYPTOPP_CLANG_VERSION >= 30600) || (CRYPTOPP_APPLE_CLANG_VERSION >= 70000)
|
#if (CRYPTOPP_LLVM_CLANG_VERSION >= 30600) || (CRYPTOPP_APPLE_CLANG_VERSION >= 70000)
|
||||||
AS2( movd edi, xmm0 )
|
AS2( movd edi, xmm0 )
|
||||||
#elif (defined(CRYPTOPP_CLANG_VERSION) || defined(CRYPTOPP_APPLE_CLANG_VERSION)) && defined(CRYPTOPP_X64_ASM_AVAILABLE)
|
#elif (defined(CRYPTOPP_LLVM_CLANG_VERSION) || defined(CRYPTOPP_APPLE_CLANG_VERSION)) && defined(CRYPTOPP_X64_ASM_AVAILABLE)
|
||||||
AS2( mov WORD_REG(di), xmm0 )
|
AS2( mov WORD_REG(di), xmm0 )
|
||||||
#else // GNU Assembler
|
#else // GNU Assembler
|
||||||
AS2( movd WORD_REG(di), xmm0 )
|
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( pxor xmm4, xmm5 )
|
||||||
|
|
||||||
AS2( psrldq xmm1, 15 )
|
AS2( psrldq xmm1, 15 )
|
||||||
#if (CRYPTOPP_CLANG_VERSION >= 30600) || (CRYPTOPP_APPLE_CLANG_VERSION >= 70000)
|
#if (CRYPTOPP_LLVM_CLANG_VERSION >= 30600) || (CRYPTOPP_APPLE_CLANG_VERSION >= 70000)
|
||||||
AS2( movd edi, xmm1 )
|
AS2( movd edi, xmm1 )
|
||||||
#elif (defined(CRYPTOPP_CLANG_VERSION) || defined(CRYPTOPP_APPLE_CLANG_VERSION)) && defined(CRYPTOPP_X64_ASM_AVAILABLE)
|
#elif (defined(CRYPTOPP_LLVM_CLANG_VERSION) || defined(CRYPTOPP_APPLE_CLANG_VERSION)) && defined(CRYPTOPP_X64_ASM_AVAILABLE)
|
||||||
AS2( mov WORD_REG(di), xmm1 )
|
AS2( mov WORD_REG(di), xmm1 )
|
||||||
#else
|
#else
|
||||||
AS2( movd WORD_REG(di), xmm1 )
|
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( shl eax, 8 )
|
||||||
|
|
||||||
AS2( psrldq xmm0, 15 )
|
AS2( psrldq xmm0, 15 )
|
||||||
#if (CRYPTOPP_CLANG_VERSION >= 30600) || (CRYPTOPP_APPLE_CLANG_VERSION >= 70000)
|
#if (CRYPTOPP_LLVM_CLANG_VERSION >= 30600) || (CRYPTOPP_APPLE_CLANG_VERSION >= 70000)
|
||||||
AS2( movd edi, xmm0 )
|
AS2( movd edi, xmm0 )
|
||||||
#elif (defined(CRYPTOPP_CLANG_VERSION) || defined(CRYPTOPP_APPLE_CLANG_VERSION)) && defined(CRYPTOPP_X64_ASM_AVAILABLE)
|
#elif (defined(CRYPTOPP_LLVM_CLANG_VERSION) || defined(CRYPTOPP_APPLE_CLANG_VERSION)) && defined(CRYPTOPP_X64_ASM_AVAILABLE)
|
||||||
AS2( mov WORD_REG(di), xmm0 )
|
AS2( mov WORD_REG(di), xmm0 )
|
||||||
#else
|
#else
|
||||||
AS2( movd WORD_REG(di), xmm0 )
|
AS2( movd WORD_REG(di), xmm0 )
|
||||||
|
8
misc.h
8
misc.h
@ -63,9 +63,15 @@
|
|||||||
#if defined(__GNUC__) && defined(__BMI__)
|
#if defined(__GNUC__) && defined(__BMI__)
|
||||||
# include <immintrin.h>
|
# include <immintrin.h>
|
||||||
# if defined(__clang__)
|
# if defined(__clang__)
|
||||||
|
#ifndef _tzcnt_u32
|
||||||
# define _tzcnt_u32(x) __tzcnt_u32(x)
|
# define _tzcnt_u32(x) __tzcnt_u32(x)
|
||||||
|
#endif
|
||||||
|
#ifndef _tzcnt_u64
|
||||||
# define _tzcnt_u64(x) __tzcnt_u64(x)
|
# define _tzcnt_u64(x) __tzcnt_u64(x)
|
||||||
|
#endif
|
||||||
|
#ifndef _blsr_u32
|
||||||
# define _blsr_u32(x) __blsr_u32(x)
|
# define _blsr_u32(x) __blsr_u32(x)
|
||||||
|
#endif
|
||||||
#ifndef _blsr_u64
|
#ifndef _blsr_u64
|
||||||
# define _blsr_u64(x) __blsr_u64(x)
|
# define _blsr_u64(x) __blsr_u64(x)
|
||||||
#endif
|
#endif
|
||||||
@ -465,7 +471,7 @@ template <class T> inline const T& STDMAX(const T& a, const T& b)
|
|||||||
#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE
|
#if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE
|
||||||
# pragma GCC diagnostic push
|
# pragma GCC diagnostic push
|
||||||
# pragma GCC diagnostic ignored "-Wsign-compare"
|
# pragma GCC diagnostic ignored "-Wsign-compare"
|
||||||
# if (CRYPTOPP_CLANG_VERSION >= 20800) || (CRYPTOPP_APPLE_CLANG_VERSION >= 30000)
|
# if (CRYPTOPP_LLVM_CLANG_VERSION >= 20800) || (CRYPTOPP_APPLE_CLANG_VERSION >= 30000)
|
||||||
# pragma GCC diagnostic ignored "-Wtautological-compare"
|
# pragma GCC diagnostic ignored "-Wtautological-compare"
|
||||||
# elif (CRYPTOPP_GCC_VERSION >= 40300)
|
# elif (CRYPTOPP_GCC_VERSION >= 40300)
|
||||||
# pragma GCC diagnostic ignored "-Wtype-limits"
|
# pragma GCC diagnostic ignored "-Wtype-limits"
|
||||||
|
2
panama.h
2
panama.h
@ -11,7 +11,7 @@
|
|||||||
#include "secblock.h"
|
#include "secblock.h"
|
||||||
|
|
||||||
// Clang 3.3 integrated assembler crash on Linux. Clang 3.4 due to compiler error with .intel_syntax
|
// Clang 3.3 integrated assembler crash on Linux. Clang 3.4 due to compiler error with .intel_syntax
|
||||||
#if CRYPTOPP_BOOL_X32 || (defined(CRYPTOPP_CLANG_VERSION) && (CRYPTOPP_CLANG_VERSION < 30500))
|
#if CRYPTOPP_BOOL_X32 || (defined(CRYPTOPP_LLVM_CLANG_VERSION) && (CRYPTOPP_LLVM_CLANG_VERSION < 30500))
|
||||||
# define CRYPTOPP_DISABLE_PANAMA_ASM
|
# define CRYPTOPP_DISABLE_PANAMA_ASM
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -67,8 +67,8 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CRYPTOPP_CPUID_AVAILABLE)
|
#if defined(CRYPTOPP_CPUID_AVAILABLE)
|
||||||
# define MSC_INTRIN_COMPILER ((CRYPTOPP_MSC_VERSION >= 1700) || (CRYPTOPP_CLANG_VERSION >= 30200) || (_INTEL_COMPILER >= 1210))
|
# 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_CLANG_VERSION >= 30200) || (_INTEL_COMPILER >= 1210))
|
# define GCC_INTRIN_COMPILER ((CRYPTOPP_GCC_VERSION >= 40600) || (CRYPTOPP_LLVM_CLANG_VERSION >= 30200) || (_INTEL_COMPILER >= 1210))
|
||||||
#else
|
#else
|
||||||
# define MSC_INTRIN_COMPILER 0
|
# define MSC_INTRIN_COMPILER 0
|
||||||
# define GCC_INTRIN_COMPILER 0
|
# define GCC_INTRIN_COMPILER 0
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
#include "secblock.h"
|
#include "secblock.h"
|
||||||
|
|
||||||
// Clang 3.3 integrated assembler crash on Linux
|
// Clang 3.3 integrated assembler crash on Linux
|
||||||
#if CRYPTOPP_BOOL_X32 || (defined(CRYPTOPP_CLANG_VERSION) && (CRYPTOPP_CLANG_VERSION < 30400))
|
#if CRYPTOPP_BOOL_X32 || (defined(CRYPTOPP_LLVM_CLANG_VERSION) && (CRYPTOPP_LLVM_CLANG_VERSION < 30400))
|
||||||
# define CRYPTOPP_DISABLE_RIJNDAEL_ASM
|
# define CRYPTOPP_DISABLE_RIJNDAEL_ASM
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
2
sha.h
2
sha.h
@ -11,7 +11,7 @@
|
|||||||
#include "iterhash.h"
|
#include "iterhash.h"
|
||||||
|
|
||||||
// Clang 3.3 integrated assembler crash on Linux
|
// Clang 3.3 integrated assembler crash on Linux
|
||||||
#if defined(CRYPTOPP_CLANG_VERSION) && (CRYPTOPP_CLANG_VERSION < 30400)
|
#if defined(CRYPTOPP_LLVM_CLANG_VERSION) && (CRYPTOPP_LLVM_CLANG_VERSION < 30400)
|
||||||
# define CRYPTOPP_DISABLE_SHA_ASM
|
# define CRYPTOPP_DISABLE_SHA_ASM
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
11
wait.h
11
wait.h
@ -32,6 +32,13 @@
|
|||||||
# endif
|
# endif
|
||||||
#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)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
class Tracer
|
class Tracer
|
||||||
@ -223,6 +230,10 @@ private:
|
|||||||
|
|
||||||
NAMESPACE_END
|
NAMESPACE_END
|
||||||
|
|
||||||
|
#if CRYPTOPP_MSC_VERSION == 1900
|
||||||
|
# pragma warning(pop)
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user