diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/kdf.h | 34 | ||||
-rw-r--r-- | include/ssl3_mac.h | 34 |
2 files changed, 63 insertions, 5 deletions
diff --git a/include/kdf.h b/include/kdf.h index 57f1dc047..ad7a11dbe 100644 --- a/include/kdf.h +++ b/include/kdf.h @@ -16,11 +16,11 @@ namespace Botan { class BOTAN_DLL KDF1 : public KDF { public: - KDF1(const std::string&); - private: SecureVector<byte> derive(u32bit, const byte[], u32bit, const byte[], u32bit) const; + KDF1(const std::string&); + private: const std::string hash_name; }; @@ -30,11 +30,11 @@ class BOTAN_DLL KDF1 : public KDF class BOTAN_DLL KDF2 : public KDF { public: + SecureVector<byte> derive(u32bit, const byte[], u32bit, + const byte[], u32bit) const; KDF2(const std::string&); private: - SecureVector<byte> derive(u32bit, const byte[], u32bit, - const byte[], u32bit) const; const std::string hash_name; }; @@ -44,12 +44,36 @@ class BOTAN_DLL KDF2 : public KDF class BOTAN_DLL X942_PRF : public KDF { public: + SecureVector<byte> 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<byte> derive(u32bit, const byte[], u32bit, const byte[], u32bit) const; + }; - std::string key_wrap_oid; +/************************************************* +* TLS PRF * +*************************************************/ +class BOTAN_DLL TLS_PRF : public KDF + { + public: + SecureVector<byte> derive(u32bit, const byte[], u32bit, + const byte[], u32bit) const; + private: + SecureVector<byte> P_hash(const std::string&, u32bit, + const byte[], u32bit, + const byte[], u32bit) const; }; } diff --git a/include/ssl3_mac.h b/include/ssl3_mac.h new file mode 100644 index 000000000..8ab08c97d --- /dev/null +++ b/include/ssl3_mac.h @@ -0,0 +1,34 @@ +/************************************************* +* SSL3-MAC Header File * +* (C) 1999-2004 Jack Lloyd * +*************************************************/ + +#ifndef BOTAN_SSL3_MAC_H__ +#define BOTAN_SSL3_MAC_H__ + +#include <botan/base.h> + +namespace Botan { + +/************************************************* +* SSL3-MAC * +*************************************************/ +class SSL3_MAC : public MessageAuthenticationCode + { + public: + void clear() throw(); + std::string name() const; + MessageAuthenticationCode* clone() const; + SSL3_MAC(const std::string&); + ~SSL3_MAC() { delete hash; } + private: + void add_data(const byte[], u32bit); + void final_result(byte[]); + void key(const byte[], u32bit); + HashFunction* hash; + SecureVector<byte> i_key, o_key; + }; + +} + +#endif |