diff options
author | lloyd <[email protected]> | 2008-09-30 06:47:38 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-09-30 06:47:38 +0000 |
commit | 66869d7e0fcaf120f5c22eee43277fabd00e94fd (patch) | |
tree | 5161b89557a8a8cd8f69ee7459368391872980fb /src/kdf/pbkdf1/pbkdf1.cpp | |
parent | 33bb3dca54ecef2599b756d27b66781e14d06ae3 (diff) |
Remove lookup.h from X9.31 PRNG, X9.19 MAC, SSLv3 MAC, PBKDF1
Diffstat (limited to 'src/kdf/pbkdf1/pbkdf1.cpp')
-rw-r--r-- | src/kdf/pbkdf1/pbkdf1.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/kdf/pbkdf1/pbkdf1.cpp b/src/kdf/pbkdf1/pbkdf1.cpp index 70cff9eee..00d1ea9ab 100644 --- a/src/kdf/pbkdf1/pbkdf1.cpp +++ b/src/kdf/pbkdf1/pbkdf1.cpp @@ -4,8 +4,6 @@ *************************************************/ #include <botan/pbkdf1.h> -#include <botan/lookup.h> -#include <memory> namespace Botan { @@ -20,7 +18,6 @@ OctetString PKCS5_PBKDF1::derive(u32bit key_len, if(iterations == 0) throw Invalid_Argument("PKCS#5 PBKDF1: Invalid iteration count"); - std::auto_ptr<HashFunction> hash(get_hash(hash_name)); if(key_len > hash->OUTPUT_LENGTH) throw Exception("PKCS#5 PBKDF1: Requested output length too long"); @@ -38,20 +35,19 @@ OctetString PKCS5_PBKDF1::derive(u32bit key_len, } /************************************************* -* Return the name of this type * +* Clone this type * *************************************************/ -std::string PKCS5_PBKDF1::name() const +S2K* PKCS5_PBKDF1::clone() const { - return "PBKDF1(" + hash_name + ")"; + return new PKCS5_PBKDF1(hash->clone()); } /************************************************* -* PKCS5_PBKDF1 Constructor * +* Return the name of this type * *************************************************/ -PKCS5_PBKDF1::PKCS5_PBKDF1(const std::string& h_name) : hash_name(h_name) +std::string PKCS5_PBKDF1::name() const { - if(!have_hash(hash_name)) - throw Algorithm_Not_Found(hash_name); + return "PBKDF1(" + hash->name() + ")"; } } |