aboutsummaryrefslogtreecommitdiffstats
path: root/src/modes/ctr/ctr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modes/ctr/ctr.cpp')
-rw-r--r--src/modes/ctr/ctr.cpp34
1 files changed, 18 insertions, 16 deletions
diff --git a/src/modes/ctr/ctr.cpp b/src/modes/ctr/ctr.cpp
index a17343df1..9eb42ec5a 100644
--- a/src/modes/ctr/ctr.cpp
+++ b/src/modes/ctr/ctr.cpp
@@ -1,7 +1,9 @@
-/*************************************************
-* CTR Mode Source File *
-* (C) 1999-2007 Jack Lloyd *
-*************************************************/
+/*
+* CTR Mode
+* (C) 1999-2007 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
#include <botan/ctr.h>
#include <botan/xor_buf.h>
@@ -9,17 +11,17 @@
namespace Botan {
-/*************************************************
-* CTR-BE Constructor *
-*************************************************/
+/*
+* CTR-BE Constructor
+*/
CTR_BE::CTR_BE(BlockCipher* ciph) :
BlockCipherMode(ciph, "CTR-BE", ciph->BLOCK_SIZE, 1)
{
}
-/*************************************************
-* CTR-BE Constructor *
-*************************************************/
+/*
+* CTR-BE Constructor
+*/
CTR_BE::CTR_BE(BlockCipher* ciph, const SymmetricKey& key,
const InitializationVector& iv) :
BlockCipherMode(ciph, "CTR-BE", ciph->BLOCK_SIZE, 1)
@@ -28,9 +30,9 @@ CTR_BE::CTR_BE(BlockCipher* ciph, const SymmetricKey& key,
set_iv(iv);
}
-/*************************************************
-* CTR-BE Encryption/Decryption *
-*************************************************/
+/*
+* CTR-BE Encryption/Decryption
+*/
void CTR_BE::write(const byte input[], u32bit length)
{
u32bit copied = std::min(BLOCK_SIZE - position, length);
@@ -58,9 +60,9 @@ void CTR_BE::write(const byte input[], u32bit length)
position += length;
}
-/*************************************************
-* Increment the counter and update the buffer *
-*************************************************/
+/*
+* Increment the counter and update the buffer
+*/
void CTR_BE::increment_counter()
{
for(s32bit j = BLOCK_SIZE - 1; j >= 0; --j)