From 4cab23ad4e0541740fc6a1ccd52bfcecfa9226e1 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Tue, 10 Sep 2024 16:23:36 +0200 Subject: [PATCH] Move definitions up --- src/common/softaes.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/common/softaes.c b/src/common/softaes.c index 26da0bc..3e7b967 100644 --- a/src/common/softaes.c +++ b/src/common/softaes.c @@ -6,6 +6,18 @@ #include "common.h" #include "softaes.h" +#if defined(__wasm__) && !defined(FAVOR_PERFORMANCE) +# define FAVOR_PERFORMANCE +#endif + +#ifndef SOFTAES_STRIDE +# ifdef FAVOR_PERFORMANCE +# define SOFTAES_STRIDE 256 +# else +# define SOFTAES_STRIDE 16 +# endif +#endif + uint32_t _aes_lut[256] __attribute__((visibility("hidden"))) = { 0xa56363c6, 0x847c7cf8, 0x997777ee, 0x8d7b7bf6, 0x0df2f2ff, 0xbd6b6bd6, 0xb16f6fde, 0x54c5c591, 0x50303060, 0x03010102, 0xa96767ce, 0x7d2b2b56, 0x19fefee7, 0x62d7d7b5, 0xe6abab4d, 0x9a7676ec, @@ -43,18 +55,6 @@ uint32_t _aes_lut[256] __attribute__((visibility("hidden"))) = { static const uint32_t* const LUT = _aes_lut; -#if defined(__wasm__) && !defined(FAVOR_PERFORMANCE) -# define FAVOR_PERFORMANCE -#endif - -#ifndef SOFTAES_STRIDE -# ifdef FAVOR_PERFORMANCE -# define SOFTAES_STRIDE 256 -# else -# define SOFTAES_STRIDE 16 -# endif -#endif - static SoftAesBlock _encrypt(const uint8_t ix0[4], const uint8_t ix1[4], const uint8_t ix2[4], const uint8_t ix3[4]) {