diff options
author | lloyd <[email protected]> | 2010-09-14 01:16:32 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-09-14 01:16:32 +0000 |
commit | ae59295ea945fdcc482df2233409a5f878fa20c7 (patch) | |
tree | 768c30635a17847dccb6db6f36fa3b033adc37bf /src/hash/skein | |
parent | 548f48611760346fa2e47efd5c0865eff831946a (diff) |
Completely remove the second parameter to SecureVector which specifies
the initial/default length of the array, update all users to instead
pass the value to the constructor.
This is a old vestigal thing from a class (SecureBuffer) that used
this compile-time constant in order to store the values in an
array. However this was changed way back in 2002 to use the same
allocator hooks as the rest of the containers, so the only advantage
to using the length field was that the initial length was set and
didn't have to be set in the constructor which was midly convenient.
However this directly conflicts with the desire to be able to
(eventually) use std::vector with a custom allocator, since of course
vector doesn't support this.
Fortunately almost all of the uses are in classes which have only a
single constructor, so there is little to no duplication by instead
initializing the size in the constructor.
Diffstat (limited to 'src/hash/skein')
-rw-r--r-- | src/hash/skein/skein_512.cpp | 6 | ||||
-rw-r--r-- | src/hash/skein/skein_512.h | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/hash/skein/skein_512.cpp b/src/hash/skein/skein_512.cpp index 5aa49ab7a..a3aff52ab 100644 --- a/src/hash/skein/skein_512.cpp +++ b/src/hash/skein/skein_512.cpp @@ -170,12 +170,12 @@ Skein_512::Skein_512(u32bit arg_output_bits, const std::string& arg_personalization) : HashFunction(arg_output_bits / 8, 64), personalization(arg_personalization), - output_bits(arg_output_bits) + output_bits(arg_output_bits), + H(9), T(3), buffer(64), buf_pos(0) { if(output_bits == 0 || output_bits % 8 != 0) throw Invalid_Argument("Bad output bits size for Skein-512"); - buf_pos = 0; initial_block(H, T, output_bits, personalization); } @@ -239,7 +239,7 @@ void Skein_512::final_result(byte out[]) u32bit out_bytes = output_bits / 8; - SecureVector<u64bit, 9> H_out; + SecureVector<u64bit> H_out(9); while(out_bytes) { diff --git a/src/hash/skein/skein_512.h b/src/hash/skein/skein_512.h index 5d17fa564..811b633eb 100644 --- a/src/hash/skein/skein_512.h +++ b/src/hash/skein/skein_512.h @@ -37,10 +37,10 @@ class BOTAN_DLL Skein_512 : public HashFunction std::string personalization; u32bit output_bits; - SecureVector<u64bit, 9> H; - SecureVector<u64bit, 3> T; - SecureVector<byte, 64> buffer; + SecureVector<u64bit> H; + SecureVector<u64bit> T; + SecureVector<byte> buffer; u32bit buf_pos; }; |