aboutsummaryrefslogtreecommitdiffstats
path: root/src/block/misty1
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/misty1
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/misty1')
-rw-r--r--src/block/misty1/misty1.cpp40
-rw-r--r--src/block/misty1/misty1.h4
2 files changed, 24 insertions, 20 deletions
diff --git a/src/block/misty1/misty1.cpp b/src/block/misty1/misty1.cpp
index bac5e43eb..a35ff584d 100644
--- a/src/block/misty1/misty1.cpp
+++ b/src/block/misty1/misty1.cpp
@@ -1,7 +1,9 @@
-/*************************************************
-* MISTY1 Source File *
-* (C) 1999-2007 Jack Lloyd *
-*************************************************/
+/*
+* MISTY1
+* (C) 1999-2007 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
#include <botan/misty1.h>
#include <botan/loadstor.h>
@@ -83,9 +85,9 @@ static const u16bit MISTY1_SBOX_S9[512] = {
0x00BE, 0x0078, 0x0000, 0x00AC, 0x0110, 0x015E, 0x0124, 0x0002, 0x01BC,
0x00A2, 0x00EA, 0x0070, 0x01FC, 0x0116, 0x015C, 0x004C, 0x01C2 };
-/*************************************************
-* MISTY1 FI Function *
-*************************************************/
+/*
+* MISTY1 FI Function
+*/
u16bit FI(u16bit input, u16bit key7, u16bit key9)
{
u16bit D9 = input >> 7, D7 = input & 0x7F;
@@ -97,9 +99,9 @@ u16bit FI(u16bit input, u16bit key7, u16bit key9)
}
-/*************************************************
-* MISTY1 Encryption *
-*************************************************/
+/*
+* MISTY1 Encryption
+*/
void MISTY1::enc(const byte in[], byte out[]) const
{
u16bit B0 = load_be<u16bit>(in, 0);
@@ -141,9 +143,9 @@ void MISTY1::enc(const byte in[], byte out[]) const
store_be(out, B2, B3, B0, B1);
}
-/*************************************************
-* MISTY1 Decryption *
-*************************************************/
+/*
+* MISTY1 Decryption
+*/
void MISTY1::dec(const byte in[], byte out[]) const
{
u16bit B0 = load_be<u16bit>(in, 2);
@@ -185,9 +187,9 @@ void MISTY1::dec(const byte in[], byte out[]) const
store_be(out, B0, B1, B2, B3);
}
-/*************************************************
-* MISTY1 Key Schedule *
-*************************************************/
+/*
+* MISTY1 Key Schedule
+*/
void MISTY1::key_schedule(const byte key[], u32bit length)
{
SecureBuffer<u16bit, 32> KS;
@@ -234,9 +236,9 @@ void MISTY1::key_schedule(const byte key[], u32bit length)
}
}
-/*************************************************
-* MISTY1 Constructor *
-*************************************************/
+/*
+* MISTY1 Constructor
+*/
MISTY1::MISTY1(u32bit rounds) : BlockCipher(8, 16)
{
if(rounds != 8)
diff --git a/src/block/misty1/misty1.h b/src/block/misty1/misty1.h
index 8da93184f..62d4f856f 100644
--- a/src/block/misty1/misty1.h
+++ b/src/block/misty1/misty1.h
@@ -1,6 +1,8 @@
/**
-* MISTY1 Header File
+* MISTY1
* (C) 1999-2008 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
*/
#ifndef BOTAN_MISTY1_H__