summaryrefslogtreecommitdiff
path: root/modes.cpp
diff options
context:
space:
mode:
authorweidai <weidai11@users.noreply.github.com>2007-04-16 00:34:13 +0000
committerweidai <weidai11@users.noreply.github.com>2007-04-16 00:34:13 +0000
commitc46c9fbc2be9ff8d0d97236bd78b2be4a74b754b (patch)
tree56bf19a09990ed7a57c8d48da5ceaf509e7a8fdc /modes.cpp
parentde8b060ea1c0ec0d6ec396707972b07db9911198 (diff)
downloadcryptopp-git-c46c9fbc2be9ff8d0d97236bd78b2be4a74b754b.tar.gz
rename STRUCTURED_IV to UNIQUE_IV. assert correct cipher direction
Diffstat (limited to 'modes.cpp')
-rw-r--r--modes.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/modes.cpp b/modes.cpp
index 295fc341..b51afe9b 100644
--- a/modes.cpp
+++ b/modes.cpp
@@ -61,6 +61,7 @@ inline void CTR_ModePolicy::ProcessMultipleBlocks(byte *output, const byte *inpu
void CTR_ModePolicy::OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount)
{
+ assert(m_cipher->IsForwardTransformation()); // CTR mode needs the "encrypt" direction of the underlying block cipher, even to decrypt
unsigned int maxBlocks = m_cipher->OptimalNumberOfParallelBlocks();
if (maxBlocks == 1)
{