diff options
author | Jeffrey Walton <noloader@gmail.com> | 2016-09-13 20:44:14 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2016-09-13 20:44:14 -0400 |
commit | ff67abdec52b6412842c05dded4c3e2ba203d817 (patch) | |
tree | c20ef57ef1e1932f87d636aa68561aee560fbb01 /sha.cpp | |
parent | df7e07e75e302f34d8968f65ab8126333b006ae5 (diff) | |
download | cryptopp-git-ff67abdec52b6412842c05dded4c3e2ba203d817.tar.gz |
Add virtual dtor for IteratedHash and ClonableImpl due to non-trivial data members
Solaris is showing unusual signs with SunCC 5.13 and 5.14. One user is experiencing a SIGBUS in SHA512::Transform due to data alignment of 'data', which was only 2-byte aligned. The project experienced an exception "Coneable not implemented" during the hashing test after building with Cmake. Its not clear how much Cmake influenced the project's results.
Diffstat (limited to 'sha.cpp')
-rw-r--r-- | sha.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -643,7 +643,7 @@ void SHA512::InitState(HashWordType *state) #if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE && (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32)
CRYPTOPP_ALIGN_DATA(16) static const word64 SHA512_K[80] CRYPTOPP_SECTION_ALIGN16 = {
#else
-static const word64 SHA512_K[80] = {
+CRYPTOPP_ALIGN_DATA(16) static const word64 SHA512_K[80] CRYPTOPP_SECTION_ALIGN16 = {
#endif
W64LIT(0x428a2f98d728ae22), W64LIT(0x7137449123ef65cd),
W64LIT(0xb5c0fbcfec4d3b2f), W64LIT(0xe9b5dba58189dbbc),
@@ -886,6 +886,9 @@ CRYPTOPP_NAKED static void CRYPTOPP_FASTCALL SHA512_SSE2_Transform(word64 *state void SHA512::Transform(word64 *state, const word64 *data)
{
+ assert(IsAlignedOn(state, GetAlignmentOf<word64>()));
+ assert(IsAlignedOn(data, GetAlignmentOf<word64>()));
+
#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE && (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32)
if (HasSSE2())
{
|