summaryrefslogtreecommitdiff
path: root/iterhash.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2018-07-21 06:51:41 -0400
committerJeffrey Walton <noloader@gmail.com>2018-07-21 06:51:41 -0400
commitf1192fd0442b5d5a76c86be8c0985c32e512d9ed (patch)
tree1b91c801a0856d01552815611716fb5707a0d3a0 /iterhash.cpp
parent61f1456a5ac5487ee3e927cbaeea0ee87db117f9 (diff)
downloadcryptopp-git-f1192fd0442b5d5a76c86be8c0985c32e512d9ed.tar.gz
Update comments in IterHashBase and friends
We also switched to "IsAligned<HashWordType>(input)". Using word64 was due to debug testing on Solaris (the alignment check is needed). Hard coding word64 should not have been checked in.
Diffstat (limited to 'iterhash.cpp')
-rw-r--r--iterhash.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/iterhash.cpp b/iterhash.cpp
index f31722c9..938a0fac 100644
--- a/iterhash.cpp
+++ b/iterhash.cpp
@@ -96,16 +96,17 @@ template <class T, class BASE> size_t IteratedHashBase<T, BASE>::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<word64>(input))
+ if (IsAligned<HashWordType>(input))
{
+ // Sparc bus error with non-aligned input.
this->HashEndianCorrectedBlock(input);
}
else
@@ -116,8 +117,9 @@ template <class T, class BASE> size_t IteratedHashBase<T, BASE>::HashMultipleBlo
}
else
{
- if (IsAligned<word64>(input))
+ if (IsAligned<HashWordType>(input))
{
+ // Sparc bus error with non-aligned input.
ByteReverse(dataBuf, input, blockSize);
this->HashEndianCorrectedBlock(dataBuf);
}