aboutsummaryrefslogtreecommitdiffstats
path: root/src/modes/cfb/cfb.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-03-30 18:27:18 +0000
committerlloyd <[email protected]>2009-03-30 18:27:18 +0000
commit96d6eb6f29c55e16a37cf11899547886f735b065 (patch)
tree9f13901e9b44c98d58b2589c9b09c6a7443eb7cd /src/modes/cfb/cfb.cpp
parent3cc3dd72c5f87b76852a55c1f2d1821dba967d8c (diff)
Thomas Moschny passed along a request from the Fedora packagers which came
up during the Fedora submission review, that each source file include some text about the license. One handy Perl script later and each file now has the line Distributed under the terms of the Botan license after the copyright notices. While I was in there modifying every file anyway, I also stripped out the remainder of the block comments (lots of astericks before and after the text); this is stylistic thing I picked up when I was first learning C++ but in retrospect it is not a good style as the structure makes it harder to modify comments (with the result that comments become fewer, shorter and are less likely to be updated, which are not good things).
Diffstat (limited to 'src/modes/cfb/cfb.cpp')
-rw-r--r--src/modes/cfb/cfb.cpp64
1 files changed, 33 insertions, 31 deletions
diff --git a/src/modes/cfb/cfb.cpp b/src/modes/cfb/cfb.cpp
index f5eb4cecf..a126bd995 100644
--- a/src/modes/cfb/cfb.cpp
+++ b/src/modes/cfb/cfb.cpp
@@ -1,7 +1,9 @@
-/*************************************************
-* CFB Mode Source File *
-* (C) 1999-2007 Jack Lloyd *
-*************************************************/
+/*
+* CFB Mode
+* (C) 1999-2007 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
#include <botan/cfb.h>
#include <botan/parsing.h>
@@ -12,9 +14,9 @@ namespace Botan {
namespace {
-/*************************************************
-* Check the feedback size *
-*************************************************/
+/*
+* Check the feedback size
+*/
void check_feedback(u32bit BLOCK_SIZE, u32bit FEEDBACK_SIZE, u32bit bits,
const std::string& name)
{
@@ -25,9 +27,9 @@ void check_feedback(u32bit BLOCK_SIZE, u32bit FEEDBACK_SIZE, u32bit bits,
}
-/*************************************************
-* CFB Encryption Constructor *
-*************************************************/
+/*
+* CFB Encryption Constructor
+*/
CFB_Encryption::CFB_Encryption(BlockCipher* ciph,
u32bit fback_bits) :
BlockCipherMode(ciph, "CFB", ciph->BLOCK_SIZE, 1),
@@ -36,9 +38,9 @@ CFB_Encryption::CFB_Encryption(BlockCipher* ciph,
check_feedback(BLOCK_SIZE, FEEDBACK_SIZE, fback_bits, name());
}
-/*************************************************
-* CFB Encryption Constructor *
-*************************************************/
+/*
+* CFB Encryption Constructor
+*/
CFB_Encryption::CFB_Encryption(BlockCipher* ciph,
const SymmetricKey& key,
const InitializationVector& iv,
@@ -51,9 +53,9 @@ CFB_Encryption::CFB_Encryption(BlockCipher* ciph,
set_iv(iv);
}
-/*************************************************
-* Encrypt data in CFB mode *
-*************************************************/
+/*
+* Encrypt data in CFB mode
+*/
void CFB_Encryption::write(const byte input[], u32bit length)
{
while(length)
@@ -69,9 +71,9 @@ void CFB_Encryption::write(const byte input[], u32bit length)
}
}
-/*************************************************
-* Do the feedback *
-*************************************************/
+/*
+* Do the feedback
+*/
void CFB_Encryption::feedback()
{
for(u32bit j = 0; j != BLOCK_SIZE - FEEDBACK_SIZE; ++j)
@@ -81,9 +83,9 @@ void CFB_Encryption::feedback()
position = 0;
}
-/*************************************************
-* CFB Decryption Constructor *
-*************************************************/
+/*
+* CFB Decryption Constructor
+*/
CFB_Decryption::CFB_Decryption(BlockCipher* ciph,
u32bit fback_bits) :
BlockCipherMode(ciph, "CFB", ciph->BLOCK_SIZE, 1),
@@ -92,9 +94,9 @@ CFB_Decryption::CFB_Decryption(BlockCipher* ciph,
check_feedback(BLOCK_SIZE, FEEDBACK_SIZE, fback_bits, name());
}
-/*************************************************
-* CFB Decryption Constructor *
-*************************************************/
+/*
+* CFB Decryption Constructor
+*/
CFB_Decryption::CFB_Decryption(BlockCipher* ciph,
const SymmetricKey& key,
const InitializationVector& iv,
@@ -107,9 +109,9 @@ CFB_Decryption::CFB_Decryption(BlockCipher* ciph,
set_iv(iv);
}
-/*************************************************
-* Decrypt data in CFB mode *
-*************************************************/
+/*
+* Decrypt data in CFB mode
+*/
void CFB_Decryption::write(const byte input[], u32bit length)
{
while(length)
@@ -126,9 +128,9 @@ void CFB_Decryption::write(const byte input[], u32bit length)
}
}
-/*************************************************
-* Do the feedback *
-*************************************************/
+/*
+* Do the feedback
+*/
void CFB_Decryption::feedback()
{
for(u32bit j = 0; j != BLOCK_SIZE - FEEDBACK_SIZE; ++j)