diff --git a/wolfcrypt/src/ascon.c b/wolfcrypt/src/ascon.c index 4da892c53..775614a7b 100644 --- a/wolfcrypt/src/ascon.c +++ b/wolfcrypt/src/ascon.c @@ -48,6 +48,10 @@ * - Add support for big-endian systems * - Add support for 32-bit and smaller systems */ +#ifndef WORD64_AVAILABLE + #error "Ascon implementation requires a 64-bit word" +#endif + /* Data block size in bytes */ #define ASCON_HASH256_RATE 8 #define ASCON_HASH256_ROUNDS 12 diff --git a/wolfssl/wolfcrypt/ascon.h b/wolfssl/wolfcrypt/ascon.h index 3e95d521f..52cb889f7 100644 --- a/wolfssl/wolfcrypt/ascon.h +++ b/wolfssl/wolfcrypt/ascon.h @@ -37,7 +37,9 @@ extern "C" { #define ASCON_AEAD128_TAG_SZ 16 typedef union AsconState { +#ifdef WORD64_AVAILABLE word64 s64[5]; +#endif word32 s32[10]; word16 s16[20]; byte s8[40]; @@ -56,7 +58,9 @@ enum { typedef struct wc_AsconAEAD128 { /* needed throughout both encrypt and decrypt */ +#ifdef WORD64_AVAILABLE word64 key[ASCON_AEAD128_KEY_SZ/sizeof(word64)]; +#endif AsconState state; byte lastBlkSz; byte KeySet:1; /* has the key been processed */