summaryrefslogtreecommitdiff
path: root/modes.cpp
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2007-04-16 00:34:13 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2007-04-16 00:34:13 +0000
commit866f75e49a3f1a83ad937acb6dd66f84fe422d8e (patch)
tree56bf19a09990ed7a57c8d48da5ceaf509e7a8fdc /modes.cpp
parent6320616a7ffda3e44bc6a82a60abc8e9929ea5bd (diff)
downloadcryptopp-866f75e49a3f1a83ad937acb6dd66f84fe422d8e.tar.gz
rename STRUCTURED_IV to UNIQUE_IV. assert correct cipher direction
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@311 57ff6487-cd31-0410-9ec3-f628ee90f5f0
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 295fc34..b51afe9 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)
{