summaryrefslogtreecommitdiff
path: root/modes.cpp
diff options
context:
space:
mode:
authorweidai <weidai11@users.noreply.github.com>2003-02-04 00:40:24 +0000
committerweidai <weidai11@users.noreply.github.com>2003-02-04 00:40:24 +0000
commite25de4a78b6d860f1f740d9b130ed7536bdae949 (patch)
tree434488a50b90ef8fcc6e125e074663a8da0580ee /modes.cpp
parentf089e29a105c611e974bb9956b17ad0f4f2d917c (diff)
downloadcryptopp-git-e25de4a78b6d860f1f740d9b130ed7536bdae949.tar.gz
Seek() bug fix
Diffstat (limited to 'modes.cpp')
-rw-r--r--modes.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/modes.cpp b/modes.cpp
index a517c719..e573d3ce 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;