From ff67abdec52b6412842c05dded4c3e2ba203d817 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Tue, 13 Sep 2016 20:44:14 -0400 Subject: 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. --- sha.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sha.cpp') diff --git a/sha.cpp b/sha.cpp index bbde30a3..4e847501 100644 --- a/sha.cpp +++ b/sha.cpp @@ -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())); + assert(IsAlignedOn(data, GetAlignmentOf())); + #if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE && (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32) if (HasSSE2()) { -- cgit v1.2.1