From 9bcfe627321ddc81691b835dffaa6324ac4684a4 Mon Sep 17 00:00:00 2001 From: lloyd Date: Sun, 28 Sep 2008 19:29:24 +0000 Subject: Move all modules into src/ directory --- src/pk/dlies/dlies.h | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 src/pk/dlies/dlies.h (limited to 'src/pk/dlies/dlies.h') diff --git a/src/pk/dlies/dlies.h b/src/pk/dlies/dlies.h new file mode 100644 index 000000000..ef0f4d493 --- /dev/null +++ b/src/pk/dlies/dlies.h @@ -0,0 +1,53 @@ +/************************************************* +* DLIES Header File * +* (C) 1999-2007 Jack Lloyd * +*************************************************/ + +#ifndef BOTAN_DLIES_H__ +#define BOTAN_DLIES_H__ + +#include + +namespace Botan { + +/************************************************* +* DLIES Encryption * +*************************************************/ +class BOTAN_DLL DLIES_Encryptor : public PK_Encryptor + { + public: + DLIES_Encryptor(const PK_Key_Agreement_Key&, + const std::string& = "KDF2(SHA-160)", + const std::string& = "HMAC(SHA-160)", u32bit = 20); + void set_other_key(const MemoryRegion&); + private: + SecureVector enc(const byte[], u32bit, + RandomNumberGenerator&) const; + u32bit maximum_input_size() const; + const PK_Key_Agreement_Key& key; + SecureVector other_key; + const std::string kdf_algo; + const std::string mac_algo; + const u32bit MAC_KEYLEN; + }; + +/************************************************* +* DLIES Decryption * +*************************************************/ +class BOTAN_DLL DLIES_Decryptor : public PK_Decryptor + { + public: + DLIES_Decryptor(const PK_Key_Agreement_Key&, + const std::string& = "KDF2(SHA-160)", + const std::string& = "HMAC(SHA-160)", u32bit = 20); + private: + SecureVector dec(const byte[], u32bit) const; + const PK_Key_Agreement_Key& key; + const std::string kdf_algo; + const std::string mac_algo; + const u32bit MAC_KEYLEN, PUBLIC_LEN; + }; + +} + +#endif -- cgit v1.2.3