diff options
author | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2002-10-17 16:32:28 +0000 |
---|---|---|
committer | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2002-10-17 16:32:28 +0000 |
commit | 68bd19cb320b2023aa892c2de15b419edf3f3086 (patch) | |
tree | e508ea100a61e22b1f3d56c3aa2b4479e93da51e /modes.cpp | |
parent | 9242d66857d0199765f58148ea33821438f864e2 (diff) | |
download | cryptopp-68bd19cb320b2023aa892c2de15b419edf3f3086.tar.gz |
bug fixes and KAT for X9.17 RNG
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@11 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'modes.cpp')
-rw-r--r-- | modes.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -144,11 +144,11 @@ void BlockOrientedCipherModeBase::ProcessData(byte *outString, const byte *inStr unsigned int s = BlockSize(); assert(length % s == 0); unsigned int alignment = m_cipher->BlockAlignment(); - bool requireAlignedInput = RequireAlignedInput(); + bool inputAlignmentOk = !RequireAlignedInput() || IsAlignedOn(inString, alignment); if (IsAlignedOn(outString, alignment)) { - if (!requireAlignedInput || IsAlignedOn(inString, alignment)) + if (inputAlignmentOk) ProcessBlocks(outString, inString, length / s); else { @@ -160,7 +160,7 @@ void BlockOrientedCipherModeBase::ProcessData(byte *outString, const byte *inStr { while (length) { - if (!requireAlignedInput || IsAlignedOn(inString, alignment)) + if (inputAlignmentOk) ProcessBlocks(m_buffer, inString, 1); else { @@ -168,6 +168,8 @@ void BlockOrientedCipherModeBase::ProcessData(byte *outString, const byte *inStr ProcessBlocks(m_buffer, m_buffer, 1); } memcpy(outString, m_buffer, s); + inString += s; + outString += s; length -= s; } } |