aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/block/idea_sse2
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/block/idea_sse2')
-rw-r--r--src/lib/block/idea_sse2/idea_sse2.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/block/idea_sse2/idea_sse2.cpp b/src/lib/block/idea_sse2/idea_sse2.cpp
index a2a54ac32..51b5e909b 100644
--- a/src/lib/block/idea_sse2/idea_sse2.cpp
+++ b/src/lib/block/idea_sse2/idea_sse2.cpp
@@ -7,6 +7,7 @@
#include <botan/idea_sse2.h>
#include <botan/cpuid.h>
+#include <botan/internal/ct_utils.h>
#include <emmintrin.h>
namespace Botan {
@@ -130,6 +131,10 @@ void transpose_out(__m128i& B0, __m128i& B1, __m128i& B2, __m128i& B3)
*/
void idea_op_8(const byte in[64], byte out[64], const u16bit EK[52])
{
+ BOTAN_CONST_TIME_POISON(in, 64);
+ BOTAN_CONST_TIME_POISON(out, 64);
+ BOTAN_CONST_TIME_POISON(EK, 52*2);
+
const __m128i* in_mm = reinterpret_cast<const __m128i*>(in);
__m128i B0 = _mm_loadu_si128(in_mm + 0);
@@ -153,7 +158,6 @@ void idea_op_8(const byte in[64], byte out[64], const u16bit EK[52])
B3 = mul(B3, EK[6*i+3]);
__m128i T0 = B2;
-
B2 = _mm_xor_si128(B2, B0);
B2 = mul(B2, EK[6*i+4]);
@@ -190,6 +194,10 @@ void idea_op_8(const byte in[64], byte out[64], const u16bit EK[52])
_mm_storeu_si128(out_mm + 1, B2);
_mm_storeu_si128(out_mm + 2, B1);
_mm_storeu_si128(out_mm + 3, B3);
+
+ BOTAN_CONST_TIME_UNPOISON(in, 64);
+ BOTAN_CONST_TIME_UNPOISON(out, 64);
+ BOTAN_CONST_TIME_UNPOISON(EK, 52*2);
}
}