aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/hash/mdx_hash
diff options
context:
space:
mode:
authorRenĂ© Korthaus <[email protected]>2015-12-23 11:52:19 +0100
committerJack Lloyd <[email protected]>2016-01-08 19:09:51 -0500
commitd22bc10cd4f67924acd82bcd46a31e3de3b20ce3 (patch)
tree58459585e6675cd799b6ef5900be026825cd6f9d /src/lib/hash/mdx_hash
parent2fbfdd7e5afb5e888fd8c0b56c6df09e2bdeaca7 (diff)
Mass-prefix member vars with m_
Diffstat (limited to 'src/lib/hash/mdx_hash')
-rw-r--r--src/lib/hash/mdx_hash/mdx_hash.cpp50
-rw-r--r--src/lib/hash/mdx_hash/mdx_hash.h8
2 files changed, 29 insertions, 29 deletions
diff --git a/src/lib/hash/mdx_hash/mdx_hash.cpp b/src/lib/hash/mdx_hash/mdx_hash.cpp
index bd754d3cc..f21b4ac34 100644
--- a/src/lib/hash/mdx_hash/mdx_hash.cpp
+++ b/src/lib/hash/mdx_hash/mdx_hash.cpp
@@ -18,12 +18,12 @@ MDx_HashFunction::MDx_HashFunction(size_t block_len,
bool byte_end,
bool bit_end,
size_t cnt_size) :
- buffer(block_len),
+ m_buffer(block_len),
BIG_BYTE_ENDIAN(byte_end),
BIG_BIT_ENDIAN(bit_end),
COUNT_SIZE(cnt_size)
{
- count = position = 0;
+ m_count = m_position = 0;
}
/*
@@ -31,8 +31,8 @@ MDx_HashFunction::MDx_HashFunction(size_t block_len,
*/
void MDx_HashFunction::clear()
{
- zeroise(buffer);
- count = position = 0;
+ zeroise(m_buffer);
+ m_count = m_position = 0;
}
/*
@@ -40,29 +40,29 @@ void MDx_HashFunction::clear()
*/
void MDx_HashFunction::add_data(const byte input[], size_t length)
{
- count += length;
+ m_count += length;
- if(position)
+ if(m_position)
{
- buffer_insert(buffer, position, input, length);
+ buffer_insert(m_buffer, m_position, input, length);
- if(position + length >= buffer.size())
+ if(m_position + length >= m_buffer.size())
{
- compress_n(buffer.data(), 1);
- input += (buffer.size() - position);
- length -= (buffer.size() - position);
- position = 0;
+ compress_n(m_buffer.data(), 1);
+ input += (m_buffer.size() - m_position);
+ length -= (m_buffer.size() - m_position);
+ m_position = 0;
}
}
- const size_t full_blocks = length / buffer.size();
- const size_t remaining = length % buffer.size();
+ const size_t full_blocks = length / m_buffer.size();
+ const size_t remaining = length % m_buffer.size();
if(full_blocks)
compress_n(input, full_blocks);
- buffer_insert(buffer, position, input + full_blocks * buffer.size(), remaining);
- position += remaining;
+ buffer_insert(m_buffer, m_position, input + full_blocks * m_buffer.size(), remaining);
+ m_position += remaining;
}
/*
@@ -70,19 +70,19 @@ void MDx_HashFunction::add_data(const byte input[], size_t length)
*/
void MDx_HashFunction::final_result(byte output[])
{
- buffer[position] = (BIG_BIT_ENDIAN ? 0x80 : 0x01);
- for(size_t i = position+1; i != buffer.size(); ++i)
- buffer[i] = 0;
+ m_buffer[m_position] = (BIG_BIT_ENDIAN ? 0x80 : 0x01);
+ for(size_t i = m_position+1; i != m_buffer.size(); ++i)
+ m_buffer[i] = 0;
- if(position >= buffer.size() - COUNT_SIZE)
+ if(m_position >= m_buffer.size() - COUNT_SIZE)
{
- compress_n(buffer.data(), 1);
- zeroise(buffer);
+ compress_n(m_buffer.data(), 1);
+ zeroise(m_buffer);
}
- write_count(&buffer[buffer.size() - COUNT_SIZE]);
+ write_count(&m_buffer[m_buffer.size() - COUNT_SIZE]);
- compress_n(buffer.data(), 1);
+ compress_n(m_buffer.data(), 1);
copy_out(output);
clear();
}
@@ -97,7 +97,7 @@ void MDx_HashFunction::write_count(byte out[])
if(COUNT_SIZE >= output_length() || COUNT_SIZE >= hash_block_size())
throw Invalid_Argument("MDx_HashFunction: COUNT_SIZE is too big");
- const u64bit bit_count = count * 8;
+ const u64bit bit_count = m_count * 8;
if(BIG_BYTE_ENDIAN)
store_be(bit_count, out + COUNT_SIZE - 8);
diff --git a/src/lib/hash/mdx_hash/mdx_hash.h b/src/lib/hash/mdx_hash/mdx_hash.h
index 2652d9ea6..4b2f9bad0 100644
--- a/src/lib/hash/mdx_hash/mdx_hash.h
+++ b/src/lib/hash/mdx_hash/mdx_hash.h
@@ -29,7 +29,7 @@ class BOTAN_DLL MDx_HashFunction : public HashFunction
bool big_bit_endian,
size_t counter_size = 8);
- size_t hash_block_size() const override { return buffer.size(); }
+ size_t hash_block_size() const override { return m_buffer.size(); }
protected:
void add_data(const byte input[], size_t length) override;
void final_result(byte output[]) override;
@@ -55,9 +55,9 @@ class BOTAN_DLL MDx_HashFunction : public HashFunction
*/
virtual void write_count(byte out[]);
private:
- secure_vector<byte> buffer;
- u64bit count;
- size_t position;
+ secure_vector<byte> m_buffer;
+ u64bit m_count;
+ size_t m_position;
const bool BIG_BYTE_ENDIAN, BIG_BIT_ENDIAN;
const size_t COUNT_SIZE;