diff options
Diffstat (limited to 'src/pubkey/dlies/dlies.h')
-rw-r--r-- | src/pubkey/dlies/dlies.h | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/src/pubkey/dlies/dlies.h b/src/pubkey/dlies/dlies.h index ef0f4d493..d452f1a4f 100644 --- a/src/pubkey/dlies/dlies.h +++ b/src/pubkey/dlies/dlies.h @@ -7,6 +7,8 @@ #define BOTAN_DLIES_H__ #include <botan/pubkey.h> +#include <botan/mac.h> +#include <botan/kdf.h> namespace Botan { @@ -17,18 +19,24 @@ 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); + KDF* kdf, + MessageAuthenticationCode* mac, + u32bit mac_key_len = 20); + + ~DLIES_Encryptor(); + 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; + + KDF* kdf; + MessageAuthenticationCode* mac; + u32bit mac_keylen; }; /************************************************* @@ -38,14 +46,20 @@ 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); + KDF* kdf, + MessageAuthenticationCode* mac, + u32bit mac_key_len = 20); + + ~DLIES_Decryptor(); + 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; + + KDF* kdf; + MessageAuthenticationCode* mac; + u32bit mac_keylen; }; } |