diff options
author | lloyd <[email protected]> | 2014-01-18 19:45:16 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2014-01-18 19:45:16 +0000 |
commit | ef465af87d61c0cfbba17b86a3e1cc48b90ab391 (patch) | |
tree | 151aafc54f2a57c1ca037653b647398616221060 /src/lib/mac/hmac/hmac.h | |
parent | 1822ba0d828d2c7bec51313597a9a64a54ccc559 (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/hmac/hmac.h')
-rw-r--r-- | src/lib/mac/hmac/hmac.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/mac/hmac/hmac.h b/src/lib/mac/hmac/hmac.h index 39a084874..359d4e6f3 100644 --- a/src/lib/mac/hmac/hmac.h +++ b/src/lib/mac/hmac/hmac.h @@ -1,6 +1,6 @@ /* * HMAC -* (C) 1999-2007 Jack Lloyd +* (C) 1999-2007,2014 Jack Lloyd * * Distributed under the terms of the Botan license */ @@ -10,6 +10,7 @@ #include <botan/mac.h> #include <botan/hash.h> +#include <memory> namespace Botan { @@ -23,10 +24,11 @@ class BOTAN_DLL HMAC : public MessageAuthenticationCode std::string name() const; MessageAuthenticationCode* clone() const; - size_t output_length() const { return hash->output_length(); } + size_t output_length() const { return m_hash->output_length(); } Key_Length_Specification key_spec() const { + // Absurd max length here is to support PBKDF2 return Key_Length_Specification(0, 512); } @@ -37,15 +39,13 @@ class BOTAN_DLL HMAC : public MessageAuthenticationCode HMAC(const HMAC&) = delete; HMAC& operator=(const HMAC&) = delete; - - ~HMAC() { delete hash; } private: void add_data(const byte[], size_t); void final_result(byte[]); void key_schedule(const byte[], size_t); - HashFunction* hash; - secure_vector<byte> i_key, o_key; + std::unique_ptr<HashFunction> m_hash; + secure_vector<byte> m_ikey, m_okey; }; } |