From 84f389d6d44259b1ac5826363dd5ac714a64d9bd Mon Sep 17 00:00:00 2001 From: Logan007 Date: Sun, 7 Jun 2020 19:36:58 +0545 Subject: [PATCH] fixed compile warnings / errors --- speck.c | 25 +------------------------ speck.h | 1 + 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/speck.c b/speck.c index a15ecee..dfdbeeb 100644 --- a/speck.c +++ b/speck.c @@ -8,15 +8,12 @@ #include "speck.h" + #if defined (__AVX2__) // AVX support ---------------------------------------------------- #include -#define u32 uint32_t -#define u64 uint64_t -#define u256 __m256i - #define LCS(x,r) (((x)<>(64-r))) #define RCS(x,r) (((x)>>r)|((x)<<(64-r))) @@ -220,12 +217,6 @@ int speck_expand_key (const unsigned char *k, speck_context_t *ctx) { #include -#define SPECK_CTX_BYVAL 1 - -#define u32 unsigned -#define u64 unsigned long long -#define u128 __m128i - #define LCS(x,r) (((x)<>(64-r))) #define RCS(x,r) (((x)>>r)|((x)<<(64-r))) @@ -295,11 +286,6 @@ int speck_expand_key (const unsigned char *k, speck_context_t *ctx) { RK(B,A,k,key,21), RK(C,A,k,key,22), RK(D,A,k,key,23), RK(B,A,k,key,24), RK(C,A,k,key,25), RK(D,A,k,key,26), RK(B,A,k,key,27), \ RK(C,A,k,key,28), RK(D,A,k,key,29), RK(B,A,k,key,30), RK(C,A,k,key,31), RK(D,A,k,key,32), RK(B,A,k,key,33)) -typedef struct { - u128 rk[34]; - u64 key[34]; -} speck_context_t; - static int speck_encrypt_xor (unsigned char *out, const unsigned char *in, u64 nonce[], const speck_context_t ctx, int numbytes) { @@ -415,10 +401,6 @@ int speck_expand_key (const unsigned char *k, speck_context_t *ctx) { #include -#define u32 uint32_t -#define u64 uint64_t -#define u128 uint64x2_t - #define LCS(x,r) (((x)<>(64-r))) #define RCS(x,r) (((x)>>r)|((x)<<(64-r))) @@ -479,11 +461,6 @@ int speck_expand_key (const unsigned char *k, speck_context_t *ctx) { RK(B,A,k,key,21), RK(C,A,k,key,22), RK(D,A,k,key,23), RK(B,A,k,key,24), RK(C,A,k,key,25), RK(D,A,k,key,26), RK(B,A,k,key,27), \ RK(C,A,k,key,28), RK(D,A,k,key,29), RK(B,A,k,key,30), RK(C,A,k,key,31), RK(D,A,k,key,32), RK(B,A,k,key,33)) -typedef struct { - u128 rk[34]; - u64 key[34]; -} speck_context_t; - static int speck_encrypt_xor (unsigned char *out, const unsigned char *in, u64 nonce[], speck_context_t *ctx, int numbytes) { diff --git a/speck.h b/speck.h index df5ab58..ff92a5f 100644 --- a/speck.h +++ b/speck.h @@ -7,6 +7,7 @@ #define htole64(x) OSSwapHostToLittleInt64(x) #endif +#define u32 uint32_t #define u64 uint64_t #if defined (__AVX2__)