diff options
author | lloyd <[email protected]> | 2010-10-29 13:51:27 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-10-29 13:51:27 +0000 |
commit | 633175a57a03ed9bf5a5e3577bfc26068c62b688 (patch) | |
tree | 086eb3a931d39fb35f8a3896a25a5cb38736a696 /src/hash/mdx_hash | |
parent | df0dfeb904485bacb8034d0468b4498130939acc (diff) |
Remove BufferedComputation::OUTPUT_LENGTH
Diffstat (limited to 'src/hash/mdx_hash')
-rw-r--r-- | src/hash/mdx_hash/mdx_hash.cpp | 8 | ||||
-rw-r--r-- | src/hash/mdx_hash/mdx_hash.h | 3 |
2 files changed, 4 insertions, 7 deletions
diff --git a/src/hash/mdx_hash/mdx_hash.cpp b/src/hash/mdx_hash/mdx_hash.cpp index f82c971f8..7bfcf6592 100644 --- a/src/hash/mdx_hash/mdx_hash.cpp +++ b/src/hash/mdx_hash/mdx_hash.cpp @@ -14,19 +14,15 @@ namespace Botan { /* * MDx_HashFunction Constructor */ -MDx_HashFunction::MDx_HashFunction(size_t hash_len, - size_t block_len, +MDx_HashFunction::MDx_HashFunction(size_t block_len, bool byte_end, bool bit_end, size_t 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"); count = position = 0; } @@ -98,6 +94,8 @@ void MDx_HashFunction::write_count(byte out[]) { if(COUNT_SIZE < 8) throw Invalid_State("MDx_HashFunction::write_count: COUNT_SIZE < 8"); + 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; diff --git a/src/hash/mdx_hash/mdx_hash.h b/src/hash/mdx_hash/mdx_hash.h index d1260180e..0dfc16b31 100644 --- a/src/hash/mdx_hash/mdx_hash.h +++ b/src/hash/mdx_hash/mdx_hash.h @@ -25,8 +25,7 @@ class BOTAN_DLL MDx_HashFunction : public HashFunction * @param big_bit_endian specifies if the hash uses big-endian bits * @param counter_size specifies the size of the counter var in bytes */ - MDx_HashFunction(size_t hash_length, - size_t block_length, + MDx_HashFunction(size_t block_length, bool big_byte_endian, bool big_bit_endian, size_t counter_size = 8); |