aboutsummaryrefslogtreecommitdiffstats
path: root/src/block/noekeon/noekeon.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/block/noekeon/noekeon.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/block/noekeon/noekeon.cpp')
-rw-r--r--src/block/noekeon/noekeon.cpp58
1 files changed, 30 insertions, 28 deletions
diff --git a/src/block/noekeon/noekeon.cpp b/src/block/noekeon/noekeon.cpp
index 1a783b432..256744b22 100644
--- a/src/block/noekeon/noekeon.cpp
+++ b/src/block/noekeon/noekeon.cpp
@@ -1,7 +1,9 @@
-/*************************************************
-* Noekeon Source File *
-* (C) 1999-2008 Jack Lloyd *
-*************************************************/
+/*
+* Noekeon
+* (C) 1999-2008 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
#include <botan/noekeon.h>
#include <botan/loadstor.h>
@@ -11,9 +13,9 @@ namespace Botan {
namespace {
-/*************************************************
-* Noekeon's Theta Operation *
-*************************************************/
+/*
+* Noekeon's Theta Operation
+*/
inline void theta(u32bit& A0, u32bit& A1,
u32bit& A2, u32bit& A3,
const u32bit EK[4])
@@ -34,9 +36,9 @@ inline void theta(u32bit& A0, u32bit& A1,
A2 ^= T;
}
-/*************************************************
-* Theta With Null Key *
-*************************************************/
+/*
+* Theta With Null Key
+*/
inline void theta(u32bit& A0, u32bit& A1,
u32bit& A2, u32bit& A3)
{
@@ -51,9 +53,9 @@ inline void theta(u32bit& A0, u32bit& A1,
A2 ^= T;
}
-/*************************************************
-* Noekeon's Gamma S-Box Layer *
-*************************************************/
+/*
+* Noekeon's Gamma S-Box Layer
+*/
inline void gamma(u32bit& A0, u32bit& A1, u32bit& A2, u32bit& A3)
{
A1 ^= ~A3 & ~A2;
@@ -71,17 +73,17 @@ inline void gamma(u32bit& A0, u32bit& A1, u32bit& A2, u32bit& A3)
}
-/*************************************************
-* Noekeon Round Constants *
-*************************************************/
+/*
+* Noekeon Round Constants
+*/
const byte Noekeon::RC[] = {
0x80, 0x1B, 0x36, 0x6C, 0xD8, 0xAB, 0x4D, 0x9A,
0x2F, 0x5E, 0xBC, 0x63, 0xC6, 0x97, 0x35, 0x6A,
0xD4 };
-/*************************************************
-* Noekeon Encryption *
-*************************************************/
+/*
+* Noekeon Encryption
+*/
void Noekeon::enc(const byte in[], byte out[]) const
{
u32bit A0 = load_be<u32bit>(in, 0);
@@ -111,9 +113,9 @@ void Noekeon::enc(const byte in[], byte out[]) const
store_be(out, A0, A1, A2, A3);
}
-/*************************************************
-* Noekeon Encryption *
-*************************************************/
+/*
+* Noekeon Encryption
+*/
void Noekeon::dec(const byte in[], byte out[]) const
{
u32bit A0 = load_be<u32bit>(in, 0);
@@ -143,9 +145,9 @@ void Noekeon::dec(const byte in[], byte out[]) const
store_be(out, A0, A1, A2, A3);
}
-/*************************************************
-* Noekeon Key Schedule *
-*************************************************/
+/*
+* Noekeon Key Schedule
+*/
void Noekeon::key_schedule(const byte key[], u32bit)
{
u32bit A0 = load_be<u32bit>(key, 0);
@@ -184,9 +186,9 @@ void Noekeon::key_schedule(const byte key[], u32bit)
EK[3] = A3;
}
-/*************************************************
-* Clear memory of sensitive data *
-*************************************************/
+/*
+* Clear memory of sensitive data
+*/
void Noekeon::clear() throw()
{
EK.clear();