From 96d6eb6f29c55e16a37cf11899547886f735b065 Mon Sep 17 00:00:00 2001 From: lloyd Date: Mon, 30 Mar 2009 18:27:18 +0000 Subject: 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). --- src/stream/arc4/arc4.cpp | 46 ++++++++++++++++--------------- src/stream/arc4/arc4.h | 16 ++++++----- src/stream/salsa20/salsa20.cpp | 52 ++++++++++++++++++----------------- src/stream/salsa20/salsa20.h | 16 ++++++----- src/stream/stream_cipher.cpp | 14 +++++----- src/stream/stream_cipher.h | 8 +++--- src/stream/turing/tur_tab.cpp | 10 ++++--- src/stream/turing/turing.cpp | 58 +++++++++++++++++++++------------------- src/stream/turing/turing.h | 16 ++++++----- src/stream/wid_wake/wid_wake.cpp | 40 ++++++++++++++------------- src/stream/wid_wake/wid_wake.h | 16 ++++++----- 11 files changed, 157 insertions(+), 135 deletions(-) (limited to 'src/stream') diff --git a/src/stream/arc4/arc4.cpp b/src/stream/arc4/arc4.cpp index f422582cc..0f78f7362 100644 --- a/src/stream/arc4/arc4.cpp +++ b/src/stream/arc4/arc4.cpp @@ -1,7 +1,9 @@ -/************************************************* -* ARC4 Source File * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ +/* +* ARC4 +* (C) 1999-2007 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ #include #include @@ -9,9 +11,9 @@ namespace Botan { -/************************************************* -* Combine cipher stream with message * -*************************************************/ +/* +* Combine cipher stream with message +*/ void ARC4::cipher(const byte in[], byte out[], u32bit length) { while(length >= buffer.size() - position) @@ -26,9 +28,9 @@ void ARC4::cipher(const byte in[], byte out[], u32bit length) position += length; } -/************************************************* -* Generate cipher stream * -*************************************************/ +/* +* Generate cipher stream +*/ void ARC4::generate() { u32bit SX, SY; @@ -54,9 +56,9 @@ void ARC4::generate() position = 0; } -/************************************************* -* ARC4 Key Schedule * -*************************************************/ +/* +* ARC4 Key Schedule +*/ void ARC4::key_schedule(const byte key[], u32bit length) { clear(); @@ -72,9 +74,9 @@ void ARC4::key_schedule(const byte key[], u32bit length) position += (SKIP % buffer.size()); } -/************************************************* -* Return the name of this type * -*************************************************/ +/* +* Return the name of this type +*/ std::string ARC4::name() const { if(SKIP == 0) return "ARC4"; @@ -82,9 +84,9 @@ std::string ARC4::name() const else return "RC4_skip(" + to_string(SKIP) + ")"; } -/************************************************* -* Clear memory of sensitive data * -*************************************************/ +/* +* Clear memory of sensitive data +*/ void ARC4::clear() throw() { state.clear(); @@ -92,9 +94,9 @@ void ARC4::clear() throw() position = X = Y = 0; } -/************************************************* -* ARC4 Constructor * -*************************************************/ +/* +* ARC4 Constructor +*/ ARC4::ARC4(u32bit s) : StreamCipher(1, 256), SKIP(s) { clear(); diff --git a/src/stream/arc4/arc4.h b/src/stream/arc4/arc4.h index d399e2144..aa2cea7fe 100644 --- a/src/stream/arc4/arc4.h +++ b/src/stream/arc4/arc4.h @@ -1,7 +1,9 @@ -/************************************************* -* ARC4 Header File * -* (C) 1999-2008 Jack Lloyd * -*************************************************/ +/* +* ARC4 +* (C) 1999-2008 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ #ifndef BOTAN_ARC4_H__ #define BOTAN_ARC4_H__ @@ -11,9 +13,9 @@ namespace Botan { -/************************************************* -* ARC4 * -*************************************************/ +/* +* ARC4 +*/ class BOTAN_DLL ARC4 : public StreamCipher { public: diff --git a/src/stream/salsa20/salsa20.cpp b/src/stream/salsa20/salsa20.cpp index e6a190fc3..75137798c 100644 --- a/src/stream/salsa20/salsa20.cpp +++ b/src/stream/salsa20/salsa20.cpp @@ -1,7 +1,9 @@ -/************************************************* -* Salsa20 Source File * -* (C) 1999-2008 Jack Lloyd * -*************************************************/ +/* +* Salsa20 +* (C) 1999-2008 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ #include #include @@ -13,9 +15,9 @@ namespace Botan { namespace { -/************************************************* -* Generate Salsa20 cipher stream * -*************************************************/ +/* +* Generate Salsa20 cipher stream +*/ void salsa20(byte output[64], const u32bit input[16]) { u32bit x00 = input[0]; @@ -92,9 +94,9 @@ void salsa20(byte output[64], const u32bit input[16]) } -/************************************************* -* Combine cipher stream with message * -*************************************************/ +/* +* Combine cipher stream with message +*/ void Salsa20::cipher(const byte in[], byte out[], u32bit length) { while(length >= buffer.size() - position) @@ -117,9 +119,9 @@ void Salsa20::cipher(const byte in[], byte out[], u32bit length) position += length; } -/************************************************* -* Salsa20 Key Schedule * -*************************************************/ +/* +* Salsa20 Key Schedule +*/ void Salsa20::key_schedule(const byte key[], u32bit length) { static const u32bit TAU[] = @@ -165,9 +167,9 @@ void Salsa20::key_schedule(const byte key[], u32bit length) resync(ZERO, sizeof(ZERO)); } -/************************************************* -* Return the name of this type * -*************************************************/ +/* +* Return the name of this type +*/ void Salsa20::resync(const byte iv[], u32bit length) { if(length != IV_LENGTH) @@ -186,17 +188,17 @@ void Salsa20::resync(const byte iv[], u32bit length) position = 0; } -/************************************************* -* Return the name of this type * -*************************************************/ +/* +* Return the name of this type +*/ std::string Salsa20::name() const { return "Salsa20"; } -/************************************************* -* Clear memory of sensitive data * -*************************************************/ +/* +* Clear memory of sensitive data +*/ void Salsa20::clear() throw() { state.clear(); @@ -204,9 +206,9 @@ void Salsa20::clear() throw() position = 0; } -/************************************************* -* Salsa20 Constructor * -*************************************************/ +/* +* Salsa20 Constructor +*/ Salsa20::Salsa20() : StreamCipher(16, 32, 16, 8) { clear(); diff --git a/src/stream/salsa20/salsa20.h b/src/stream/salsa20/salsa20.h index d40b84cfc..3dbfddb50 100644 --- a/src/stream/salsa20/salsa20.h +++ b/src/stream/salsa20/salsa20.h @@ -1,7 +1,9 @@ -/************************************************* -* Salsa20 Header File * -* (C) 1999-2008 Jack Lloyd * -*************************************************/ +/* +* Salsa20 +* (C) 1999-2008 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ #ifndef BOTAN_SALSA20_H__ #define BOTAN_SALSA20_H__ @@ -10,9 +12,9 @@ namespace Botan { -/************************************************* -* Salsa20 * -*************************************************/ +/* +* Salsa20 +*/ class BOTAN_DLL Salsa20 : public StreamCipher { public: diff --git a/src/stream/stream_cipher.cpp b/src/stream/stream_cipher.cpp index 04bb54484..68bb5d4f0 100644 --- a/src/stream/stream_cipher.cpp +++ b/src/stream/stream_cipher.cpp @@ -1,15 +1,17 @@ /** * Stream Cipher Default Implementation for IV and Seek * (C) 1999-2007 Jack Lloyd +* +* Distributed under the terms of the Botan license */ #include namespace Botan { -/************************************************* -* Default StreamCipher Resync Operation * -*************************************************/ +/* +* Default StreamCipher Resync Operation +*/ void StreamCipher::resync(const byte[], u32bit length) { if(length) @@ -17,9 +19,9 @@ void StreamCipher::resync(const byte[], u32bit length) " does not support resyncronization"); } -/************************************************* -* Default StreamCipher Seek Operation * -*************************************************/ +/* +* Default StreamCipher Seek Operation +*/ void StreamCipher::seek(u32bit) { throw Exception("The stream cipher " + name() + " does not support seek()"); diff --git a/src/stream/stream_cipher.h b/src/stream/stream_cipher.h index 9934fd987..8ea359131 100644 --- a/src/stream/stream_cipher.h +++ b/src/stream/stream_cipher.h @@ -1,6 +1,8 @@ /** * Stream Cipher * (C) 1999-2007 Jack Lloyd +* +* Distributed under the terms of the Botan license */ #ifndef BOTAN_STREAM_CIPHER_H__ @@ -10,9 +12,9 @@ namespace Botan { -/************************************************* -* Stream Cipher * -*************************************************/ +/* +* Stream Cipher +*/ class BOTAN_DLL StreamCipher : public SymmetricAlgorithm { public: 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 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 #include @@ -11,9 +13,9 @@ namespace Botan { namespace { -/************************************************* -* Perform an N-way PHT * -*************************************************/ +/* +* Perform an N-way PHT +*/ inline void PHT(MemoryRegion& buf) { u32bit sum = 0; @@ -27,9 +29,9 @@ inline void PHT(MemoryRegion& 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& S, u32bit which, const MemoryRegion& K) { @@ -234,9 +236,9 @@ void Turing::gen_sbox(MemoryRegion& 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: diff --git a/src/stream/wid_wake/wid_wake.cpp b/src/stream/wid_wake/wid_wake.cpp index c14652c54..1dc0fd7f9 100644 --- a/src/stream/wid_wake/wid_wake.cpp +++ b/src/stream/wid_wake/wid_wake.cpp @@ -1,7 +1,9 @@ -/************************************************* -* WiderWake Source File * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ +/* +* WiderWake +* (C) 1999-2007 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ #include #include @@ -9,9 +11,9 @@ namespace Botan { -/************************************************* -* Combine cipher stream with message * -*************************************************/ +/* +* Combine cipher stream with message +*/ void WiderWake_41_BE::cipher(const byte in[], byte out[], u32bit length) { while(length >= buffer.size() - position) @@ -26,9 +28,9 @@ void WiderWake_41_BE::cipher(const byte in[], byte out[], u32bit length) position += length; } -/************************************************* -* Generate cipher stream * -*************************************************/ +/* +* Generate cipher stream +*/ void WiderWake_41_BE::generate(u32bit length) { u32bit R0 = state[0], R1 = state[1], @@ -67,9 +69,9 @@ void WiderWake_41_BE::generate(u32bit length) position = 0; } -/************************************************* -* WiderWake Key Schedule * -*************************************************/ +/* +* WiderWake Key Schedule +*/ void WiderWake_41_BE::key_schedule(const byte key[], u32bit) { for(u32bit j = 0; j != 4; ++j) @@ -112,9 +114,9 @@ void WiderWake_41_BE::key_schedule(const byte key[], u32bit) resync(iv, 8); } -/************************************************* -* Resynchronization * -*************************************************/ +/* +* Resynchronization +*/ void WiderWake_41_BE::resync(const byte iv[], u32bit length) { if(length != 8) @@ -130,9 +132,9 @@ void WiderWake_41_BE::resync(const byte iv[], u32bit length) generate(buffer.size()); } -/************************************************* -* Clear memory of sensitive data * -*************************************************/ +/* +* Clear memory of sensitive data +*/ void WiderWake_41_BE::clear() throw() { position = 0; diff --git a/src/stream/wid_wake/wid_wake.h b/src/stream/wid_wake/wid_wake.h index d73eee2d5..4720afdb2 100644 --- a/src/stream/wid_wake/wid_wake.h +++ b/src/stream/wid_wake/wid_wake.h @@ -1,7 +1,9 @@ -/************************************************* -* WiderWake Header File * -* (C) 1999-2008 Jack Lloyd * -*************************************************/ +/* +* WiderWake +* (C) 1999-2008 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ #ifndef BOTAN_WIDER_WAKE_H__ #define BOTAN_WIDER_WAKE_H__ @@ -10,9 +12,9 @@ namespace Botan { -/************************************************* -* WiderWake4+1-BE * -*************************************************/ +/* +* WiderWake4+1-BE +*/ class BOTAN_DLL WiderWake_41_BE : public StreamCipher { public: -- cgit v1.2.3