aboutsummaryrefslogtreecommitdiffstats
path: root/src/block/square
diff options
context:
space:
mode:
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: