Fix Clang 3.3 and 3.4 compiles (Issue 264)
parent
1de8ca5774
commit
6200029faa
11
sha.cpp
11
sha.cpp
|
|
@ -20,6 +20,13 @@
|
|||
#include "misc.h"
|
||||
#include "cpu.h"
|
||||
|
||||
#if defined(CRYPTOPP_DISABLE_SHA_ASM)
|
||||
# undef CRYPTOPP_X86_ASM_AVAILABLE
|
||||
# undef CRYPTOPP_X32_ASM_AVAILABLE
|
||||
# undef CRYPTOPP_X64_ASM_AVAILABLE
|
||||
# undef CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE
|
||||
#endif
|
||||
|
||||
NAMESPACE_BEGIN(CryptoPP)
|
||||
|
||||
// start of Steve Reid's code
|
||||
|
|
@ -102,7 +109,7 @@ void SHA256::InitState(HashWordType *state)
|
|||
memcpy(state, s, sizeof(s));
|
||||
}
|
||||
|
||||
#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE && !defined(CRYPTOPP_DISABLE_SHA_ASM)
|
||||
#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE
|
||||
CRYPTOPP_ALIGN_DATA(16) extern const word32 SHA256_K[64] CRYPTOPP_SECTION_ALIGN16 = {
|
||||
#else
|
||||
extern const word32 SHA256_K[64] = {
|
||||
|
|
@ -127,7 +134,7 @@ extern const word32 SHA256_K[64] = {
|
|||
|
||||
#endif // #ifndef CRYPTOPP_GENERATE_X64_MASM
|
||||
|
||||
#if (defined(CRYPTOPP_X86_ASM_AVAILABLE) || defined(CRYPTOPP_X32_ASM_AVAILABLE) || defined(CRYPTOPP_GENERATE_X64_MASM)) && !defined(CRYPTOPP_DISABLE_SHA_ASM)
|
||||
#if (defined(CRYPTOPP_X86_ASM_AVAILABLE) || defined(CRYPTOPP_X32_ASM_AVAILABLE) || defined(CRYPTOPP_GENERATE_X64_MASM))
|
||||
|
||||
static void CRYPTOPP_FASTCALL X86_SHA256_HashBlocks(word32 *state, const word32 *data, size_t len
|
||||
#if defined(_MSC_VER) && (_MSC_VER == 1200)
|
||||
|
|
|
|||
1
sha.h
1
sha.h
|
|
@ -11,6 +11,7 @@
|
|||
#include "iterhash.h"
|
||||
|
||||
// Clang 3.3 integrated assembler crash on Linux
|
||||
// http://github.com/weidai11/cryptopp/issues/264
|
||||
#if defined(CRYPTOPP_LLVM_CLANG_VERSION) && (CRYPTOPP_LLVM_CLANG_VERSION < 30400)
|
||||
# define CRYPTOPP_DISABLE_SHA_ASM
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -7,6 +7,13 @@
|
|||
#include "misc.h"
|
||||
#include "cpu.h"
|
||||
|
||||
#if defined(CRYPTOPP_DISABLE_TIGER_ASM)
|
||||
# undef CRYPTOPP_X86_ASM_AVAILABLE
|
||||
# undef CRYPTOPP_X32_ASM_AVAILABLE
|
||||
# undef CRYPTOPP_X64_ASM_AVAILABLE
|
||||
# undef CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE
|
||||
#endif
|
||||
|
||||
NAMESPACE_BEGIN(CryptoPP)
|
||||
|
||||
void Tiger::InitState(HashWordType *state)
|
||||
|
|
|
|||
6
tiger.h
6
tiger.h
|
|
@ -4,6 +4,12 @@
|
|||
#include "config.h"
|
||||
#include "iterhash.h"
|
||||
|
||||
// Clang 3.3 integrated assembler crash on Linux
|
||||
// http://github.com/weidai11/cryptopp/issues/264
|
||||
#if defined(CRYPTOPP_LLVM_CLANG_VERSION) && (CRYPTOPP_LLVM_CLANG_VERSION < 30400)
|
||||
# define CRYPTOPP_DISABLE_TIGER_ASM
|
||||
#endif
|
||||
|
||||
NAMESPACE_BEGIN(CryptoPP)
|
||||
|
||||
/// <a href="http://www.cryptolounge.org/wiki/Tiger">Tiger</a>
|
||||
|
|
|
|||
13
vmac.cpp
13
vmac.cpp
|
|
@ -9,6 +9,13 @@
|
|||
#include "argnames.h"
|
||||
#include "secblock.h"
|
||||
|
||||
#if defined(CRYPTOPP_DISABLE_VMAC_ASM)
|
||||
# undef CRYPTOPP_X86_ASM_AVAILABLE
|
||||
# undef CRYPTOPP_X32_ASM_AVAILABLE
|
||||
# undef CRYPTOPP_X64_ASM_AVAILABLE
|
||||
# undef CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE
|
||||
#endif
|
||||
|
||||
#if CRYPTOPP_MSC_VERSION
|
||||
# pragma warning(disable: 4731)
|
||||
#endif
|
||||
|
|
@ -154,13 +161,13 @@ void VMAC_Base::HashEndianCorrectedBlock(const word64 *data)
|
|||
unsigned int VMAC_Base::OptimalDataAlignment() const
|
||||
{
|
||||
return
|
||||
#if (CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE)) && !defined(CRYPTOPP_DISABLE_VMAC_ASM)
|
||||
#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE)
|
||||
HasSSE2() ? 16 :
|
||||
#endif
|
||||
GetCipher().OptimalDataAlignment();
|
||||
}
|
||||
|
||||
#if (CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE && (CRYPTOPP_BOOL_X86 || (CRYPTOPP_BOOL_X32 && !defined(CRYPTOPP_DISABLE_VMAC_ASM))))
|
||||
#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE && (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32)
|
||||
#if CRYPTOPP_MSC_VERSION
|
||||
# pragma warning(disable: 4731) // frame pointer register 'ebp' modified by inline assembly code
|
||||
#endif
|
||||
|
|
@ -798,7 +805,7 @@ void VMAC_Base::VHASH_Update_Template(const word64 *data, size_t blocksRemaining
|
|||
|
||||
inline void VMAC_Base::VHASH_Update(const word64 *data, size_t blocksRemainingInWord64)
|
||||
{
|
||||
#if (CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE && (CRYPTOPP_BOOL_X86 || (CRYPTOPP_BOOL_X32 && !defined(CRYPTOPP_DISABLE_VMAC_ASM))))
|
||||
#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE && (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32)
|
||||
if (HasSSE2())
|
||||
{
|
||||
VHASH_Update_SSE2(data, blocksRemainingInWord64, 0);
|
||||
|
|
|
|||
4
vmac.h
4
vmac.h
|
|
@ -10,7 +10,9 @@
|
|||
#include "iterhash.h"
|
||||
#include "seckey.h"
|
||||
|
||||
#if CRYPTOPP_BOOL_X32
|
||||
// Clang 3.3 integrated assembler crash on Linux
|
||||
// http://github.com/weidai11/cryptopp/issues/264
|
||||
#if (defined(CRYPTOPP_LLVM_CLANG_VERSION) && (CRYPTOPP_LLVM_CLANG_VERSION < 30400)) || CRYPTOPP_BOOL_X32
|
||||
# define CRYPTOPP_DISABLE_VMAC_ASM
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue