diff options
author | lloyd <[email protected]> | 2010-10-13 16:33:20 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-10-13 16:33:20 +0000 |
commit | b502cefaf0f9396354d58c4c18a78ac7870f6168 (patch) | |
tree | 8e4d699bd47bcdecaa6c3b670e19743d52047bb8 /src/hash | |
parent | fc4c8f57baa06cfc9073ce83a5e3d1547bea86c0 (diff) | |
parent | a142500346e9bef5c4b0905103eac9a494d6822e (diff) |
propagate from branch 'net.randombit.botan' (head cba32f885eb7889a9711cbee120df42839deb9d0)
to branch 'net.randombit.botan.c++0x' (head 7cb9cdfda0f3dedab24f1d3bc7e7ea9b22164234)
Diffstat (limited to 'src/hash')
-rw-r--r-- | src/hash/hash.h | 2 | ||||
-rw-r--r-- | src/hash/mdx_hash/mdx_hash.h | 2 | ||||
-rw-r--r-- | src/hash/skein/skein_512.cpp | 8 | ||||
-rw-r--r-- | src/hash/skein/skein_512.h | 2 |
4 files changed, 7 insertions, 7 deletions
diff --git a/src/hash/hash.h b/src/hash/hash.h index 95d12806f..881e23817 100644 --- a/src/hash/hash.h +++ b/src/hash/hash.h @@ -23,7 +23,7 @@ class BOTAN_DLL HashFunction : public BufferedComputation * @param hash_len the output length * @param block_len the internal block size (if applicable) */ - HashFunction(u32bit hash_len) : BufferedComputation(hash_len) {} + HashFunction(size_t hash_len) : BufferedComputation(hash_len) {} virtual ~HashFunction() {} diff --git a/src/hash/mdx_hash/mdx_hash.h b/src/hash/mdx_hash/mdx_hash.h index 5591f2b80..d1260180e 100644 --- a/src/hash/mdx_hash/mdx_hash.h +++ b/src/hash/mdx_hash/mdx_hash.h @@ -64,7 +64,7 @@ class BOTAN_DLL MDx_HashFunction : public HashFunction size_t position; const bool BIG_BYTE_ENDIAN, BIG_BIT_ENDIAN; - const u32bit COUNT_SIZE; + const size_t COUNT_SIZE; }; } diff --git a/src/hash/skein/skein_512.cpp b/src/hash/skein/skein_512.cpp index 0ff8e9605..b2316242a 100644 --- a/src/hash/skein/skein_512.cpp +++ b/src/hash/skein/skein_512.cpp @@ -133,14 +133,14 @@ void reset_tweak(MemoryRegion<u64bit>& T, void initial_block(MemoryRegion<u64bit>& H, MemoryRegion<u64bit>& T, - u32bit output_bits, + size_t output_bits, const std::string& personalization) { zeroise(H); // ASCII("SHA3") followed by version (0x0001) code byte config_str[32] = { 0x53, 0x48, 0x41, 0x33, 0x01, 0x00, 0 }; - store_le(output_bits, config_str + 8); + store_le(u32bit(output_bits), config_str + 8); reset_tweak(T, SKEIN_CONFIG, true); ubi_512(H, T, config_str, sizeof(config_str)); @@ -166,14 +166,14 @@ void initial_block(MemoryRegion<u64bit>& H, } -Skein_512::Skein_512(u32bit arg_output_bits, +Skein_512::Skein_512(size_t arg_output_bits, const std::string& arg_personalization) : HashFunction(arg_output_bits / 8), personalization(arg_personalization), output_bits(arg_output_bits), H(9), T(3), buffer(64), buf_pos(0) { - if(output_bits == 0 || output_bits % 8 != 0) + if(output_bits == 0 || output_bits % 8 != 0 || output_bits > 64*1024) throw Invalid_Argument("Bad output bits size for Skein-512"); initial_block(H, T, output_bits, personalization); diff --git a/src/hash/skein/skein_512.h b/src/hash/skein/skein_512.h index fce02c1f6..54cdd002c 100644 --- a/src/hash/skein/skein_512.h +++ b/src/hash/skein/skein_512.h @@ -25,7 +25,7 @@ class BOTAN_DLL Skein_512 : public HashFunction * @param personalization is a string that will paramaterize the * hash output */ - Skein_512(u32bit output_bits = 512, + Skein_512(size_t output_bits = 512, const std::string& personalization = ""); size_t hash_block_size() const { return 64; } |