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/arc4 | |
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/arc4')
-rw-r--r-- | src/stream/arc4/arc4.cpp | 46 | ||||
-rw-r--r-- | src/stream/arc4/arc4.h | 16 |
2 files changed, 33 insertions, 29 deletions
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 <botan/arc4.h> #include <botan/xor_buf.h> @@ -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: |