From f12e1598dcf0ca654005e0387af686951955483b Mon Sep 17 00:00:00 2001 From: weidai Date: Tue, 4 Feb 2003 00:40:24 +0000 Subject: Seek() bug fix git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@28 57ff6487-cd31-0410-9ec3-f628ee90f5f0 --- modes.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modes.cpp') diff --git a/modes.cpp b/modes.cpp index a517c71..e573d3c 100644 --- a/modes.cpp +++ b/modes.cpp @@ -63,9 +63,9 @@ void CipherModeBase::SetIV(const byte *iv) void CTR_ModePolicy::SeekToIteration(dword iterationCount) { int carry=0; - for (int i=BlockSize()-1; i>=0 && (iterationCount || carry); i--) + for (int i=BlockSize()-1; i>=0; i--) { - unsigned int sum = m_counterArray[i] + byte(iterationCount) + carry; + unsigned int sum = m_register[i] + byte(iterationCount) + carry; m_counterArray[i] = (byte) sum; carry = sum >> 8; iterationCount >>= 8; -- cgit v1.2.1