diff options
Diffstat (limited to 'src/block/tea')
-rw-r--r-- | src/block/tea/tea.cpp | 1 | ||||
-rw-r--r-- | src/block/tea/tea.h | 6 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/block/tea/tea.cpp b/src/block/tea/tea.cpp index 4ef995a7c..e45f7cb48 100644 --- a/src/block/tea/tea.cpp +++ b/src/block/tea/tea.cpp @@ -65,6 +65,7 @@ void TEA::decrypt_n(const byte in[], byte out[], size_t blocks) const */ void TEA::key_schedule(const byte key[], size_t) { + K.resize(4); for(size_t i = 0; i != 4; ++i) K[i] = load_be<u32bit>(key, i); } diff --git a/src/block/tea/tea.h b/src/block/tea/tea.h index 0290b112f..d2f81da17 100644 --- a/src/block/tea/tea.h +++ b/src/block/tea/tea.h @@ -21,14 +21,12 @@ class BOTAN_DLL TEA : public Block_Cipher_Fixed_Params<8, 16> void encrypt_n(const byte in[], byte out[], size_t blocks) const; void decrypt_n(const byte in[], byte out[], size_t blocks) const; - void clear() { zeroise(K); } + void clear() { K.clear(); } std::string name() const { return "TEA"; } BlockCipher* clone() const { return new TEA; } - - TEA() : K(4) {} private: void key_schedule(const byte[], size_t); - SecureVector<u32bit> K; + secure_vector<u32bit> K; }; } |