aboutsummaryrefslogtreecommitdiffstats
path: root/src/block/mars
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/mars
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/mars')
-rw-r--r--src/block/mars/mars.cpp58
-rw-r--r--src/block/mars/mars.h10
-rw-r--r--src/block/mars/mars_tab.cpp10
3 files changed, 42 insertions, 36 deletions
diff --git a/src/block/mars/mars.cpp b/src/block/mars/mars.cpp
index 5f93f2df4..7c3906ecf 100644
--- a/src/block/mars/mars.cpp
+++ b/src/block/mars/mars.cpp
@@ -1,7 +1,9 @@
-/*************************************************
-* MARS Source File *
-* (C) 1999-2007 Jack Lloyd *
-*************************************************/
+/*
+* MARS
+* (C) 1999-2007 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
#include <botan/mars.h>
#include <botan/loadstor.h>
@@ -11,9 +13,9 @@ namespace Botan {
namespace {
-/*************************************************
-* Generate a mask for runs of bits *
-*************************************************/
+/*
+* Generate a mask for runs of bits
+*/
u32bit gen_mask(u32bit input)
{
u32bit mask = 0;
@@ -45,9 +47,9 @@ u32bit gen_mask(u32bit input)
}
-/*************************************************
-* MARS Encryption *
-*************************************************/
+/*
+* MARS Encryption
+*/
void MARS::enc(const byte in[], byte out[]) const
{
u32bit A = load_le<u32bit>(in, 0) + EK[0];
@@ -82,9 +84,9 @@ void MARS::enc(const byte in[], byte out[]) const
store_le(out, A, B, C, D);
}
-/*************************************************
-* MARS Decryption *
-*************************************************/
+/*
+* MARS Decryption
+*/
void MARS::dec(const byte in[], byte out[]) const
{
u32bit A = load_le<u32bit>(in, 3) + EK[39];
@@ -119,9 +121,9 @@ void MARS::dec(const byte in[], byte out[]) const
store_le(out, D, C, B, A);
}
-/*************************************************
-* MARS Forward Mixing Operation *
-*************************************************/
+/*
+* MARS Forward Mixing Operation
+*/
void MARS::forward_mix(u32bit& A, u32bit& B, u32bit& C, u32bit& D)
{
for(u32bit j = 0; j != 2; ++j)
@@ -144,9 +146,9 @@ void MARS::forward_mix(u32bit& A, u32bit& B, u32bit& C, u32bit& D)
}
}
-/*************************************************
-* MARS Reverse Mixing Operation *
-*************************************************/
+/*
+* MARS Reverse Mixing Operation
+*/
void MARS::reverse_mix(u32bit& A, u32bit& B, u32bit& C, u32bit& D)
{
for(u32bit j = 0; j != 2; ++j)
@@ -170,9 +172,9 @@ void MARS::reverse_mix(u32bit& A, u32bit& B, u32bit& C, u32bit& D)
}
}
-/*************************************************
-* MARS Encryption Round *
-*************************************************/
+/*
+* MARS Encryption Round
+*/
void MARS::encrypt_round(u32bit& A, u32bit& B, u32bit& C, u32bit& D,
u32bit round) const
{
@@ -190,9 +192,9 @@ void MARS::encrypt_round(u32bit& A, u32bit& B, u32bit& C, u32bit& D,
B += rotate_left(Z, Y % 32);
}
-/*************************************************
-* MARS Decryption Round *
-*************************************************/
+/*
+* MARS Decryption Round
+*/
void MARS::decrypt_round(u32bit& A, u32bit& B, u32bit& C, u32bit& D,
u32bit round) const
{
@@ -210,9 +212,9 @@ void MARS::decrypt_round(u32bit& A, u32bit& B, u32bit& C, u32bit& D,
B -= rotate_left(Z, Y % 32);
}
-/*************************************************
-* MARS Key Schedule *
-*************************************************/
+/*
+* MARS Key Schedule
+*/
void MARS::key_schedule(const byte key[], u32bit length)
{
SecureBuffer<u32bit, 15> T;
diff --git a/src/block/mars/mars.h b/src/block/mars/mars.h
index 44f581549..ca49695af 100644
--- a/src/block/mars/mars.h
+++ b/src/block/mars/mars.h
@@ -1,7 +1,9 @@
-/*************************************************
-* MARS Header File *
-* (C) 1999-2007 Jack Lloyd *
-*************************************************/
+/*
+* MARS
+* (C) 1999-2007 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
#ifndef BOTAN_MARS_H__
#define BOTAN_MARS_H__
diff --git a/src/block/mars/mars_tab.cpp b/src/block/mars/mars_tab.cpp
index 07381e9cb..fb8f34542 100644
--- a/src/block/mars/mars_tab.cpp
+++ b/src/block/mars/mars_tab.cpp
@@ -1,7 +1,9 @@
-/*************************************************
-* S-Box Table for MARS *
-* (C) 1999-2007 Jack Lloyd *
-*************************************************/
+/*
+* S-Box Table for MARS
+* (C) 1999-2007 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
#include <botan/mars.h>