summaryrefslogtreecommitdiff
path: root/sha.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2018-07-20 13:15:29 -0400
committerJeffrey Walton <noloader@gmail.com>2018-07-20 13:15:29 -0400
commit45ffb7e82794a3a023ccbd653f657b5c220135c7 (patch)
treed2376b4b773031c06b0aac036e23f63d18e5f66b /sha.h
parent8d6b1af4cf4a1a12f9b39f75c9fcdf9722284373 (diff)
downloadcryptopp-git-45ffb7e82794a3a023ccbd653f657b5c220135c7.tar.gz
Fix crash in SHA-512 when using different compile options (GH #661)
This also helps clear a crash on Sparc due to unaligned access to an uint64_t (GH #689)
Diffstat (limited to 'sha.h')
-rw-r--r--sha.h10
1 files changed, 2 insertions, 8 deletions
diff --git a/sha.h b/sha.h
index 23c9f6c1..f2c3196e 100644
--- a/sha.h
+++ b/sha.h
@@ -11,12 +11,6 @@
#include "config.h"
#include "iterhash.h"
-#if (CRYPTOPP_BOOL_X86)
-# define SHA_X86_ALIGN16 true
-#else
-# define SHA_X86_ALIGN16 false
-#endif
-
NAMESPACE_BEGIN(CryptoPP)
/// \brief SHA-1 message digest
@@ -138,7 +132,7 @@ protected:
/// \brief SHA-512 message digest
/// \sa <a href="http://www.weidai.com/scan-mirror/md.html#SHA-512">SHA-512</a>
/// \since SHA2 since Crypto++ 4.0, Power8 SHA since Crypto++ 6.1
-class CRYPTOPP_DLL SHA512 : public IteratedHashWithStaticTransform<word64, BigEndian, 128, 64, SHA512, 64, SHA_X86_ALIGN16>
+class CRYPTOPP_DLL SHA512 : public IteratedHashWithStaticTransform<word64, BigEndian, 128, 64, SHA512, 64, true>
{
public:
/// \brief Initialize state array
@@ -173,7 +167,7 @@ public:
/// \brief SHA-384 message digest
/// \sa <a href="http://www.weidai.com/scan-mirror/md.html#SHA-384">SHA-384</a>
/// \since SHA2 since Crypto++ 4.0, Power8 SHA since Crypto++ 6.1
-class CRYPTOPP_DLL SHA384 : public IteratedHashWithStaticTransform<word64, BigEndian, 128, 64, SHA384, 48, SHA_X86_ALIGN16>
+class CRYPTOPP_DLL SHA384 : public IteratedHashWithStaticTransform<word64, BigEndian, 128, 64, SHA384, 48, true>
{
public:
/// \brief Initialize state array