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/stream/turing | |
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/stream/turing')
-rw-r--r-- | src/stream/turing/tur_tab.cpp | 10 | ||||
-rw-r--r-- | src/stream/turing/turing.cpp | 58 | ||||
-rw-r--r-- | src/stream/turing/turing.h | 16 |
3 files changed, 45 insertions, 39 deletions
diff --git a/src/stream/turing/tur_tab.cpp b/src/stream/turing/tur_tab.cpp index 8162a999e..a2edd5a5e 100644 --- a/src/stream/turing/tur_tab.cpp +++ b/src/stream/turing/tur_tab.cpp @@ -1,7 +1,9 @@ -/************************************************* -* Tables for Turing * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ +/* +* Tables for Turing +* (C) 1999-2007 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ #include <botan/turing.h> diff --git a/src/stream/turing/turing.cpp b/src/stream/turing/turing.cpp index bdf320364..b988568c3 100644 --- a/src/stream/turing/turing.cpp +++ b/src/stream/turing/turing.cpp @@ -1,7 +1,9 @@ -/************************************************* -* Turing Source File * -* (C) 1999-2008 Jack Lloyd * -*************************************************/ +/* +* Turing +* (C) 1999-2008 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ #include <botan/turing.h> #include <botan/loadstor.h> @@ -11,9 +13,9 @@ namespace Botan { namespace { -/************************************************* -* Perform an N-way PHT * -*************************************************/ +/* +* Perform an N-way PHT +*/ inline void PHT(MemoryRegion<u32bit>& buf) { u32bit sum = 0; @@ -27,9 +29,9 @@ inline void PHT(MemoryRegion<u32bit>& buf) } -/************************************************* -* Combine cipher stream with message * -*************************************************/ +/* +* Combine cipher stream with message +*/ void Turing::cipher(const byte in[], byte out[], u32bit length) { while(length >= buffer.size() - position) @@ -44,9 +46,9 @@ void Turing::cipher(const byte in[], byte out[], u32bit length) position += length; } -/************************************************* -* Generate cipher stream * -*************************************************/ +/* +* Generate cipher stream +*/ void Turing::generate() { // Table for Turing's polynomial multiplication @@ -200,9 +202,9 @@ void Turing::generate() position = 0; } -/************************************************* -* Turing's byte mixing step * -*************************************************/ +/* +* Turing's byte mixing step +*/ u32bit Turing::fixedS(u32bit W) { for(u32bit j = 0; j != 4; ++j) @@ -215,9 +217,9 @@ u32bit Turing::fixedS(u32bit W) return W; } -/************************************************* -* Generate the expanded Turing Sbox tables * -*************************************************/ +/* +* Generate the expanded Turing Sbox tables +*/ void Turing::gen_sbox(MemoryRegion<u32bit>& S, u32bit which, const MemoryRegion<u32bit>& K) { @@ -234,9 +236,9 @@ void Turing::gen_sbox(MemoryRegion<u32bit>& S, u32bit which, } } -/************************************************* -* Turing Key Schedule * -*************************************************/ +/* +* Turing Key Schedule +*/ void Turing::key_schedule(const byte key[], u32bit length) { K.create(length / 4); @@ -256,9 +258,9 @@ void Turing::key_schedule(const byte key[], u32bit length) resync(0, 0); } -/************************************************* -* Resynchronization * -*************************************************/ +/* +* Resynchronization +*/ void Turing::resync(const byte iv[], u32bit length) { if(length % 4 != 0 || length > 16) @@ -288,9 +290,9 @@ void Turing::resync(const byte iv[], u32bit length) generate(); } -/************************************************* -* Clear memory of sensitive data * -*************************************************/ +/* +* Clear memory of sensitive data +*/ void Turing::clear() throw() { S0.clear(); diff --git a/src/stream/turing/turing.h b/src/stream/turing/turing.h index 018196fd3..d48c1d8a8 100644 --- a/src/stream/turing/turing.h +++ b/src/stream/turing/turing.h @@ -1,7 +1,9 @@ -/************************************************* -* Turing Header File * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ +/* +* Turing +* (C) 1999-2007 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ #ifndef BOTAN_TURING_H__ #define BOTAN_TURING_H__ @@ -10,9 +12,9 @@ namespace Botan { -/************************************************* -* Turing * -*************************************************/ +/* +* Turing +*/ class BOTAN_DLL Turing : public StreamCipher { public: |