From de705485bccc89a695488ebe69b744433388bf21 Mon Sep 17 00:00:00 2001 From: lloyd Date: Mon, 31 Aug 2009 18:19:09 +0000 Subject: Hoist creation of buffer in Lion encrypt loop --- src/block/lion/lion.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/block') diff --git a/src/block/lion/lion.cpp b/src/block/lion/lion.cpp index bfff64b67..83c1e3aa3 100644 --- a/src/block/lion/lion.cpp +++ b/src/block/lion/lion.cpp @@ -16,10 +16,10 @@ namespace Botan { */ void Lion::encrypt_n(const byte in[], byte out[], u32bit blocks) const { + SecureVector buffer(LEFT_SIZE); + for(u32bit i = 0; i != blocks; ++i) { - SecureVector buffer(LEFT_SIZE); - xor_buf(buffer, in, key1, LEFT_SIZE); cipher->set_key(buffer, LEFT_SIZE); cipher->encrypt(in + LEFT_SIZE, out + LEFT_SIZE, RIGHT_SIZE); @@ -42,10 +42,10 @@ void Lion::encrypt_n(const byte in[], byte out[], u32bit blocks) const */ void Lion::decrypt_n(const byte in[], byte out[], u32bit blocks) const { + SecureVector buffer(LEFT_SIZE); + for(u32bit i = 0; i != blocks; ++i) { - SecureVector buffer(LEFT_SIZE); - xor_buf(buffer, in, key2, LEFT_SIZE); cipher->set_key(buffer, LEFT_SIZE); cipher->encrypt(in + LEFT_SIZE, out + LEFT_SIZE, RIGHT_SIZE); -- cgit v1.2.3