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/skipjack | |
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/skipjack')
-rw-r--r-- | src/block/skipjack/skipjack.cpp | 58 | ||||
-rw-r--r-- | src/block/skipjack/skipjack.h | 16 |
2 files changed, 39 insertions, 35 deletions
diff --git a/src/block/skipjack/skipjack.cpp b/src/block/skipjack/skipjack.cpp index 62918a3fd..f5ffc861e 100644 --- a/src/block/skipjack/skipjack.cpp +++ b/src/block/skipjack/skipjack.cpp @@ -1,16 +1,18 @@ -/************************************************* -* Skipjack Source File * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ +/* +* Skipjack +* (C) 1999-2007 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ #include <botan/skipjack.h> #include <botan/loadstor.h> namespace Botan { -/************************************************* -* Skipjack Encryption * -*************************************************/ +/* +* Skipjack Encryption +*/ void Skipjack::enc(const byte in[], byte out[]) const { u16bit W1 = load_le<u16bit>(in, 3); @@ -33,9 +35,9 @@ void Skipjack::enc(const byte in[], byte out[]) const store_le(out, W4, W3, W2, W1); } -/************************************************* -* Skipjack Decryption * -*************************************************/ +/* +* Skipjack Decryption +*/ void Skipjack::dec(const byte in[], byte out[]) const { u16bit W1 = load_le<u16bit>(in, 3); @@ -58,9 +60,9 @@ void Skipjack::dec(const byte in[], byte out[]) const store_le(out, W4, W3, W2, W1); } -/************************************************* -* Skipjack Stepping Rule 'A' * -*************************************************/ +/* +* Skipjack Stepping Rule 'A' +*/ void Skipjack::step_A(u16bit& W1, u16bit& W4, u32bit round) const { byte G1 = get_byte(0, W1), G2 = get_byte(1, W1), G3; @@ -72,9 +74,9 @@ void Skipjack::step_A(u16bit& W1, u16bit& W4, u32bit round) const W4 ^= W1 ^ round; } -/************************************************* -* Skipjack Stepping Rule 'B' * -*************************************************/ +/* +* Skipjack Stepping Rule 'B' +*/ void Skipjack::step_B(u16bit& W1, u16bit& W2, u32bit round) const { W2 ^= W1 ^ round; @@ -86,9 +88,9 @@ void Skipjack::step_B(u16bit& W1, u16bit& W2, u32bit round) const W1 = make_u16bit(G2, G3); } -/************************************************* -* Skipjack Invserse Stepping Rule 'A' * -*************************************************/ +/* +* Skipjack Invserse Stepping Rule 'A' +*/ void Skipjack::step_Ai(u16bit& W1, u16bit& W2, u32bit round) const { W1 ^= W2 ^ round; @@ -100,9 +102,9 @@ void Skipjack::step_Ai(u16bit& W1, u16bit& W2, u32bit round) const W2 = make_u16bit(G3, G2); } -/************************************************* -* Skipjack Invserse Stepping Rule 'B' * -*************************************************/ +/* +* Skipjack Invserse Stepping Rule 'B' +*/ void Skipjack::step_Bi(u16bit& W2, u16bit& W3, u32bit round) const { byte G1 = get_byte(1, W2), G2 = get_byte(0, W2), G3; @@ -114,9 +116,9 @@ void Skipjack::step_Bi(u16bit& W2, u16bit& W3, u32bit round) const W3 ^= W2 ^ round; } -/************************************************* -* Skipjack Key Schedule * -*************************************************/ +/* +* Skipjack Key Schedule +*/ void Skipjack::key_schedule(const byte key[], u32bit) { static const byte F[256] = { @@ -148,9 +150,9 @@ void Skipjack::key_schedule(const byte key[], u32bit) FTABLE[j][k] = F[k ^ key[9-j]]; } -/************************************************* -* Clear memory of sensitive data * -*************************************************/ +/* +* Clear memory of sensitive data +*/ void Skipjack::clear() throw() { for(u32bit j = 0; j != 10; ++j) diff --git a/src/block/skipjack/skipjack.h b/src/block/skipjack/skipjack.h index 2d8956215..231cd9c87 100644 --- a/src/block/skipjack/skipjack.h +++ b/src/block/skipjack/skipjack.h @@ -1,7 +1,9 @@ -/************************************************* -* Skipjack Header File * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ +/* +* Skipjack +* (C) 1999-2007 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ #ifndef BOTAN_SKIPJACK_H__ #define BOTAN_SKIPJACK_H__ @@ -10,9 +12,9 @@ namespace Botan { -/************************************************* -* Skipjack * -*************************************************/ +/* +* Skipjack +*/ class BOTAN_DLL Skipjack : public BlockCipher { public: |