summaryrefslogtreecommitdiff
path: root/modes.cpp
diff options
context:
space:
mode:
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 5738b403..1dbc8fc3 100644
--- a/modes.cpp
+++ b/modes.cpp
@@ -177,7 +177,7 @@ void CBC_Encryption::ProcessData(byte *outString, const byte *inString, size_t l
if (!length) return;
CRYPTOPP_ASSERT(length%BlockSize()==0);
- unsigned int blockSize = BlockSize();
+ const unsigned int blockSize = BlockSize();
m_cipher->AdvancedProcessBlocks(inString, m_register, outString, blockSize, BlockTransformation::BT_XorInput);
if (length > blockSize)
m_cipher->AdvancedProcessBlocks(inString+blockSize, outString, outString+blockSize, length-blockSize, BlockTransformation::BT_XorInput);
@@ -227,7 +227,7 @@ void CBC_Decryption::ProcessData(byte *outString, const byte *inString, size_t l
return;
CRYPTOPP_ASSERT(length%BlockSize()==0);
- unsigned int blockSize = BlockSize();
+ const unsigned int blockSize = BlockSize();
memcpy(m_temp, inString+length-blockSize, blockSize); // save copy now in case of in-place decryption
if (length > blockSize)
m_cipher->AdvancedProcessBlocks(inString+blockSize, inString, outString+blockSize, length-blockSize, BlockTransformation::BT_ReverseDirection|BlockTransformation::BT_AllowParallel);