diff --git a/iterhash.cpp b/iterhash.cpp index f31722c9..938a0fac 100644 --- a/iterhash.cpp +++ b/iterhash.cpp @@ -96,16 +96,17 @@ template size_t IteratedHashBase::HashMultipleBlo bool noReverse = NativeByteOrderIs(this->GetByteOrder()); T* dataBuf = this->DataBuf(); - // IteratedHashBase Update calls this with an aligned input, - // but HashBlock may call it with an unaligned buffer. - // Alignment checks due to Issues 690/ + // Alignment checks due to http://github.com/weidai11/cryptopp/issues/690. + // Sparc requires 8-byte aligned buffer when HashWordType is word64. + // We also had to provide a GetAlignmentOf specialization for word64 on Sparc. do { if (noReverse) { - if (IsAligned(input)) + if (IsAligned(input)) { + // Sparc bus error with non-aligned input. this->HashEndianCorrectedBlock(input); } else @@ -116,8 +117,9 @@ template size_t IteratedHashBase::HashMultipleBlo } else { - if (IsAligned(input)) + if (IsAligned(input)) { + // Sparc bus error with non-aligned input. ByteReverse(dataBuf, input, blockSize); this->HashEndianCorrectedBlock(dataBuf); } diff --git a/iterhash.h b/iterhash.h index 06b5f0aa..edaa18e2 100644 --- a/iterhash.h +++ b/iterhash.h @@ -16,10 +16,6 @@ # endif #endif -// GCC cast warning -#define HashWordPtr(x) ((HashWordType*)(void*)(x)) -#define ConstHashWordPtr(x) ((const HashWordType*)(const void*)(x)) - NAMESPACE_BEGIN(CryptoPP) /// \brief Exception thrown when trying to hash more data than is allowed by a hash function