From 113f4035f41cf3152832e1753d28b79a7ea811a4 Mon Sep 17 00:00:00 2001 From: lloyd Date: Fri, 25 May 2012 02:11:10 +0000 Subject: For block and stream ciphers, don't set the size of the key vectors until we are actually setting a key. This avoids the problem of prototype objects consuming not just memory but the precious few bytes of mlock'able memory that we're given by Linux. Use clear_mem instead of a loop in BigInt::mask_bits If OS2ECP encounters an invalid format type, include what type it was in the exception message. --- src/block/tea/tea.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/block/tea/tea.h') diff --git a/src/block/tea/tea.h b/src/block/tea/tea.h index 5d418e084..d2f81da17 100644 --- a/src/block/tea/tea.h +++ b/src/block/tea/tea.h @@ -21,11 +21,9 @@ 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); secure_vector K; -- cgit v1.2.3