Update comments
parent
a9cd6755c7
commit
a1b3102eab
|
|
@ -29,7 +29,7 @@
|
||||||
# define EXCEPTION_EXECUTE_HANDLER 1
|
# define EXCEPTION_EXECUTE_HANDLER 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Clang __m128i casts
|
// Clang __m128i casts, http://bugs.llvm.org/show_bug.cgi?id=20670
|
||||||
#define M128_CAST(x) ((__m128i *)(void *)(x))
|
#define M128_CAST(x) ((__m128i *)(void *)(x))
|
||||||
#define CONST_M128_CAST(x) ((const __m128i *)(const void *)(x))
|
#define CONST_M128_CAST(x) ((const __m128i *)(const void *)(x))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@
|
||||||
# define EXCEPTION_EXECUTE_HANDLER 1
|
# define EXCEPTION_EXECUTE_HANDLER 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Clang __m128i casts
|
// Clang __m128i casts, http://bugs.llvm.org/show_bug.cgi?id=20670
|
||||||
#define M128_CAST(x) ((__m128i *)(void *)(x))
|
#define M128_CAST(x) ((__m128i *)(void *)(x))
|
||||||
#define CONST_M128_CAST(x) ((const __m128i *)(const void *)(x))
|
#define CONST_M128_CAST(x) ((const __m128i *)(const void *)(x))
|
||||||
|
|
||||||
|
|
|
||||||
2
gcm.cpp
2
gcm.cpp
|
|
@ -51,7 +51,7 @@ NAMESPACE_BEGIN(CryptoPP)
|
||||||
#endif
|
#endif
|
||||||
#endif // CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64
|
#endif // CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64
|
||||||
|
|
||||||
// Clang __m128i casts
|
// Clang __m128i casts, http://bugs.llvm.org/show_bug.cgi?id=20670
|
||||||
#define M128_CAST(x) ((__m128i *)(void *)(x))
|
#define M128_CAST(x) ((__m128i *)(void *)(x))
|
||||||
#define CONST_M128_CAST(x) ((const __m128i *)(const void *)(x))
|
#define CONST_M128_CAST(x) ((const __m128i *)(const void *)(x))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@
|
||||||
# define MAYBE_CONST const
|
# define MAYBE_CONST const
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Clang __m128i casts
|
// Clang __m128i casts, http://bugs.llvm.org/show_bug.cgi?id=20670
|
||||||
#define M128_CAST(x) ((__m128i *)(void *)(x))
|
#define M128_CAST(x) ((__m128i *)(void *)(x))
|
||||||
#define CONST_M128_CAST(x) ((const __m128i *)(const void *)(x))
|
#define CONST_M128_CAST(x) ((const __m128i *)(const void *)(x))
|
||||||
|
|
||||||
|
|
@ -684,7 +684,7 @@ void Rijndael_UncheckedSetKey_SSE4_AESNI(const byte *userKey, size_t keyLen, wor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Rijndael_UncheckedSetKeyRev_SSE4_AESNI(word32 *key, unsigned int rounds)
|
void Rijndael_UncheckedSetKeyRev_AESNI(word32 *key, unsigned int rounds)
|
||||||
{
|
{
|
||||||
unsigned int i, j;
|
unsigned int i, j;
|
||||||
__m128i temp;
|
__m128i temp;
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,11 @@ being unloaded from L1 cache, until that round is finished.
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
|
// Clang 3.3 integrated assembler crash on Linux
|
||||||
|
#if CRYPTOPP_BOOL_X32 || (defined(CRYPTOPP_LLVM_CLANG_VERSION) && (CRYPTOPP_LLVM_CLANG_VERSION < 30400))
|
||||||
|
# define CRYPTOPP_DISABLE_RIJNDAEL_ASM
|
||||||
|
#endif
|
||||||
|
|
||||||
// Hack for http://github.com/weidai11/cryptopp/issues/42 and http://github.com/weidai11/cryptopp/issues/132
|
// Hack for http://github.com/weidai11/cryptopp/issues/42 and http://github.com/weidai11/cryptopp/issues/132
|
||||||
#if (CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE)) && !defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS)
|
#if (CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE)) && !defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS)
|
||||||
# define CRYPTOPP_ALLOW_RIJNDAEL_UNALIGNED_DATA_ACCESS 1
|
# define CRYPTOPP_ALLOW_RIJNDAEL_UNALIGNED_DATA_ACCESS 1
|
||||||
|
|
@ -224,7 +229,7 @@ void Rijndael::Base::FillDecTable()
|
||||||
|
|
||||||
#if (CRYPTOPP_AESNI_AVAILABLE)
|
#if (CRYPTOPP_AESNI_AVAILABLE)
|
||||||
extern void Rijndael_UncheckedSetKey_SSE4_AESNI(const byte *userKey, size_t keyLen, word32* rk);
|
extern void Rijndael_UncheckedSetKey_SSE4_AESNI(const byte *userKey, size_t keyLen, word32* rk);
|
||||||
extern void Rijndael_UncheckedSetKeyRev_SSE4_AESNI(word32 *key, unsigned int rounds);
|
extern void Rijndael_UncheckedSetKeyRev_AESNI(word32 *key, unsigned int rounds);
|
||||||
|
|
||||||
extern size_t Rijndael_Enc_AdvancedProcessBlocks_AESNI(const word32 *subkeys, size_t rounds,
|
extern size_t Rijndael_Enc_AdvancedProcessBlocks_AESNI(const word32 *subkeys, size_t rounds,
|
||||||
const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags);
|
const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags);
|
||||||
|
|
@ -256,7 +261,7 @@ void Rijndael::Base::UncheckedSetKey(const byte *userKey, unsigned int keyLen, c
|
||||||
// Atoms have SSE2-SSSE3 and AES-NI, but not SSE4.1 or SSE4.2.
|
// Atoms have SSE2-SSSE3 and AES-NI, but not SSE4.1 or SSE4.2.
|
||||||
Rijndael_UncheckedSetKey_SSE4_AESNI(userKey, keyLen, rk);
|
Rijndael_UncheckedSetKey_SSE4_AESNI(userKey, keyLen, rk);
|
||||||
if (!IsForwardTransformation())
|
if (!IsForwardTransformation())
|
||||||
Rijndael_UncheckedSetKeyRev_SSE4_AESNI(m_key, m_rounds);
|
Rijndael_UncheckedSetKeyRev_AESNI(m_key, m_rounds);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,11 +12,6 @@
|
||||||
#include "seckey.h"
|
#include "seckey.h"
|
||||||
#include "secblock.h"
|
#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))
|
|
||||||
# define CRYPTOPP_DISABLE_RIJNDAEL_ASM
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARM64
|
#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARM64
|
||||||
# define CRYPTOPP_ENABLE_ADVANCED_PROCESS_BLOCKS 1
|
# define CRYPTOPP_ENABLE_ADVANCED_PROCESS_BLOCKS 1
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,8 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
|
// ***************** SIGILL probes ********************
|
||||||
|
|
||||||
#ifdef CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY
|
#ifdef CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY
|
||||||
extern "C" {
|
extern "C" {
|
||||||
typedef void (*SigHandler)(int);
|
typedef void (*SigHandler)(int);
|
||||||
|
|
@ -189,6 +191,9 @@ bool CPU_ProbeSHA2()
|
||||||
}
|
}
|
||||||
#endif // ARM32 or ARM64
|
#endif // ARM32 or ARM64
|
||||||
|
|
||||||
|
// ***************** Intel x86 SHA ********************
|
||||||
|
|
||||||
|
// provided by sha.cpp
|
||||||
extern const word32 SHA256_K[64];
|
extern const word32 SHA256_K[64];
|
||||||
|
|
||||||
///////////////////////////////////
|
///////////////////////////////////
|
||||||
|
|
@ -603,6 +608,8 @@ void SHA256_HashMultipleBlocks_SHANI(word32 *state, const word32 *data, size_t l
|
||||||
// end of Walton/Gulley's code //
|
// end of Walton/Gulley's code //
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
|
|
||||||
|
// ***************** ARMV8 SHA ********************
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////
|
||||||
// start of Walton/Schneiders/O'Rourke/Hovsmith's code //
|
// start of Walton/Schneiders/O'Rourke/Hovsmith's code //
|
||||||
/////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@
|
||||||
# include "arm_acle.h"
|
# include "arm_acle.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Clang __m128i casts
|
// Clang __m128i casts, http://bugs.llvm.org/show_bug.cgi?id=20670
|
||||||
#define M128_CAST(x) ((__m128i *)(void *)(x))
|
#define M128_CAST(x) ((__m128i *)(void *)(x))
|
||||||
#define CONST_M128_CAST(x) ((const __m128i *)(const void *)(x))
|
#define CONST_M128_CAST(x) ((const __m128i *)(const void *)(x))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue