diff options
author | Jeffrey Walton <noloader@gmail.com> | 2017-08-20 21:25:29 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-20 21:25:29 -0400 |
commit | 7851a0d5106dfb287f30ca0432285c15c679cf96 (patch) | |
tree | 423349ba4932a494b582cb839547e6fe78fc2f99 /sha.h | |
parent | bac3c1cc40904407500fbc0e097ffb54b7553382 (diff) | |
download | cryptopp-git-7851a0d5106dfb287f30ca0432285c15c679cf96.tar.gz |
Remove BOOL macro value (GH #462)
Currently the CRYPTOPP_BOOL_XXX macros set the macro value to 0 or 1. If we remove setting the 0 value (the #else part of the expression), then the self tests speed up by about 0.3 seconds. I can't explain it, but I have observed it repeatedly.
This check-in prepares for the removal in Upstream master
Diffstat (limited to 'sha.h')
-rw-r--r-- | sha.h | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -11,10 +11,10 @@ #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_SHA_ASM
+#if (CRYPTOPP_BOOL_X86)
+# define SHA_X86_ALIGN16 true
+#else
+# define SHA_X86_ALIGN16 false
#endif
NAMESPACE_BEGIN(CryptoPP)
@@ -131,7 +131,7 @@ protected: //! \brief SHA-512 message digest
//! \sa <a href="http://www.weidai.com/scan-mirror/md.html#SHA-512">SHA-512</a>
//! \since Crypto++ 4.0
-class CRYPTOPP_DLL SHA512 : public IteratedHashWithStaticTransform<word64, BigEndian, 128, 64, SHA512, 64, (CRYPTOPP_BOOL_X86|CRYPTOPP_BOOL_X32)>
+class CRYPTOPP_DLL SHA512 : public IteratedHashWithStaticTransform<word64, BigEndian, 128, 64, SHA512, 64, SHA_X86_ALIGN16>
{
public:
//! \brief Initialize state array
@@ -164,7 +164,7 @@ public: //! \brief SHA-384 message digest
//! \sa <a href="http://www.weidai.com/scan-mirror/md.html#SHA-384">SHA-384</a>
//! \since Crypto++ 4.0
-class CRYPTOPP_DLL SHA384 : public IteratedHashWithStaticTransform<word64, BigEndian, 128, 64, SHA384, 48, (CRYPTOPP_BOOL_X86|CRYPTOPP_BOOL_X32)>
+class CRYPTOPP_DLL SHA384 : public IteratedHashWithStaticTransform<word64, BigEndian, 128, 64, SHA384, 48, SHA_X86_ALIGN16>
{
public:
//! \brief Initialize state array
|