diff options
Diffstat (limited to 'src/lib/pubkey')
-rw-r--r-- | src/lib/pubkey/dlies/dlies.cpp | 12 | ||||
-rw-r--r-- | src/lib/pubkey/dlies/dlies.h | 13 |
2 files changed, 5 insertions, 20 deletions
diff --git a/src/lib/pubkey/dlies/dlies.cpp b/src/lib/pubkey/dlies/dlies.cpp index 715b55a36..a969eaec7 100644 --- a/src/lib/pubkey/dlies/dlies.cpp +++ b/src/lib/pubkey/dlies/dlies.cpp @@ -25,12 +25,6 @@ DLIES_Encryptor::DLIES_Encryptor(const PK_Key_Agreement_Key& key, my_key = key.public_value(); } -DLIES_Encryptor::~DLIES_Encryptor() - { - delete kdf; - delete mac; - } - /* * DLIES Encryption */ @@ -99,12 +93,6 @@ DLIES_Decryptor::DLIES_Decryptor(const PK_Key_Agreement_Key& key, my_key = key.public_value(); } -DLIES_Decryptor::~DLIES_Decryptor() - { - delete kdf; - delete mac; - } - /* * DLIES Decryption */ diff --git a/src/lib/pubkey/dlies/dlies.h b/src/lib/pubkey/dlies/dlies.h index 9739afeb2..643ef95c5 100644 --- a/src/lib/pubkey/dlies/dlies.h +++ b/src/lib/pubkey/dlies/dlies.h @@ -11,6 +11,7 @@ #include <botan/pubkey.h> #include <botan/mac.h> #include <botan/kdf.h> +#include <memory> namespace Botan { @@ -25,8 +26,6 @@ class BOTAN_DLL DLIES_Encryptor : public PK_Encryptor MessageAuthenticationCode* mac, size_t mac_key_len = 20); - ~DLIES_Encryptor(); - void set_other_key(const std::vector<byte>&); private: std::vector<byte> enc(const byte[], size_t, @@ -37,8 +36,8 @@ class BOTAN_DLL DLIES_Encryptor : public PK_Encryptor std::vector<byte> other_key, my_key; PK_Key_Agreement ka; - KDF* kdf; - MessageAuthenticationCode* mac; + std::unique_ptr<KDF> kdf; + std::unique_ptr<MessageAuthenticationCode> mac; size_t mac_keylen; }; @@ -53,16 +52,14 @@ class BOTAN_DLL DLIES_Decryptor : public PK_Decryptor MessageAuthenticationCode* mac, size_t mac_key_len = 20); - ~DLIES_Decryptor(); - private: secure_vector<byte> dec(const byte[], size_t) const; std::vector<byte> my_key; PK_Key_Agreement ka; - KDF* kdf; - MessageAuthenticationCode* mac; + std::unique_ptr<KDF> kdf; + std::unique_ptr<MessageAuthenticationCode> mac; size_t mac_keylen; }; |