aboutsummaryrefslogtreecommitdiffstats
path: root/src/modes/ecb/ecb.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modes/ecb/ecb.cpp')
-rw-r--r--src/modes/ecb/ecb.cpp46
1 files changed, 24 insertions, 22 deletions
diff --git a/src/modes/ecb/ecb.cpp b/src/modes/ecb/ecb.cpp
index b76e86ad9..8da0a4802 100644
--- a/src/modes/ecb/ecb.cpp
+++ b/src/modes/ecb/ecb.cpp
@@ -1,15 +1,17 @@
-/*************************************************
-* ECB Mode Source File *
-* (C) 1999-2007 Jack Lloyd *
-*************************************************/
+/*
+* ECB Mode
+* (C) 1999-2007 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
#include <botan/ecb.h>
namespace Botan {
-/*************************************************
-* Verify the IV is not set *
-*************************************************/
+/*
+* Verify the IV is not set
+*/
bool ECB::valid_iv_size(u32bit iv_size) const
{
if(iv_size == 0)
@@ -17,17 +19,17 @@ bool ECB::valid_iv_size(u32bit iv_size) const
return false;
}
-/*************************************************
-* Return an ECB mode name *
-*************************************************/
+/*
+* Return an ECB mode name
+*/
std::string ECB::name() const
{
return (cipher->name() + "/" + mode_name + "/" + padder->name());
}
-/*************************************************
-* Encrypt in ECB mode *
-*************************************************/
+/*
+* Encrypt in ECB mode
+*/
void ECB_Encryption::write(const byte input[], u32bit length)
{
buffer.copy(position, input, length);
@@ -50,9 +52,9 @@ void ECB_Encryption::write(const byte input[], u32bit length)
position += length;
}
-/*************************************************
-* Finish encrypting in ECB mode *
-*************************************************/
+/*
+* Finish encrypting in ECB mode
+*/
void ECB_Encryption::end_msg()
{
SecureVector<byte> padding(BLOCK_SIZE);
@@ -62,9 +64,9 @@ void ECB_Encryption::end_msg()
throw Encoding_Error(name() + ": Did not pad to full blocksize");
}
-/*************************************************
-* Decrypt in ECB mode *
-*************************************************/
+/*
+* Decrypt in ECB mode
+*/
void ECB_Decryption::write(const byte input[], u32bit length)
{
buffer.copy(position, input, length);
@@ -87,9 +89,9 @@ void ECB_Decryption::write(const byte input[], u32bit length)
position += length;
}
-/*************************************************
-* Finish decrypting in ECB mode *
-*************************************************/
+/*
+* Finish decrypting in ECB mode
+*/
void ECB_Decryption::end_msg()
{
if(position != BLOCK_SIZE)