aboutsummaryrefslogtreecommitdiffstats
path: root/src/block/mars
diff options
context:
space:
mode:
Diffstat (limited to 'src/block/mars')
-rw-r--r--src/block/mars/mars.cpp4
-rw-r--r--src/block/mars/mars.h6
2 files changed, 5 insertions, 5 deletions
diff --git a/src/block/mars/mars.cpp b/src/block/mars/mars.cpp
index 171ce2945..5badc40cc 100644
--- a/src/block/mars/mars.cpp
+++ b/src/block/mars/mars.cpp
@@ -320,12 +320,14 @@ void MARS::decrypt_n(const byte in[], byte out[], size_t blocks) const
*/
void MARS::key_schedule(const byte key[], size_t length)
{
- SecureVector<u32bit> T(15);
+ secure_vector<u32bit> T(15);
for(size_t i = 0; i != length / 4; ++i)
T[i] = load_le<u32bit>(key, i);
T[length / 4] = static_cast<u32bit>(length) / 4;
+ EK.resize(40);
+
for(u32bit i = 0; i != 4; ++i)
{
T[ 0] ^= rotate_left(T[ 8] ^ T[13], 3) ^ (i );
diff --git a/src/block/mars/mars.h b/src/block/mars/mars.h
index 5ca05f886..488ea1b83 100644
--- a/src/block/mars/mars.h
+++ b/src/block/mars/mars.h
@@ -21,15 +21,13 @@ class BOTAN_DLL MARS : public Block_Cipher_Fixed_Params<16, 16, 32, 4>
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(EK); }
+ void clear() { EK.clear(); }
std::string name() const { return "MARS"; }
BlockCipher* clone() const { return new MARS; }
-
- MARS() : EK(40) {}
private:
void key_schedule(const byte[], size_t);
- SecureVector<u32bit> EK;
+ secure_vector<u32bit> EK;
};
}