diff options
author | lloyd <[email protected]> | 2009-03-30 18:27:18 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2009-03-30 18:27:18 +0000 |
commit | 96d6eb6f29c55e16a37cf11899547886f735b065 (patch) | |
tree | 9f13901e9b44c98d58b2589c9b09c6a7443eb7cd /src/block/kasumi | |
parent | 3cc3dd72c5f87b76852a55c1f2d1821dba967d8c (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/kasumi')
-rw-r--r-- | src/block/kasumi/kasumi.cpp | 40 | ||||
-rw-r--r-- | src/block/kasumi/kasumi.h | 16 |
2 files changed, 30 insertions, 26 deletions
diff --git a/src/block/kasumi/kasumi.cpp b/src/block/kasumi/kasumi.cpp index 4be6c41a8..3887271a9 100644 --- a/src/block/kasumi/kasumi.cpp +++ b/src/block/kasumi/kasumi.cpp @@ -1,7 +1,9 @@ -/************************************************* -* KASUMI Source File * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ +/* +* KASUMI +* (C) 1999-2007 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ #include <botan/kasumi.h> #include <botan/loadstor.h> @@ -11,9 +13,9 @@ namespace Botan { namespace { -/************************************************* -* KASUMI S-Boxes * -*************************************************/ +/* +* KASUMI S-Boxes +*/ const byte KASUMI_SBOX_S7[128] = { 0x36, 0x32, 0x3E, 0x38, 0x16, 0x22, 0x5E, 0x60, 0x26, 0x06, 0x3F, 0x5D, 0x02, 0x12, 0x7B, 0x21, 0x37, 0x71, 0x27, 0x72, 0x15, 0x43, 0x41, 0x0C, @@ -86,9 +88,9 @@ const u16bit KASUMI_SBOX_S9[512] = { 0x017C, 0x002B, 0x0042, 0x003C, 0x01C7, 0x0155, 0x01BD, 0x00CA, 0x01B0, 0x0008, 0x00ED, 0x000F, 0x0178, 0x01B4, 0x01D0, 0x003B, 0x01CD }; -/************************************************* -* KASUMI FI Function * -*************************************************/ +/* +* KASUMI FI Function +*/ u16bit FI(u16bit I, u16bit K) { u16bit D9 = (I >> 7); @@ -104,9 +106,9 @@ u16bit FI(u16bit I, u16bit K) } -/************************************************* -* KASUMI Encryption * -*************************************************/ +/* +* KASUMI Encryption +*/ void KASUMI::enc(const byte in[], byte out[]) const { u16bit B0 = load_be<u16bit>(in, 0); @@ -142,9 +144,9 @@ void KASUMI::enc(const byte in[], byte out[]) const store_be(out, B0, B1, B2, B3); } -/************************************************* -* KASUMI Decryption * -*************************************************/ +/* +* KASUMI Decryption +*/ void KASUMI::dec(const byte in[], byte out[]) const { u16bit B0 = load_be<u16bit>(in, 0); @@ -182,9 +184,9 @@ void KASUMI::dec(const byte in[], byte out[]) const store_be(out, B0, B1, B2, B3); } -/************************************************* -* KASUMI Key Schedule * -*************************************************/ +/* +* KASUMI Key Schedule +*/ void KASUMI::key_schedule(const byte key[], u32bit) { static const u16bit RC[] = { 0x0123, 0x4567, 0x89AB, 0xCDEF, diff --git a/src/block/kasumi/kasumi.h b/src/block/kasumi/kasumi.h index 27765e640..df49fa9eb 100644 --- a/src/block/kasumi/kasumi.h +++ b/src/block/kasumi/kasumi.h @@ -1,7 +1,9 @@ -/************************************************* -* KASUMI Header File * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ +/* +* KASUMI +* (C) 1999-2007 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ #ifndef BOTAN_KASUMI_H__ #define BOTAN_KASUMI_H__ @@ -10,9 +12,9 @@ namespace Botan { -/************************************************* -* KASUMI * -*************************************************/ +/* +* KASUMI +*/ class BOTAN_DLL KASUMI : public BlockCipher { public: |