From ae59295ea945fdcc482df2233409a5f878fa20c7 Mon Sep 17 00:00:00 2001 From: lloyd Date: Tue, 14 Sep 2010 01:16:32 +0000 Subject: 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. --- src/stream/wid_wake/wid_wake.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/stream/wid_wake/wid_wake.h') diff --git a/src/stream/wid_wake/wid_wake.h b/src/stream/wid_wake/wid_wake.h index 365a6d9ff..88f5690bf 100644 --- a/src/stream/wid_wake/wid_wake.h +++ b/src/stream/wid_wake/wid_wake.h @@ -30,16 +30,21 @@ class BOTAN_DLL WiderWake_41_BE : public StreamCipher void clear(); std::string name() const { return "WiderWake4+1-BE"; } StreamCipher* clone() const { return new WiderWake_41_BE; } - WiderWake_41_BE() : StreamCipher(16, 16, 1) {} + + WiderWake_41_BE() : StreamCipher(16, 16, 1), + T(256), state(5), t_key(4), + buffer(DEFAULT_BUFFERSIZE), position(0) + { } + private: void key_schedule(const byte[], u32bit); void generate(u32bit); - SecureVector buffer; - SecureVector T; - SecureVector state; - SecureVector t_key; + SecureVector T; + SecureVector state; + SecureVector t_key; + SecureVector buffer; u32bit position; }; -- cgit v1.2.3