aboutsummaryrefslogtreecommitdiffstats
path: root/src/block/lubyrack
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-03-30 18:27:18 +0000
committerlloyd <[email protected]>2009-03-30 18:27:18 +0000
commit96d6eb6f29c55e16a37cf11899547886f735b065 (patch)
tree9f13901e9b44c98d58b2589c9b09c6a7443eb7cd /src/block/lubyrack
parent3cc3dd72c5f87b76852a55c1f2d1821dba967d8c (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/lubyrack')
-rw-r--r--src/block/lubyrack/lubyrack.cpp52
-rw-r--r--src/block/lubyrack/lubyrack.h16
2 files changed, 36 insertions, 32 deletions
diff --git a/src/block/lubyrack/lubyrack.cpp b/src/block/lubyrack/lubyrack.cpp
index 5304d14d6..a9d2b1db2 100644
--- a/src/block/lubyrack/lubyrack.cpp
+++ b/src/block/lubyrack/lubyrack.cpp
@@ -1,16 +1,18 @@
-/*************************************************
-* Luby-Rackoff Source File *
-* (C) 1999-2008 Jack Lloyd *
-*************************************************/
+/*
+* Luby-Rackoff
+* (C) 1999-2008 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
#include <botan/lubyrack.h>
#include <botan/xor_buf.h>
namespace Botan {
-/*************************************************
-* Luby-Rackoff Encryption *
-*************************************************/
+/*
+* Luby-Rackoff Encryption
+*/
void LubyRackoff::enc(const byte in[], byte out[]) const
{
const u32bit len = hash->OUTPUT_LENGTH;
@@ -37,9 +39,9 @@ void LubyRackoff::enc(const byte in[], byte out[]) const
xor_buf(out, buffer, len);
}
-/*************************************************
-* Luby-Rackoff Decryption *
-*************************************************/
+/*
+* Luby-Rackoff Decryption
+*/
void LubyRackoff::dec(const byte in[], byte out[]) const
{
const u32bit len = hash->OUTPUT_LENGTH;
@@ -66,18 +68,18 @@ void LubyRackoff::dec(const byte in[], byte out[]) const
xor_buf(out + len, buffer, len);
}
-/*************************************************
-* Luby-Rackoff Key Schedule *
-*************************************************/
+/*
+* Luby-Rackoff Key Schedule
+*/
void LubyRackoff::key_schedule(const byte key[], u32bit length)
{
K1.set(key, length / 2);
K2.set(key + length / 2, length / 2);
}
-/*************************************************
-* Clear memory of sensitive data *
-*************************************************/
+/*
+* Clear memory of sensitive data
+*/
void LubyRackoff::clear() throw()
{
K1.clear();
@@ -85,25 +87,25 @@ void LubyRackoff::clear() throw()
hash->clear();
}
-/*************************************************
-* Return a clone of this object *
-*************************************************/
+/*
+* Return a clone of this object
+*/
BlockCipher* LubyRackoff::clone() const
{
return new LubyRackoff(hash->clone());
}
-/*************************************************
-* Return the name of this type *
-*************************************************/
+/*
+* Return the name of this type
+*/
std::string LubyRackoff::name() const
{
return "Luby-Rackoff(" + hash->name() + ")";
}
-/*************************************************
-* Luby-Rackoff Constructor *
-*************************************************/
+/*
+* Luby-Rackoff Constructor
+*/
LubyRackoff::LubyRackoff(HashFunction* h) :
BlockCipher(2 * (h ? h->OUTPUT_LENGTH: 0),
2, 32, 2),
diff --git a/src/block/lubyrack/lubyrack.h b/src/block/lubyrack/lubyrack.h
index 6fedc38fe..ebde31304 100644
--- a/src/block/lubyrack/lubyrack.h
+++ b/src/block/lubyrack/lubyrack.h
@@ -1,7 +1,9 @@
-/*************************************************
-* Luby-Rackoff Header File *
-* (C) 1999-2008 Jack Lloyd *
-*************************************************/
+/*
+* Luby-Rackoff
+* (C) 1999-2008 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
#ifndef BOTAN_LUBY_RACKOFF_H__
#define BOTAN_LUBY_RACKOFF_H__
@@ -11,9 +13,9 @@
namespace Botan {
-/*************************************************
-* Luby-Rackoff *
-*************************************************/
+/*
+* Luby-Rackoff
+*/
class BOTAN_DLL LubyRackoff : public BlockCipher
{
public: