summaryrefslogtreecommitdiff
path: root/modes.cpp
diff options
context:
space:
mode:
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)
{