aboutsummaryrefslogtreecommitdiffstats
path: root/src/hash/comb4p/comb4p.cpp
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/comb4p/comb4p.cpp
parent61ed0d4d90164675396feb7c7cecdd3bc5012f91 (diff)
Remove HashFunction::HASH_BLOCK_SIZE entirely
Diffstat (limited to 'src/hash/comb4p/comb4p.cpp')
-rw-r--r--src/hash/comb4p/comb4p.cpp28
1 files changed, 13 insertions, 15 deletions
diff --git a/src/hash/comb4p/comb4p.cpp b/src/hash/comb4p/comb4p.cpp
index 5e336e98b..19e23879f 100644
--- a/src/hash/comb4p/comb4p.cpp
+++ b/src/hash/comb4p/comb4p.cpp
@@ -13,19 +13,6 @@ namespace Botan {
namespace {
-size_t comb4p_block_size(const HashFunction* h1,
- const HashFunction* h2)
- {
- if(h1->hash_block_size() == h2->hash_block_size())
- return h1->hash_block_size();
-
- /*
- * Return LCM of the block sizes? This would probably be OK for
- * HMAC, which is the main thing relying on knowing the block size.
- */
- return 0;
- }
-
void comb4p_round(MemoryRegion<byte>& out,
const MemoryRegion<byte>& in,
byte round_no,
@@ -48,8 +35,7 @@ void comb4p_round(MemoryRegion<byte>& out,
}
Comb4P::Comb4P(HashFunction* h1, HashFunction* h2) :
- HashFunction(h1->output_length() + h2->output_length(),
- comb4p_block_size(h1, h2)),
+ HashFunction(h1->output_length() + h2->output_length()),
hash1(h1), hash2(h2)
{
if(hash1->name() == hash2->name())
@@ -63,6 +49,18 @@ Comb4P::Comb4P(HashFunction* h1, HashFunction* h2) :
clear();
}
+size_t Comb4P::hash_block_size() const
+ {
+ if(hash1->hash_block_size() == hash2->hash_block_size())
+ return hash1->hash_block_size();
+
+ /*
+ * Return LCM of the block sizes? This would probably be OK for
+ * HMAC, which is the main thing relying on knowing the block size.
+ */
+ return 0;
+ }
+
void Comb4P::clear()
{
hash1->clear();