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/block/gost_28147 | |
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/block/gost_28147')
-rw-r--r-- | src/block/gost_28147/gost_28147.cpp | 2 | ||||
-rw-r--r-- | src/block/gost_28147/gost_28147.h | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/block/gost_28147/gost_28147.cpp b/src/block/gost_28147/gost_28147.cpp index 3844fd441..8d7e950c6 100644 --- a/src/block/gost_28147/gost_28147.cpp +++ b/src/block/gost_28147/gost_28147.cpp @@ -52,7 +52,7 @@ GOST_28147_89_Params::GOST_28147_89_Params(const std::string& n) : name(n) * GOST Constructor */ GOST_28147_89::GOST_28147_89(const GOST_28147_89_Params& param) : - BlockCipher(8, 32) + BlockCipher(8, 32), SBOX(1024), EK(8) { // Convert the parallel 4x4 sboxes into larger word-based sboxes for(size_t i = 0; i != 4; ++i) diff --git a/src/block/gost_28147/gost_28147.h b/src/block/gost_28147/gost_28147.h index 9d845ae72..501e621e0 100644 --- a/src/block/gost_28147/gost_28147.h +++ b/src/block/gost_28147/gost_28147.h @@ -65,13 +65,13 @@ class BOTAN_DLL GOST_28147_89 : public BlockCipher */ GOST_28147_89(const GOST_28147_89_Params& params); private: - GOST_28147_89(const SecureVector<u32bit, 1024>& other_SBOX) : - BlockCipher(8, 32), SBOX(other_SBOX) {} + GOST_28147_89(const SecureVector<u32bit>& other_SBOX) : + BlockCipher(8, 32), SBOX(other_SBOX), EK(8) {} void key_schedule(const byte[], u32bit); - SecureVector<u32bit, 1024> SBOX; - SecureVector<u32bit, 8> EK; + SecureVector<u32bit> SBOX; + SecureVector<u32bit> EK; }; } |