From 47ffeed7f8270855596c4f1d7b2d405172d78e8c Mon Sep 17 00:00:00 2001 From: lloyd Date: Sun, 28 Sep 2008 18:03:20 +0000 Subject: Modularize KDFs, PBKDFs, and PRFs --- include/kdf.h | 81 ------------------------------------------------------- include/pgp_s2k.h | 30 --------------------- include/pkcs5.h | 45 ------------------------------- 3 files changed, 156 deletions(-) delete mode 100644 include/kdf.h delete mode 100644 include/pgp_s2k.h delete mode 100644 include/pkcs5.h (limited to 'include') diff --git a/include/kdf.h b/include/kdf.h deleted file mode 100644 index ad7a11dbe..000000000 --- a/include/kdf.h +++ /dev/null @@ -1,81 +0,0 @@ -/************************************************* -* KDF Header File * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ - -#ifndef BOTAN_KDF_H__ -#define BOTAN_KDF_H__ - -#include - -namespace Botan { - -/************************************************* -* KDF1 * -*************************************************/ -class BOTAN_DLL KDF1 : public KDF - { - public: - SecureVector derive(u32bit, const byte[], u32bit, - const byte[], u32bit) const; - - KDF1(const std::string&); - private: - const std::string hash_name; - }; - -/************************************************* -* KDF2 * -*************************************************/ -class BOTAN_DLL KDF2 : public KDF - { - public: - SecureVector derive(u32bit, const byte[], u32bit, - const byte[], u32bit) const; - - KDF2(const std::string&); - private: - const std::string hash_name; - }; - -/************************************************* -* X9.42 PRF * -*************************************************/ -class BOTAN_DLL X942_PRF : public KDF - { - public: - SecureVector derive(u32bit, const byte[], u32bit, - const byte[], u32bit) const; - - X942_PRF(const std::string&); - private: - std::string key_wrap_oid; - }; - -/************************************************* -* SSL3 PRF * -*************************************************/ -class BOTAN_DLL SSL3_PRF : public KDF - { - public: - SecureVector derive(u32bit, const byte[], u32bit, - const byte[], u32bit) const; - }; - -/************************************************* -* TLS PRF * -*************************************************/ -class BOTAN_DLL TLS_PRF : public KDF - { - public: - SecureVector derive(u32bit, const byte[], u32bit, - const byte[], u32bit) const; - private: - SecureVector P_hash(const std::string&, u32bit, - const byte[], u32bit, - const byte[], u32bit) const; - }; - -} - -#endif diff --git a/include/pgp_s2k.h b/include/pgp_s2k.h deleted file mode 100644 index cd263a735..000000000 --- a/include/pgp_s2k.h +++ /dev/null @@ -1,30 +0,0 @@ -/************************************************* -* OpenPGP S2K Header File * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ - -#ifndef BOTAN_OPENPGP_S2K_H__ -#define BOTAN_OPENPGP_S2K_H__ - -#include - -namespace Botan { - -/************************************************* -* OpenPGP S2K * -*************************************************/ -class BOTAN_DLL OpenPGP_S2K : public S2K - { - public: - std::string name() const; - S2K* clone() const; - OpenPGP_S2K(const std::string&); - private: - OctetString derive(u32bit, const std::string&, - const byte[], u32bit, u32bit) const; - const std::string hash_name; - }; - -} - -#endif diff --git a/include/pkcs5.h b/include/pkcs5.h deleted file mode 100644 index 22b16b7c5..000000000 --- a/include/pkcs5.h +++ /dev/null @@ -1,45 +0,0 @@ -/************************************************* -* PKCS #5 Header File * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ - -#ifndef BOTAN_PKCS5_H__ -#define BOTAN_PKCS5_H__ - -#include - -namespace Botan { - -/************************************************* -* PKCS #5 PBKDF1 * -*************************************************/ -class BOTAN_DLL PKCS5_PBKDF1 : public S2K - { - public: - std::string name() const; - S2K* clone() const { return new PKCS5_PBKDF1(hash_name); } - PKCS5_PBKDF1(const std::string&); - private: - OctetString derive(u32bit, const std::string&, - const byte[], u32bit, u32bit) const; - const std::string hash_name; - }; - -/************************************************* -* PKCS #5 PBKDF2 * -*************************************************/ -class BOTAN_DLL PKCS5_PBKDF2 : public S2K - { - public: - std::string name() const; - S2K* clone() const { return new PKCS5_PBKDF2(hash_name); } - PKCS5_PBKDF2(const std::string&); - private: - OctetString derive(u32bit, const std::string&, - const byte[], u32bit, u32bit) const; - const std::string hash_name; - }; - -} - -#endif -- cgit v1.2.3