You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
846 B

4 years ago
#define u64 uint64_t
#if defined (__AVX2__)
#define SPECK_ALIGNED_CTX 32
#include <immintrin.h>
#define u256 __m256i
typedef struct {
u256 rk[34];
u64 key[34];
} speck_context_t;
#elif defined (__SSE4_2__)
#define SPECK_ALIGNED_CTX 16
#include <immintrin.h>
#define u128 __m128i
typedef struct {
u128 rk[34];
u64 key[34];
} speck_context_t;
#elif defined (__ARM_NEON)
#include <arm_neon.h>
#define u128 uint64x2_t
typedef struct {
u128 rk[34];
u64 key[34];
} speck_context_t;
#else
typedef struct {
u64 key[34];
} speck_context_t;
#endif
4 years ago
int speck_ctr (unsigned char *out, const unsigned char *in,
unsigned long long inlen,
const unsigned char *n,
speck_context_t *ctx);
4 years ago
int speck_expand_key (const unsigned char *k, speck_context_t *ctx);