aboutsummaryrefslogtreecommitdiffstats
path: root/src/block/lion
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-08-31 18:19:09 +0000
committerlloyd <[email protected]>2009-08-31 18:19:09 +0000
commitde705485bccc89a695488ebe69b744433388bf21 (patch)
tree380aa58e6b45352bdb5813ab5106fc163f636ca6 /src/block/lion
parent7c35179056ef9f223eb3ad4c20e16ed8f8540bbb (diff)
Hoist creation of buffer in Lion encrypt loop
Diffstat (limited to 'src/block/lion')
-rw-r--r--src/block/lion/lion.cpp8
1 files changed, 4 insertions, 4 deletions
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<byte> buffer(LEFT_SIZE);
+
for(u32bit i = 0; i != blocks; ++i)
{
- SecureVector<byte> 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<byte> buffer(LEFT_SIZE);
+
for(u32bit i = 0; i != blocks; ++i)
{
- SecureVector<byte> 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);