aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/mac/hmac
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-12-11 15:28:38 -0500
committerJack Lloyd <[email protected]>2016-12-18 16:48:24 -0500
commitf3cb3edb512bdcab498d825886c3366c341b3f78 (patch)
tree645c73ec295a5a34f25d99903b6d9fa9751e86d3 /src/lib/mac/hmac
parentc1dd21253c1f3188ff45d3ad47698efd08235ae8 (diff)
Convert to using standard uintN_t integer types
Renames a couple of functions for somewhat better name consistency, eg make_u32bit becomes make_uint32. The old typedefs remain for now since probably lots of application code uses them.
Diffstat (limited to 'src/lib/mac/hmac')
-rw-r--r--src/lib/mac/hmac/hmac.cpp8
-rw-r--r--src/lib/mac/hmac/hmac.h8
2 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/mac/hmac/hmac.cpp b/src/lib/mac/hmac/hmac.cpp
index a2021515f..aeadf4520 100644
--- a/src/lib/mac/hmac/hmac.cpp
+++ b/src/lib/mac/hmac/hmac.cpp
@@ -13,7 +13,7 @@ namespace Botan {
/*
* Update a HMAC Calculation
*/
-void HMAC::add_data(const byte input[], size_t length)
+void HMAC::add_data(const uint8_t input[], size_t length)
{
m_hash->update(input, length);
}
@@ -21,7 +21,7 @@ void HMAC::add_data(const byte input[], size_t length)
/*
* Finalize a HMAC Calculation
*/
-void HMAC::final_result(byte mac[])
+void HMAC::final_result(uint8_t mac[])
{
m_hash->final(mac);
m_hash->update(m_okey);
@@ -33,7 +33,7 @@ void HMAC::final_result(byte mac[])
/*
* HMAC Key Schedule
*/
-void HMAC::key_schedule(const byte key[], size_t length)
+void HMAC::key_schedule(const uint8_t key[], size_t length)
{
m_hash->clear();
@@ -45,7 +45,7 @@ void HMAC::key_schedule(const byte key[], size_t length)
if(length > m_hash->hash_block_size())
{
- secure_vector<byte> hmac_key = m_hash->process(key, length);
+ secure_vector<uint8_t> hmac_key = m_hash->process(key, length);
xor_buf(m_ikey, hmac_key, hmac_key.size());
xor_buf(m_okey, hmac_key, hmac_key.size());
}
diff --git a/src/lib/mac/hmac/hmac.h b/src/lib/mac/hmac/hmac.h
index bfb425fa8..6627475d1 100644
--- a/src/lib/mac/hmac/hmac.h
+++ b/src/lib/mac/hmac/hmac.h
@@ -39,12 +39,12 @@ class BOTAN_DLL HMAC final : public MessageAuthenticationCode
HMAC(const HMAC&) = delete;
HMAC& operator=(const HMAC&) = delete;
private:
- void add_data(const byte[], size_t) override;
- void final_result(byte[]) override;
- void key_schedule(const byte[], size_t) override;
+ void add_data(const uint8_t[], size_t) override;
+ void final_result(uint8_t[]) override;
+ void key_schedule(const uint8_t[], size_t) override;
std::unique_ptr<HashFunction> m_hash;
- secure_vector<byte> m_ikey, m_okey;
+ secure_vector<uint8_t> m_ikey, m_okey;
};
}