summaryrefslogtreecommitdiff
path: root/vmac.cpp
diff options
context:
space:
mode:
authorweidai <weidai11@users.noreply.github.com>2009-01-24 02:51:45 +0000
committerweidai <weidai11@users.noreply.github.com>2009-01-24 02:51:45 +0000
commiteb5732337be02e36c8f5293a2d22d8f74130e684 (patch)
treecf7f435ace477e6ed554b27c8be984b4a93b683f /vmac.cpp
parentf8717545022137560ae3fe2f2a28709bf9122d78 (diff)
downloadcryptopp-git-eb5732337be02e36c8f5293a2d22d8f74130e684.tar.gz
fix incorrect VMAC computation on message lengths that are >64 mod 128
Diffstat (limited to 'vmac.cpp')
-rwxr-xr-xvmac.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/vmac.cpp b/vmac.cpp
index 6c784f15..ecfd278d 100755
--- a/vmac.cpp
+++ b/vmac.cpp
@@ -472,20 +472,18 @@ void VMAC_Base::VHASH_Update_Template(const word64 *data, size_t blocksRemaining
DeclareNH(nhA);
DeclareNH(nhB);
+ i = 0;
if (blocksRemainingInWord64 < L1KeyLengthInWord64)
{
if (blocksRemainingInWord64 % 8)
{
innerLoopEnd = blocksRemainingInWord64 % 8;
- for (i=0; i<innerLoopEnd; i+=2)
+ for (; i<innerLoopEnd; i+=2)
INNER_LOOP_ITERATION(0);
- blocksRemainingInWord64 -= innerLoopEnd;
- data += innerLoopEnd;
}
innerLoopEnd = blocksRemainingInWord64;
}
-
- for (i=0; i<innerLoopEnd; i+=8)
+ for (; i<innerLoopEnd; i+=8)
{
INNER_LOOP_ITERATION(0);
INNER_LOOP_ITERATION(1);