diff options
author | lloyd <[email protected]> | 2010-10-13 02:59:43 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-10-13 02:59:43 +0000 |
commit | 61ed0d4d90164675396feb7c7cecdd3bc5012f91 (patch) | |
tree | 31f48086086c78c6f0ce5fd533d819c8463be822 /src/mac/hmac/hmac.cpp | |
parent | 3697dcff8b5e9765b41114281ce10e7ed3d3abb4 (diff) |
Remove most uses of HASH_BLOCK_SIZE
Diffstat (limited to 'src/mac/hmac/hmac.cpp')
-rw-r--r-- | src/mac/hmac/hmac.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mac/hmac/hmac.cpp b/src/mac/hmac/hmac.cpp index 90da24eaf..06923138a 100644 --- a/src/mac/hmac/hmac.cpp +++ b/src/mac/hmac/hmac.cpp @@ -40,7 +40,7 @@ void HMAC::key_schedule(const byte key[], size_t length) std::fill(i_key.begin(), i_key.end(), 0x36); std::fill(o_key.begin(), o_key.end(), 0x5C); - if(length > hash->HASH_BLOCK_SIZE) + if(length > hash->hash_block_size()) { SecureVector<byte> hmac_key = hash->process(key, length); xor_buf(i_key, hmac_key, hmac_key.size()); @@ -86,14 +86,14 @@ MessageAuthenticationCode* HMAC::clone() const */ HMAC::HMAC(HashFunction* hash_in) : MessageAuthenticationCode(hash_in->output_length(), - 0, 2*hash_in->HASH_BLOCK_SIZE), + 0, 2*hash_in->hash_block_size()), hash(hash_in) { - if(hash->HASH_BLOCK_SIZE == 0) + if(hash->hash_block_size() == 0) throw Invalid_Argument("HMAC cannot be used with " + hash->name()); - i_key.resize(hash->HASH_BLOCK_SIZE); - o_key.resize(hash->HASH_BLOCK_SIZE); + i_key.resize(hash->hash_block_size()); + o_key.resize(hash->hash_block_size()); } } |