aboutsummaryrefslogtreecommitdiffstats
path: root/src/stream/wid_wake
diff options
context:
space:
mode:
Diffstat (limited to 'src/stream/wid_wake')
-rw-r--r--src/stream/wid_wake/wid_wake.cpp13
-rw-r--r--src/stream/wid_wake/wid_wake.h12
2 files changed, 13 insertions, 12 deletions
diff --git a/src/stream/wid_wake/wid_wake.cpp b/src/stream/wid_wake/wid_wake.cpp
index 51159064d..e4ab6477f 100644
--- a/src/stream/wid_wake/wid_wake.cpp
+++ b/src/stream/wid_wake/wid_wake.cpp
@@ -74,6 +74,10 @@ void WiderWake_41_BE::generate(size_t length)
*/
void WiderWake_41_BE::key_schedule(const byte key[], size_t)
{
+ t_key.resize(4);
+ state.resize(5);
+ buffer.resize(DEFAULT_BUFFERSIZE);
+
for(size_t i = 0; i != 4; ++i)
t_key[i] = load_be<u32bit>(key, i);
@@ -81,6 +85,7 @@ void WiderWake_41_BE::key_schedule(const byte key[], size_t)
0x726A8F3B, 0xE69A3B5C, 0xD3C71FE5, 0xAB3C73D2,
0x4D3A8EB3, 0x0396D6E8, 0x3D4C2F7A, 0x9EE27CF3 };
+ T.resize(256);
for(size_t i = 0; i != 4; ++i)
T[i] = t_key[i];
@@ -143,10 +148,10 @@ void WiderWake_41_BE::set_iv(const byte iv[], size_t length)
void WiderWake_41_BE::clear()
{
position = 0;
- zeroise(t_key);
- zeroise(state);
- zeroise(T);
- zeroise(buffer);
+ t_key.clear();
+ state.clear();
+ T.clear();
+ buffer.clear();
}
}
diff --git a/src/stream/wid_wake/wid_wake.h b/src/stream/wid_wake/wid_wake.h
index 05842a574..501345011 100644
--- a/src/stream/wid_wake/wid_wake.h
+++ b/src/stream/wid_wake/wid_wake.h
@@ -36,19 +36,15 @@ class BOTAN_DLL WiderWake_41_BE : public StreamCipher
std::string name() const { return "WiderWake4+1-BE"; }
StreamCipher* clone() const { return new WiderWake_41_BE; }
- WiderWake_41_BE() : T(256), state(5), t_key(4),
- buffer(DEFAULT_BUFFERSIZE), position(0)
- {}
-
private:
void key_schedule(const byte[], size_t);
void generate(size_t);
- SecureVector<u32bit> T;
- SecureVector<u32bit> state;
- SecureVector<u32bit> t_key;
- SecureVector<byte> buffer;
+ secure_vector<u32bit> T;
+ secure_vector<u32bit> state;
+ secure_vector<u32bit> t_key;
+ secure_vector<byte> buffer;
size_t position;
};