aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/mac/x919_mac/x919_mac.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2014-01-18 19:45:16 +0000
committerlloyd <[email protected]>2014-01-18 19:45:16 +0000
commitef465af87d61c0cfbba17b86a3e1cc48b90ab391 (patch)
tree151aafc54f2a57c1ca037653b647398616221060 /src/lib/mac/x919_mac/x919_mac.h
parent1822ba0d828d2c7bec51313597a9a64a54ccc559 (diff)
Use unique_ptr instead of bare pointers and explicit delete in block, mac, hash.
m_ namespaced everything while I'm in there. Changed CMAC poly_double signature.
Diffstat (limited to 'src/lib/mac/x919_mac/x919_mac.h')
-rw-r--r--src/lib/mac/x919_mac/x919_mac.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/lib/mac/x919_mac/x919_mac.h b/src/lib/mac/x919_mac/x919_mac.h
index b7b7d685e..38993af62 100644
--- a/src/lib/mac/x919_mac/x919_mac.h
+++ b/src/lib/mac/x919_mac/x919_mac.h
@@ -10,6 +10,7 @@
#include <botan/mac.h>
#include <botan/block_cipher.h>
+#include <memory>
namespace Botan {
@@ -21,7 +22,8 @@ class BOTAN_DLL ANSI_X919_MAC : public MessageAuthenticationCode
public:
void clear();
std::string name() const;
- size_t output_length() const { return e->block_size(); }
+ size_t output_length() const { return 8; }
+
MessageAuthenticationCode* clone() const;
Key_Length_Specification key_spec() const
@@ -36,17 +38,14 @@ class BOTAN_DLL ANSI_X919_MAC : public MessageAuthenticationCode
ANSI_X919_MAC(const ANSI_X919_MAC&) = delete;
ANSI_X919_MAC& operator=(const ANSI_X919_MAC&) = delete;
-
- ~ANSI_X919_MAC();
private:
void add_data(const byte[], size_t);
void final_result(byte[]);
void key_schedule(const byte[], size_t);
- BlockCipher* e;
- BlockCipher* d;
- secure_vector<byte> state;
- size_t position;
+ std::unique_ptr<BlockCipher> m_des1, m_des2;
+ secure_vector<byte> m_state;
+ size_t m_position;
};
}