aboutsummaryrefslogtreecommitdiffstats
path: root/src/stream/salsa20
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-09-14 01:16:32 +0000
committerlloyd <[email protected]>2010-09-14 01:16:32 +0000
commitae59295ea945fdcc482df2233409a5f878fa20c7 (patch)
tree768c30635a17847dccb6db6f36fa3b033adc37bf /src/stream/salsa20
parent548f48611760346fa2e47efd5c0865eff831946a (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/stream/salsa20')
-rw-r--r--src/stream/salsa20/salsa20.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/stream/salsa20/salsa20.h b/src/stream/salsa20/salsa20.h
index 4ba483082..7e6c523cd 100644
--- a/src/stream/salsa20/salsa20.h
+++ b/src/stream/salsa20/salsa20.h
@@ -29,13 +29,13 @@ class BOTAN_DLL Salsa20 : public StreamCipher
std::string name() const;
StreamCipher* clone() const { return new Salsa20; }
- Salsa20() : StreamCipher(16, 32, 16) { position = 0; }
+ Salsa20() : StreamCipher(16, 32, 16), state(16), buffer(64) { position = 0; }
~Salsa20() { clear(); }
private:
void key_schedule(const byte key[], u32bit key_len);
- SecureVector<u32bit, 16> state;
- SecureVector<byte, 64> buffer;
+ SecureVector<u32bit> state;
+ SecureVector<byte> buffer;
u32bit position;
};