From e28ec42ac22e5e7d41190e6b5d840496ccbf2b42 Mon Sep 17 00:00:00 2001 From: Logan007 Date: Wed, 3 Jun 2020 21:57:49 +0545 Subject: [PATCH] added SSE support --- speck.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/speck.h b/speck.h index 836e06d..c44c6b4 100644 --- a/speck.h +++ b/speck.h @@ -1,9 +1,20 @@ #define u64 uint64_t +#ifdef __SSE4_2__ + #include + #define u128 __m128i +typedef struct { + u128 rk[34]; + u64 key[34]; +} speck_context_t; +#else + typedef u64 speck_context_t [34]; +#endif + int speck_ctr (unsigned char *out, const unsigned char *in, unsigned long long inlen, const unsigned char *n, - u64 rk[]); + speck_context_t ctx); -int speck_expand_key (const unsigned char *k, u64 rk[]); +int speck_expand_key (const unsigned char *k, speck_context_t ctx);