From 1c9b4fda79951b1d0cd3c49ad8db8549cf9d9444 Mon Sep 17 00:00:00 2001 From: lloyd Date: Wed, 12 Aug 2009 18:19:39 +0000 Subject: For handling the last few blocks in Serpent_SSE2, invoke encrypt_n with however many blocks remain, rather than looping calling encrypt_n with a block size of 1 each time. --- src/block/serpent_sse2/serp_sse2.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/block/serpent_sse2/serp_sse2.cpp b/src/block/serpent_sse2/serp_sse2.cpp index a3319afec..c51bb69ab 100644 --- a/src/block/serpent_sse2/serp_sse2.cpp +++ b/src/block/serpent_sse2/serp_sse2.cpp @@ -218,12 +218,7 @@ void Serpent_SSE2::encrypt_n(const byte in[], byte out[], u32bit blocks) const blocks -= 4; } - for(u32bit i = 0; i != blocks; ++i) - { - Serpent::encrypt_n(in, out, 1); - in += BLOCK_SIZE; - out += BLOCK_SIZE; - } + Serpent::encrypt_n(in, out, blocks); } /* @@ -239,12 +234,7 @@ void Serpent_SSE2::decrypt_n(const byte in[], byte out[], u32bit blocks) const blocks -= 4; } - for(u32bit i = 0; i != blocks; ++i) - { - Serpent::decrypt_n(in, out, 1); - in += BLOCK_SIZE; - out += BLOCK_SIZE; - } + Serpent::decrypt_n(in, out, blocks); } } -- cgit v1.2.3