aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/mac/cbc_mac/cbc_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/cbc_mac/cbc_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/cbc_mac/cbc_mac.h')
-rw-r--r--src/lib/mac/cbc_mac/cbc_mac.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/lib/mac/cbc_mac/cbc_mac.h b/src/lib/mac/cbc_mac/cbc_mac.h
index be25718d9..e7285d0cb 100644
--- a/src/lib/mac/cbc_mac/cbc_mac.h
+++ b/src/lib/mac/cbc_mac/cbc_mac.h
@@ -10,6 +10,7 @@
#include <botan/mac.h>
#include <botan/block_cipher.h>
+#include <memory>
namespace Botan {
@@ -21,27 +22,27 @@ class BOTAN_DLL CBC_MAC : public MessageAuthenticationCode
public:
std::string name() const;
MessageAuthenticationCode* clone() const;
- size_t output_length() const { return e->block_size(); }
+ size_t output_length() const { return m_cipher->block_size(); }
void clear();
Key_Length_Specification key_spec() const
{
- return e->key_spec();
+ return m_cipher->key_spec();
}
/**
* @param cipher the underlying block cipher to use
*/
CBC_MAC(BlockCipher* cipher);
- ~CBC_MAC();
+
private:
void add_data(const byte[], size_t);
void final_result(byte[]);
void key_schedule(const byte[], size_t);
- BlockCipher* e;
- secure_vector<byte> state;
- size_t position;
+ std::unique_ptr<BlockCipher> m_cipher;
+ secure_vector<byte> m_state;
+ size_t m_position = 0;
};
}