n2n/speck.h

21 lines
453 B
C
Raw Normal View History

2020-05-27 23:32:21 +02:00
#define u64 uint64_t
2020-06-03 18:12:49 +02:00
#ifdef __SSE4_2__
#include <immintrin.h>
#define u128 __m128i
typedef struct {
u128 rk[34];
u64 key[34];
} speck_context_t;
#else
typedef u64 speck_context_t [34];
#endif
2020-05-27 23:32:21 +02:00
int speck_ctr (unsigned char *out, const unsigned char *in,
unsigned long long inlen,
const unsigned char *n,
2020-06-03 18:12:49 +02:00
speck_context_t ctx);
2020-05-27 23:32:21 +02:00
2020-06-03 18:12:49 +02:00
int speck_expand_key (const unsigned char *k, speck_context_t ctx);