mirror of
https://github.com/shadps4-emu/ext-cryptopp.git
synced 2025-01-20 00:02:38 +00:00
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)
This commit is contained in:
parent
8d6b1af4cf
commit
45ffb7e827
10
sha.h
10
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user