aboutsummaryrefslogtreecommitdiffstats
path: root/src/pk/dlies/dlies.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-09-28 19:29:24 +0000
committerlloyd <[email protected]>2008-09-28 19:29:24 +0000
commit9bcfe627321ddc81691b835dffaa6324ac4684a4 (patch)
treefe5e8ae9813b853549558b59833022e87e83981b /src/pk/dlies/dlies.h
parent9822a701516396b7de4e41339faecd48ff8dc8ff (diff)
Move all modules into src/ directory
Diffstat (limited to 'src/pk/dlies/dlies.h')
-rw-r--r--src/pk/dlies/dlies.h53
1 files changed, 53 insertions, 0 deletions
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 <botan/pubkey.h>
+
+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<byte>&);
+ private:
+ SecureVector<byte> enc(const byte[], u32bit,
+ RandomNumberGenerator&) const;
+ u32bit maximum_input_size() const;
+ const PK_Key_Agreement_Key& key;
+ SecureVector<byte> 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<byte> 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