diff options
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() + ")"; } } |