aboutsummaryrefslogtreecommitdiffstats
path: root/src/block/safer
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/safer
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/safer')
-rw-r--r--src/block/safer/safe_tab.cpp10
-rw-r--r--src/block/safer/safer_sk.cpp46
-rw-r--r--src/block/safer/safer_sk.h16
3 files changed, 39 insertions, 33 deletions
diff --git a/src/block/safer/safe_tab.cpp b/src/block/safer/safe_tab.cpp
index 06de7fa49..e265a40eb 100644
--- a/src/block/safer/safe_tab.cpp
+++ b/src/block/safer/safe_tab.cpp
@@ -1,7 +1,9 @@
-/*************************************************
-* S-Box Tables for SAFER-SK *
-* (C) 1999-2007 Jack Lloyd *
-*************************************************/
+/*
+* S-Box Tables for SAFER-SK
+* (C) 1999-2007 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
#include <botan/safer_sk.h>
diff --git a/src/block/safer/safer_sk.cpp b/src/block/safer/safer_sk.cpp
index 00e57e2a4..b774c91b4 100644
--- a/src/block/safer/safer_sk.cpp
+++ b/src/block/safer/safer_sk.cpp
@@ -1,7 +1,9 @@
-/*************************************************
-* SAFER-SK Source File *
-* (C) 1999-2007 Jack Lloyd *
-*************************************************/
+/*
+* SAFER-SK
+* (C) 1999-2007 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
#include <botan/safer_sk.h>
#include <botan/bit_ops.h>
@@ -10,9 +12,9 @@
namespace Botan {
-/*************************************************
-* SAFER-SK Encryption *
-*************************************************/
+/*
+* SAFER-SK Encryption
+*/
void SAFER_SK::enc(const byte in[], byte out[]) const
{
byte A = in[0], B = in[1], C = in[2], D = in[3],
@@ -36,9 +38,9 @@ void SAFER_SK::enc(const byte in[], byte out[]) const
out[6] = G + EK[16*ROUNDS+6]; out[7] = H ^ EK[16*ROUNDS+7];
}
-/*************************************************
-* SAFER-SK Decryption *
-*************************************************/
+/*
+* SAFER-SK Decryption
+*/
void SAFER_SK::dec(const byte in[], byte out[]) const
{
byte A = in[0], B = in[1], C = in[2], D = in[3],
@@ -63,9 +65,9 @@ void SAFER_SK::dec(const byte in[], byte out[]) const
out[4] = E; out[5] = F; out[6] = G; out[7] = H;
}
-/*************************************************
-* SAFER-SK Key Schedule *
-*************************************************/
+/*
+* SAFER-SK Key Schedule
+*/
void SAFER_SK::key_schedule(const byte key[], u32bit)
{
SecureBuffer<byte, 18> KB;
@@ -84,25 +86,25 @@ void SAFER_SK::key_schedule(const byte key[], u32bit)
}
}
-/*************************************************
-* Return the name of this type *
-*************************************************/
+/*
+* Return the name of this type
+*/
std::string SAFER_SK::name() const
{
return "SAFER-SK(" + to_string(ROUNDS) + ")";
}
-/*************************************************
-* Return a clone of this object *
-*************************************************/
+/*
+* Return a clone of this object
+*/
BlockCipher* SAFER_SK::clone() const
{
return new SAFER_SK(ROUNDS);
}
-/*************************************************
-* SAFER-SK Constructor *
-*************************************************/
+/*
+* SAFER-SK Constructor
+*/
SAFER_SK::SAFER_SK(u32bit rounds) : BlockCipher(8, 16),
EK(16 * rounds + 8), ROUNDS(rounds)
{
diff --git a/src/block/safer/safer_sk.h b/src/block/safer/safer_sk.h
index 0db32e20f..e52c5837c 100644
--- a/src/block/safer/safer_sk.h
+++ b/src/block/safer/safer_sk.h
@@ -1,7 +1,9 @@
-/*************************************************
-* SAFER-SK Header File *
-* (C) 1999-2007 Jack Lloyd *
-*************************************************/
+/*
+* SAFER-SK
+* (C) 1999-2007 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
#ifndef BOTAN_SAFER_SK_H__
#define BOTAN_SAFER_SK_H__
@@ -10,9 +12,9 @@
namespace Botan {
-/*************************************************
-* SAFER-SK *
-*************************************************/
+/*
+* SAFER-SK
+*/
class BOTAN_DLL SAFER_SK : public BlockCipher
{
public: