aboutsummaryrefslogtreecommitdiffstats
path: root/src/modes/ecb
diff options
context:
space:
mode:
Diffstat (limited to 'src/modes/ecb')
-rw-r--r--src/modes/ecb/ecb.cpp46
-rw-r--r--src/modes/ecb/ecb.h28
2 files changed, 39 insertions, 35 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)
diff --git a/src/modes/ecb/ecb.h b/src/modes/ecb/ecb.h
index 81fee28d2..5230f9b14 100644
--- a/src/modes/ecb/ecb.h
+++ b/src/modes/ecb/ecb.h
@@ -1,7 +1,9 @@
-/*************************************************
-* ECB Mode Header File *
-* (C) 1999-2007 Jack Lloyd *
-*************************************************/
+/*
+* ECB Mode
+* (C) 1999-2007 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
#ifndef BOTAN_ECB_H__
#define BOTAN_ECB_H__
@@ -12,9 +14,9 @@
namespace Botan {
-/*************************************************
-* ECB *
-*************************************************/
+/*
+* ECB
+*/
class BOTAN_DLL ECB : public BlockCipherMode
{
protected:
@@ -28,9 +30,9 @@ class BOTAN_DLL ECB : public BlockCipherMode
bool valid_iv_size(u32bit) const;
};
-/*************************************************
-* ECB Encryption *
-*************************************************/
+/*
+* ECB Encryption
+*/
class BOTAN_DLL ECB_Encryption : public ECB
{
public:
@@ -47,9 +49,9 @@ class BOTAN_DLL ECB_Encryption : public ECB
void end_msg();
};
-/*************************************************
-* ECB Decryption *
-*************************************************/
+/*
+* ECB Decryption
+*/
class BOTAN_DLL ECB_Decryption : public ECB
{
public: