aboutsummaryrefslogtreecommitdiffstats
path: root/src/hash/mdx_hash
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-10-13 03:09:18 +0000
committerlloyd <[email protected]>2010-10-13 03:09:18 +0000
commit53d01738e99edfa58a061057186c2a72117ce5d7 (patch)
tree8d8abb63acbedfd46c6bdeec640f1f13475ba1f7 /src/hash/mdx_hash
parent61ed0d4d90164675396feb7c7cecdd3bc5012f91 (diff)
Remove HashFunction::HASH_BLOCK_SIZE entirely
Diffstat (limited to 'src/hash/mdx_hash')
-rw-r--r--src/hash/mdx_hash/mdx_hash.cpp13
-rw-r--r--src/hash/mdx_hash/mdx_hash.h2
2 files changed, 11 insertions, 4 deletions
diff --git a/src/hash/mdx_hash/mdx_hash.cpp b/src/hash/mdx_hash/mdx_hash.cpp
index 930f9a938..84b97fd7f 100644
--- a/src/hash/mdx_hash/mdx_hash.cpp
+++ b/src/hash/mdx_hash/mdx_hash.cpp
@@ -14,11 +14,16 @@ namespace Botan {
/*
* MDx_HashFunction Constructor
*/
-MDx_HashFunction::MDx_HashFunction(size_t hash_len, size_t block_len,
- bool byte_end, bool bit_end,
+MDx_HashFunction::MDx_HashFunction(size_t hash_len,
+ size_t block_len,
+ bool byte_end,
+ bool bit_end,
size_t cnt_size) :
- HashFunction(hash_len, block_len), buffer(block_len),
- BIG_BYTE_ENDIAN(byte_end), BIG_BIT_ENDIAN(bit_end), COUNT_SIZE(cnt_size)
+ HashFunction(hash_len),
+ buffer(block_len),
+ BIG_BYTE_ENDIAN(byte_end),
+ BIG_BIT_ENDIAN(bit_end),
+ COUNT_SIZE(cnt_size)
{
if(COUNT_SIZE >= output_length() || COUNT_SIZE >= hash_block_size())
throw Invalid_Argument("MDx_HashFunction: COUNT_SIZE is too big");
diff --git a/src/hash/mdx_hash/mdx_hash.h b/src/hash/mdx_hash/mdx_hash.h
index 6603f54bc..5591f2b80 100644
--- a/src/hash/mdx_hash/mdx_hash.h
+++ b/src/hash/mdx_hash/mdx_hash.h
@@ -31,6 +31,8 @@ class BOTAN_DLL MDx_HashFunction : public HashFunction
bool big_bit_endian,
size_t counter_size = 8);
+ size_t hash_block_size() const { return buffer.size(); }
+
virtual ~MDx_HashFunction() {}
protected:
void add_data(const byte input[], size_t length);