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/kasumi | |
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/kasumi')
-rw-r--r-- | src/block/kasumi/kasumi.cpp | 2 | ||||
-rw-r--r-- | src/block/kasumi/kasumi.h | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/block/kasumi/kasumi.cpp b/src/block/kasumi/kasumi.cpp index 8dcdff716..023a7a503 100644 --- a/src/block/kasumi/kasumi.cpp +++ b/src/block/kasumi/kasumi.cpp @@ -204,7 +204,7 @@ void KASUMI::key_schedule(const byte key[], u32bit) static const u16bit RC[] = { 0x0123, 0x4567, 0x89AB, 0xCDEF, 0xFEDC, 0xBA98, 0x7654, 0x3210 }; - SecureVector<u16bit, 16> K; + SecureVector<u16bit> K(16); for(u32bit j = 0; j != 8; ++j) { K[j] = load_be<u16bit>(key, j); diff --git a/src/block/kasumi/kasumi.h b/src/block/kasumi/kasumi.h index f8575c2d2..51727dd4d 100644 --- a/src/block/kasumi/kasumi.h +++ b/src/block/kasumi/kasumi.h @@ -25,11 +25,11 @@ class BOTAN_DLL KASUMI : public BlockCipher std::string name() const { return "KASUMI"; } BlockCipher* clone() const { return new KASUMI; } - KASUMI() : BlockCipher(8, 16) {} + KASUMI() : BlockCipher(8, 16), EK(64) {} private: void key_schedule(const byte[], u32bit); - SecureVector<u16bit, 64> EK; + SecureVector<u16bit> EK; }; } |