aboutsummaryrefslogtreecommitdiffstats
path: root/src/block/square
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/block/square
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/block/square')
-rw-r--r--src/block/square/sqr_tab.cpp10
-rw-r--r--src/block/square/square.cpp40
-rw-r--r--src/block/square/square.h16
3 files changed, 36 insertions, 30 deletions
diff --git a/src/block/square/sqr_tab.cpp b/src/block/square/sqr_tab.cpp
index 248ace4cd..331bf3ea1 100644
--- a/src/block/square/sqr_tab.cpp
+++ b/src/block/square/sqr_tab.cpp
@@ -1,7 +1,9 @@
-/*************************************************
-* S-Box and Diffusion Tables for Square *
-* (C) 1999-2007 Jack Lloyd *
-*************************************************/
+/*
+* S-Box and Diffusion Tables for Square
+* (C) 1999-2007 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
#include <botan/square.h>
diff --git a/src/block/square/square.cpp b/src/block/square/square.cpp
index 44fb26bfd..5aaef6ee4 100644
--- a/src/block/square/square.cpp
+++ b/src/block/square/square.cpp
@@ -1,7 +1,9 @@
-/*************************************************
-* Square Source File *
-* (C) 1999-2007 Jack Lloyd *
-*************************************************/
+/*
+* Square
+* (C) 1999-2007 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
#include <botan/square.h>
#include <botan/loadstor.h>
@@ -9,9 +11,9 @@
namespace Botan {
-/*************************************************
-* Square Encryption *
-*************************************************/
+/*
+* Square Encryption
+*/
void Square::enc(const byte in[], byte out[]) const
{
u32bit T0, T1, T2, T3, B0, B1, B2, B3;
@@ -60,9 +62,9 @@ void Square::enc(const byte in[], byte out[]) const
out[15] = SE[get_byte(3, B3)] ^ ME[31];
}
-/*************************************************
-* Square Decryption *
-*************************************************/
+/*
+* Square Decryption
+*/
void Square::dec(const byte in[], byte out[]) const
{
u32bit T0, T1, T2, T3, B0, B1, B2, B3;
@@ -111,9 +113,9 @@ void Square::dec(const byte in[], byte out[]) const
out[15] = SD[get_byte(3, B3)] ^ MD[31];
}
-/*************************************************
-* Square Key Schedule *
-*************************************************/
+/*
+* Square Key Schedule
+*/
void Square::key_schedule(const byte key[], u32bit)
{
SecureBuffer<u32bit, 36> XEK, XDK;
@@ -140,9 +142,9 @@ void Square::key_schedule(const byte key[], u32bit)
DK.copy(XDK + 4, 28);
}
-/*************************************************
-* Square's Inverse Linear Transformation *
-*************************************************/
+/*
+* Square's Inverse Linear Transformation
+*/
void Square::transform(u32bit round_key[4])
{
static const byte G[4][4] = {
@@ -171,9 +173,9 @@ void Square::transform(u32bit round_key[4])
}
}
-/*************************************************
-* Clear memory of sensitive data *
-*************************************************/
+/*
+* Clear memory of sensitive data
+*/
void Square::clear() throw()
{
EK.clear();
diff --git a/src/block/square/square.h b/src/block/square/square.h
index 4c4d89100..94a1fc370 100644
--- a/src/block/square/square.h
+++ b/src/block/square/square.h
@@ -1,7 +1,9 @@
-/*************************************************
-* Square Header File *
-* (C) 1999-2007 Jack Lloyd *
-*************************************************/
+/*
+* Square
+* (C) 1999-2007 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
#ifndef BOTAN_SQUARE_H__
#define BOTAN_SQUARE_H__
@@ -10,9 +12,9 @@
namespace Botan {
-/*************************************************
-* Square *
-*************************************************/
+/*
+* Square
+*/
class BOTAN_DLL Square : public BlockCipher
{
public: