diff options
author | lloyd <[email protected]> | 2008-09-15 23:13:49 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-09-15 23:13:49 +0000 |
commit | d76ed0d90389dba224697027ed66ffbd663b13e8 (patch) | |
tree | 9f09812a1958ffa830a82c2bc9f0eadac87ec502 /include | |
parent | c22a6379f79c70f68c26ba6b635b230f00e194be (diff) |
Change the constructor for LubyRackoff. Previously it took a string,
however now instead it takes a HashFunction pointer, which it deletes
in its destructor.
Why the change? For one, lookup.h, while seemingly a bunch of standalone
functions, actually calls into a large mass of global state (in short, it
is icky). I have a plan in mind for removing much of this while still
providing a high level interface (actually hopefully better than now),
here is just the start.
Now, calling clone() on a LubyRackoff object will now return a new object
with a clone() of the HashFunction. Previously we called get_hash on
the name, which goes through the whole global lookup bit. This is also
good since if you construct one with (say) an OpenSSL provided hash,
clones of it will now also use that implementation.
Diffstat (limited to 'include')
-rw-r--r-- | include/lubyrack.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/lubyrack.h b/include/lubyrack.h index e5a2e2a20..2c4813cb6 100644 --- a/include/lubyrack.h +++ b/include/lubyrack.h @@ -1,6 +1,6 @@ /************************************************* * Luby-Rackoff Header File * -* (C) 1999-2007 Jack Lloyd * +* (C) 1999-2008 Jack Lloyd * *************************************************/ #ifndef BOTAN_LUBY_RACKOFF_H__ @@ -19,7 +19,8 @@ class BOTAN_DLL LubyRackoff : public BlockCipher void clear() throw(); std::string name() const; BlockCipher* clone() const; - LubyRackoff(const std::string&); + + LubyRackoff(HashFunction* hash); ~LubyRackoff() { delete hash; } private: void enc(const byte[], byte[]) const; |