diff options
Diffstat (limited to 'src/kdf/kdf2')
-rw-r--r-- | src/kdf/kdf2/info.txt | 5 | ||||
-rw-r--r-- | src/kdf/kdf2/kdf2.cpp | 40 | ||||
-rw-r--r-- | src/kdf/kdf2/kdf2.h | 37 |
3 files changed, 0 insertions, 82 deletions
diff --git a/src/kdf/kdf2/info.txt b/src/kdf/kdf2/info.txt deleted file mode 100644 index 3481ff04f..000000000 --- a/src/kdf/kdf2/info.txt +++ /dev/null @@ -1,5 +0,0 @@ -define KDF2 20131128 - -<requires> -hash -</requires> diff --git a/src/kdf/kdf2/kdf2.cpp b/src/kdf/kdf2/kdf2.cpp deleted file mode 100644 index 39a929b58..000000000 --- a/src/kdf/kdf2/kdf2.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* -* KDF2 -* (C) 1999-2007 Jack Lloyd -* -* Distributed under the terms of the Botan license -*/ - -#include <botan/kdf2.h> - -namespace Botan { - -/* -* KDF2 Key Derivation Mechanism -*/ -secure_vector<byte> KDF2::derive(size_t out_len, - const byte secret[], size_t secret_len, - const byte P[], size_t P_len) const - { - secure_vector<byte> output; - u32bit counter = 1; - - while(out_len && counter) - { - hash->update(secret, secret_len); - hash->update_be(counter); - hash->update(P, P_len); - - secure_vector<byte> hash_result = hash->final(); - - size_t added = std::min(hash_result.size(), out_len); - output += std::make_pair(&hash_result[0], added); - out_len -= added; - - ++counter; - } - - return output; - } - -} diff --git a/src/kdf/kdf2/kdf2.h b/src/kdf/kdf2/kdf2.h deleted file mode 100644 index e33939df9..000000000 --- a/src/kdf/kdf2/kdf2.h +++ /dev/null @@ -1,37 +0,0 @@ -/* -* KDF2 -* (C) 1999-2007 Jack Lloyd -* -* Distributed under the terms of the Botan license -*/ - -#ifndef BOTAN_KDF2_H__ -#define BOTAN_KDF2_H__ - -#include <botan/kdf.h> -#include <botan/hash.h> - -namespace Botan { - -/** -* KDF2, from IEEE 1363 -*/ -class BOTAN_DLL KDF2 : public KDF - { - public: - secure_vector<byte> derive(size_t, const byte[], size_t, - const byte[], size_t) const; - - std::string name() const { return "KDF2(" + hash->name() + ")"; } - KDF* clone() const { return new KDF2(hash->clone()); } - - KDF2(HashFunction* h) : hash(h) {} - KDF2(const KDF2& other) : KDF(), hash(other.hash->clone()) {} - ~KDF2() { delete hash; } - private: - HashFunction* hash; - }; - -} - -#endif |