From f1192fd0442b5d5a76c86be8c0985c32e512d9ed Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Sat, 21 Jul 2018 06:51:41 -0400 Subject: Update comments in IterHashBase and friends We also switched to "IsAligned(input)". Using word64 was due to debug testing on Solaris (the alignment check is needed). Hard coding word64 should not have been checked in. --- iterhash.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'iterhash.cpp') 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); } -- cgit v1.2.1