diff options
author | weidai <weidai11@users.noreply.github.com> | 2002-10-17 16:32:28 +0000 |
---|---|---|
committer | weidai <weidai11@users.noreply.github.com> | 2002-10-17 16:32:28 +0000 |
commit | deea52fd3b8059dc61d503d4a125d85cb4e2cc81 (patch) | |
tree | e508ea100a61e22b1f3d56c3aa2b4479e93da51e /modes.cpp | |
parent | 0e0049180df954f341fa056797c92916950c3e58 (diff) | |
download | cryptopp-git-deea52fd3b8059dc61d503d4a125d85cb4e2cc81.tar.gz |
bug fixes and KAT for X9.17 RNG
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; } } |