Skip to content

Commit 068a3b5

Browse files
authored
Merge pull request #7481 from douzzer/20240424-sha-C-dynamic-fallback
20240424-sha-C-dynamic-fallback
2 parents 5cc0595 + bb4c2cb commit 068a3b5

20 files changed

Lines changed: 527 additions & 234 deletions

File tree

configure.ac

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2993,7 +2993,7 @@ then
29932993
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AESNI"
29942994
if test "$ENABLED_LINUXKM_DEFAULTS" = "yes"
29952995
then
2996-
AM_CFLAGS="$AM_CFLAGS -DWC_AES_C_DYNAMIC_FALLBACK"
2996+
AM_CFLAGS="$AM_CFLAGS -DWC_C_DYNAMIC_FALLBACK"
29972997
fi
29982998
if test "$CC" != "icc"
29992999
then
@@ -3852,6 +3852,17 @@ then
38523852
ENABLED_CURVE25519=yes
38533853
fi
38543854

3855+
if test "$ENABLED_CURVE25519" = "noasm"
3856+
then
3857+
AM_CFLAGS="$AM_CFLAGS -DNO_CURVED25519_X64"
3858+
fi
3859+
3860+
if test "$ENABLED_CURVE25519" = "yes" && test "$ENABLED_LINUXKM_DEFAULTS" = "yes"
3861+
then
3862+
ENABLED_CURVE25519=noasm
3863+
AM_CFLAGS="$AM_CFLAGS -DNO_CURVED25519_X64"
3864+
fi
3865+
38553866
AM_CFLAGS="$AM_CFLAGS -DHAVE_CURVE25519"
38563867
AM_CCASFLAGS="$AM_CCASFLAGS -DHAVE_CURVE25519"
38573868
ENABLED_FEMATH=yes
@@ -5008,7 +5019,7 @@ AS_CASE([$FIPS_VERSION],
50085019
50095020
AS_IF([test "x$ENABLED_ED25519" != "xyes"],
50105021
[ENABLED_ED25519="yes"; AM_CFLAGS="$AM_CFLAGS -DHAVE_ED25519 -DHAVE_ED25519_KEY_IMPORT"])
5011-
AS_IF([test "x$ENABLED_CURVE25519" != "xyes"],
5022+
AS_IF([test "$ENABLED_CURVE25519" = "no"],
50125023
[ENABLED_CURVE25519="yes"; AM_CFLAGS="$AM_CFLAGS -DHAVE_CURVE25519"])
50135024
50145025
AS_IF([test "x$ENABLED_ED448" != "xyes"],
@@ -6047,7 +6058,7 @@ then
60476058
ENABLED_ENCRYPT_THEN_MAC=yes
60486059
AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_SNI -DHAVE_MAX_FRAGMENT -DHAVE_TRUNCATED_HMAC -DHAVE_ALPN -DHAVE_TRUSTED_CA"
60496060
# Check the ECC supported curves prereq
6050-
AS_IF([test "x$ENABLED_ECC" != "xno" || test "x$ENABLED_CURVE25519" = "xyes" || test "x$ENABLED_CURVE448" = "xyes" || test "x$ENABLED_TLS13" = "xyes"],
6061+
AS_IF([test "x$ENABLED_ECC" != "xno" || test "$ENABLED_CURVE25519" != "no" || test "x$ENABLED_CURVE448" = "xyes" || test "x$ENABLED_TLS13" = "xyes"],
60516062
[ENABLED_SUPPORTED_CURVES=yes
60526063
AM_CFLAGS="$AM_CFLAGS -DHAVE_SUPPORTED_CURVES"])
60536064
fi
@@ -6880,7 +6891,7 @@ then
68806891
AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_SNI -DHAVE_MAX_FRAGMENT -DHAVE_TRUNCATED_HMAC"
68816892
68826893
# Check the ECC supported curves prereq
6883-
AS_IF([test "x$ENABLED_ECC" != "xno" || test "x$ENABLED_CURVE25519" = "xyes"],
6894+
AS_IF([test "x$ENABLED_ECC" != "xno" || test "$ENABLED_CURVE25519" != "no"],
68846895
[ENABLED_SUPPORTED_CURVES=yes
68856896
AM_CFLAGS="$AM_CFLAGS -DHAVE_SUPPORTED_CURVES"])
68866897
fi
@@ -9337,7 +9348,8 @@ AM_CONDITIONAL([BUILD_ED25519],[test "x$ENABLED_ED25519" = "xyes" || test "x$ENA
93379348
AM_CONDITIONAL([BUILD_ED25519_SMALL],[test "x$ENABLED_ED25519_SMALL" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
93389349
AM_CONDITIONAL([BUILD_FEMATH], [test "x$ENABLED_FEMATH" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
93399350
AM_CONDITIONAL([BUILD_GEMATH], [test "x$ENABLED_GEMATH" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
9340-
AM_CONDITIONAL([BUILD_CURVE25519],[test "x$ENABLED_CURVE25519" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
9351+
AM_CONDITIONAL([BUILD_CURVE25519],[test "$ENABLED_CURVE25519" != "no" || test "x$ENABLED_USERSETTINGS" = "xyes"])
9352+
AM_CONDITIONAL([BUILD_CURVE25519_INTELASM],[test "$ENABLED_CURVE25519" != "noasm" && test "$ENABLED_INTELASM" = "yes"])
93419353
AM_CONDITIONAL([BUILD_CURVE25519_SMALL],[test "x$ENABLED_CURVE25519_SMALL" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
93429354
AM_CONDITIONAL([BUILD_ED448],[test "x$ENABLED_ED448" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
93439355
AM_CONDITIONAL([BUILD_ED448_SMALL],[test "x$ENABLED_ED448_SMALL" = "xyes"])

linuxkm/linuxkm_memory.c

Lines changed: 48 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,18 @@ static union wc_linuxkm_fpu_savebuf {
116116
WARN_UNUSED_RESULT int allocate_wolfcrypt_linuxkm_fpu_states(void)
117117
{
118118
if (wc_linuxkm_fpu_states != NULL) {
119+
#ifdef HAVE_FIPS
120+
/* see note below in wc_linuxkm_fpu_state_assoc_unlikely(). */
121+
return 0;
122+
#else
119123
static int warned_for_repeat_alloc = 0;
120124
if (! warned_for_repeat_alloc) {
121125
pr_err("attempt at repeat allocation"
122126
" in allocate_wolfcrypt_linuxkm_fpu_states\n");
123127
warned_for_repeat_alloc = 1;
124128
}
125129
return BAD_STATE_E;
130+
#endif
126131
}
127132

128133
#ifdef LINUXKM_FPU_STATES_FOLLOW_THREADS
@@ -225,12 +230,23 @@ static struct wc_thread_fpu_count_ent *wc_linuxkm_fpu_state_assoc(int create_p)
225230
static int _warned_on_null = 0;
226231
if (wc_linuxkm_fpu_states == NULL)
227232
{
228-
if (_warned_on_null == 0) {
229-
pr_err("wc_linuxkm_fpu_state_assoc called by pid %d"
230-
" before allocate_wolfcrypt_linuxkm_fpu_states.\n", my_pid);
231-
_warned_on_null = 1;
233+
#ifdef HAVE_FIPS
234+
/* FIPS needs to use SHA256 for the core verify HMAC, before
235+
* reaching the regular wolfCrypt_Init() logic. to break the
236+
* dependency loop on intelasm builds, we allocate here.
237+
* this is not thread-safe and doesn't need to be.
238+
*/
239+
int ret = allocate_wolfcrypt_linuxkm_fpu_states();
240+
if (ret != 0)
241+
#endif
242+
{
243+
if (_warned_on_null == 0) {
244+
pr_err("wc_linuxkm_fpu_state_assoc called by pid %d"
245+
" before allocate_wolfcrypt_linuxkm_fpu_states.\n", my_pid);
246+
_warned_on_null = 1;
247+
}
248+
return NULL;
232249
}
233-
return NULL;
234250
}
235251
}
236252

@@ -282,12 +298,23 @@ static struct wc_thread_fpu_count_ent *wc_linuxkm_fpu_state_assoc_unlikely(int c
282298
static int _warned_on_null = 0;
283299
if (wc_linuxkm_fpu_states == NULL)
284300
{
285-
if (_warned_on_null == 0) {
286-
pr_err("wc_linuxkm_fpu_state_assoc called by pid %d"
287-
" before allocate_wolfcrypt_linuxkm_fpu_states.\n", my_pid);
288-
_warned_on_null = 1;
301+
#ifdef HAVE_FIPS
302+
/* FIPS needs to use SHA256 for the core verify HMAC, before
303+
* reaching the regular wolfCrypt_Init() logic. to break the
304+
* dependency loop on intelasm builds, we allocate here.
305+
* this is not thread-safe and doesn't need to be.
306+
*/
307+
int ret = allocate_wolfcrypt_linuxkm_fpu_states();
308+
if (ret != 0)
309+
#endif
310+
{
311+
if (_warned_on_null == 0) {
312+
pr_err("wc_linuxkm_fpu_state_assoc called by pid %d"
313+
" before allocate_wolfcrypt_linuxkm_fpu_states.\n", my_pid);
314+
_warned_on_null = 1;
315+
}
316+
return NULL;
289317
}
290-
return NULL;
291318
}
292319
}
293320

@@ -419,6 +446,17 @@ static inline void wc_linuxkm_fpu_state_release(
419446
__atomic_store_n(&ent->pid, 0, __ATOMIC_RELEASE);
420447
}
421448

449+
WARN_UNUSED_RESULT int can_save_vector_registers_x86(void)
450+
{
451+
if (irq_fpu_usable())
452+
return 1;
453+
else if (in_nmi() || (hardirq_count() > 0) || (softirq_count() > 0))
454+
return 0;
455+
else if (test_thread_flag(TIF_NEED_FPU_LOAD))
456+
return 1;
457+
return 0;
458+
}
459+
422460
WARN_UNUSED_RESULT int save_vector_registers_x86(void)
423461
{
424462
#ifdef LINUXKM_FPU_STATES_FOLLOW_THREADS

linuxkm/linuxkm_wc_port.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,13 @@
338338
#else
339339
#include <asm/simd.h>
340340
#endif
341+
#ifndef CAN_SAVE_VECTOR_REGISTERS
342+
#ifdef DEBUG_VECTOR_REGISTER_ACCESS_FUZZING
343+
#define CAN_SAVE_VECTOR_REGISTERS() (can_save_vector_registers_x86() && (SAVE_VECTOR_REGISTERS2_fuzzer() == 0))
344+
#else
345+
#define CAN_SAVE_VECTOR_REGISTERS() can_save_vector_registers_x86()
346+
#endif
347+
#endif
341348
#ifndef SAVE_VECTOR_REGISTERS
342349
#define SAVE_VECTOR_REGISTERS(fail_clause) { \
343350
int _svr_ret = save_vector_registers_x86(); \
@@ -369,6 +376,9 @@
369376
#ifndef SAVE_VECTOR_REGISTERS2
370377
#define SAVE_VECTOR_REGISTERS2() save_vector_registers_arm()
371378
#endif
379+
#ifndef CAN_SAVE_VECTOR_REGISTERS
380+
#define CAN_SAVE_VECTOR_REGISTERS() can_save_vector_registers_arm()
381+
#endif
372382
#ifndef RESTORE_VECTOR_REGISTERS
373383
#define RESTORE_VECTOR_REGISTERS() restore_vector_registers_arm()
374384
#endif
@@ -758,6 +768,7 @@
758768

759769
extern __must_check int allocate_wolfcrypt_linuxkm_fpu_states(void);
760770
extern void free_wolfcrypt_linuxkm_fpu_states(void);
771+
extern __must_check int can_save_vector_registers_x86(void);
761772
extern __must_check int save_vector_registers_x86(void);
762773
extern void restore_vector_registers_x86(void);
763774

linuxkm/lkcapi_glue.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1818,7 +1818,7 @@ static int aes_xts_128_test(void)
18181818
goto out;
18191819
}
18201820

1821-
#if defined(DEBUG_VECTOR_REGISTER_ACCESS) && defined(WC_AES_C_DYNAMIC_FALLBACK)
1821+
#if defined(DEBUG_VECTOR_REGISTER_ACCESS) && defined(WC_C_DYNAMIC_FALLBACK)
18221822
WC_DEBUG_SET_VECTOR_REGISTERS_RETVAL(SYSLIB_FAILED_E);
18231823
ret = wc_AesXtsEncrypt(aes, buf, p2, sizeof(p2), i2, sizeof(i2));
18241824
WC_DEBUG_SET_VECTOR_REGISTERS_RETVAL(0);
@@ -1843,7 +1843,7 @@ static int aes_xts_128_test(void)
18431843
goto out;
18441844
}
18451845

1846-
#if defined(DEBUG_VECTOR_REGISTER_ACCESS) && defined(WC_AES_C_DYNAMIC_FALLBACK)
1846+
#if defined(DEBUG_VECTOR_REGISTER_ACCESS) && defined(WC_C_DYNAMIC_FALLBACK)
18471847
WC_DEBUG_SET_VECTOR_REGISTERS_RETVAL(SYSLIB_FAILED_E);
18481848
ret = wc_AesXtsEncrypt(aes, buf, p1, sizeof(p1), i1, sizeof(i1));
18491849
WC_DEBUG_SET_VECTOR_REGISTERS_RETVAL(0);
@@ -1865,7 +1865,7 @@ static int aes_xts_128_test(void)
18651865
goto out;
18661866
}
18671867

1868-
#if defined(DEBUG_VECTOR_REGISTER_ACCESS) && defined(WC_AES_C_DYNAMIC_FALLBACK)
1868+
#if defined(DEBUG_VECTOR_REGISTER_ACCESS) && defined(WC_C_DYNAMIC_FALLBACK)
18691869
WC_DEBUG_SET_VECTOR_REGISTERS_RETVAL(SYSLIB_FAILED_E);
18701870
XMEMSET(cipher, 0, AES_XTS_128_TEST_BUF_SIZ);
18711871
ret = wc_AesXtsEncrypt(aes, cipher, pp, sizeof(pp), i1, sizeof(i1));
@@ -1891,7 +1891,7 @@ static int aes_xts_128_test(void)
18911891
goto out;
18921892
}
18931893

1894-
#if defined(DEBUG_VECTOR_REGISTER_ACCESS) && defined(WC_AES_C_DYNAMIC_FALLBACK)
1894+
#if defined(DEBUG_VECTOR_REGISTER_ACCESS) && defined(WC_C_DYNAMIC_FALLBACK)
18951895
WC_DEBUG_SET_VECTOR_REGISTERS_RETVAL(SYSLIB_FAILED_E);
18961896
XMEMSET(buf, 0, AES_XTS_128_TEST_BUF_SIZ);
18971897
ret = wc_AesXtsDecrypt(aes, buf, cipher, sizeof(pp), i1, sizeof(i1));
@@ -1914,7 +1914,7 @@ static int aes_xts_128_test(void)
19141914
goto out;
19151915
}
19161916

1917-
#if defined(DEBUG_VECTOR_REGISTER_ACCESS) && defined(WC_AES_C_DYNAMIC_FALLBACK)
1917+
#if defined(DEBUG_VECTOR_REGISTER_ACCESS) && defined(WC_C_DYNAMIC_FALLBACK)
19181918
WC_DEBUG_SET_VECTOR_REGISTERS_RETVAL(SYSLIB_FAILED_E);
19191919
XMEMSET(buf, 0, AES_XTS_128_TEST_BUF_SIZ);
19201920
ret = wc_AesXtsDecrypt(aes, buf, c1, sizeof(c1), i1, sizeof(i1));

src/include.am

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,7 @@ if BUILD_FEMATH
995995
if BUILD_CURVE25519_SMALL
996996
src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/fe_low_mem.c
997997
else
998-
if BUILD_INTELASM
998+
if BUILD_CURVE25519_INTELASM
999999
if !BUILD_X86_ASM
10001000
src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/fe_x25519_asm.S
10011001
endif !BUILD_X86_ASM
@@ -1025,7 +1025,7 @@ endif !BUILD_FIPS_V6
10251025
else
10261026
src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/fe_operations.c
10271027
endif !BUILD_ARMASM
1028-
endif !BUILD_INTELASM
1028+
endif !BUILD_CURVE25519_INTELASM
10291029
endif !BUILD_CURVE25519_SMALL
10301030
endif BUILD_FEMATH
10311031

@@ -1035,7 +1035,7 @@ src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/ge_low_mem.c
10351035
else
10361036
src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/ge_operations.c
10371037
if !BUILD_FEMATH
1038-
if BUILD_INTELASM
1038+
if BUILD_CURVE25519_INTELASM
10391039
if !BUILD_X86_ASM
10401040
src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/fe_x25519_asm.S
10411041
endif !BUILD_X86_ASM
@@ -1061,7 +1061,7 @@ else
10611061
src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/fe_operations.c
10621062
endif !BUILD_ARMASM
10631063
endif !BUILD_FIPS_V6
1064-
endif !BUILD_INTELASM
1064+
endif !BUILD_CURVE25519_INTELASM
10651065
endif !BUILD_FEMATH
10661066
endif !BUILD_ED25519_SMALL
10671067
endif BUILD_GEMATH

tests/api.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63548,7 +63548,8 @@ static int test_wolfSSL_dtls_AEAD_limit(void)
6354863548
#endif
6354963549

6355063550
#if defined(WOLFSSL_DTLS) && \
63551-
defined(HAVE_IO_TESTS_DEPENDENCIES) && !defined(SINGLE_THREADED)
63551+
defined(HAVE_IO_TESTS_DEPENDENCIES) && !defined(SINGLE_THREADED) && \
63552+
!defined(DEBUG_VECTOR_REGISTER_ACCESS_FUZZING)
6355263553
static void test_wolfSSL_dtls_send_ch(WOLFSSL* ssl)
6355363554
{
6355463555
int fd, ret;

wolfcrypt/src/aes.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1930,7 +1930,7 @@ static void AesEncrypt_C(Aes* aes, const byte* inBlock, byte* outBlock,
19301930
word32 t0, t1, t2, t3;
19311931
const word32* rk;
19321932

1933-
#ifdef WC_AES_C_DYNAMIC_FALLBACK
1933+
#ifdef WC_C_DYNAMIC_FALLBACK
19341934
rk = aes->key_C_fallback;
19351935
#else
19361936
rk = aes->key;
@@ -2945,7 +2945,7 @@ static void AesDecrypt_C(Aes* aes, const byte* inBlock, byte* outBlock,
29452945
word32 t0, t1, t2, t3;
29462946
const word32* rk;
29472947

2948-
#ifdef WC_AES_C_DYNAMIC_FALLBACK
2948+
#ifdef WC_C_DYNAMIC_FALLBACK
29492949
rk = aes->key_C_fallback;
29502950
#else
29512951
rk = aes->key;
@@ -4085,7 +4085,7 @@ static WARN_UNUSED_RESULT int wc_AesDecrypt(
40854085
*/
40864086
static void AesSetKey_C(Aes* aes, const byte* key, word32 keySz, int dir)
40874087
{
4088-
#ifdef WC_AES_C_DYNAMIC_FALLBACK
4088+
#ifdef WC_C_DYNAMIC_FALLBACK
40894089
word32* rk = aes->key_C_fallback;
40904090
#else
40914091
word32* rk = aes->key;
@@ -4246,7 +4246,7 @@ static void AesSetKey_C(Aes* aes, const byte* key, word32 keySz, int dir)
42464246
if (dir == AES_DECRYPTION) {
42474247
unsigned int j;
42484248

4249-
#ifdef WC_AES_C_DYNAMIC_FALLBACK
4249+
#ifdef WC_C_DYNAMIC_FALLBACK
42504250
rk = aes->key_C_fallback;
42514251
#else
42524252
rk = aes->key;
@@ -4455,11 +4455,11 @@ static void AesSetKey_C(Aes* aes, const byte* key, word32 keySz, int dir)
44554455
if (ret != 0)
44564456
return ret;
44574457

4458-
#ifdef WC_AES_C_DYNAMIC_FALLBACK
4458+
#ifdef WC_C_DYNAMIC_FALLBACK
44594459
#ifdef NEED_AES_TABLES
44604460
AesSetKey_C(aes, userKey, keylen, dir);
44614461
#endif /* NEED_AES_TABLES */
4462-
#endif /* WC_AES_C_DYNAMIC_FALLBACK */
4462+
#endif /* WC_C_DYNAMIC_FALLBACK */
44634463

44644464
#ifdef WOLFSSL_AESNI
44654465
aes->use_aesni = 0;
@@ -4488,13 +4488,13 @@ static void AesSetKey_C(Aes* aes, const byte* key, word32 keySz, int dir)
44884488
if (ret == 0)
44894489
aes->use_aesni = 1;
44904490
else {
4491-
#ifdef WC_AES_C_DYNAMIC_FALLBACK
4491+
#ifdef WC_C_DYNAMIC_FALLBACK
44924492
ret = 0;
44934493
#endif
44944494
}
44954495
return ret;
44964496
} else {
4497-
#ifdef WC_AES_C_DYNAMIC_FALLBACK
4497+
#ifdef WC_C_DYNAMIC_FALLBACK
44984498
return 0;
44994499
#else
45004500
return ret;
@@ -4680,7 +4680,7 @@ int wc_AesSetIV(Aes* aes, const byte* iv)
46804680

46814681
#ifdef WOLFSSL_AESNI
46824682

4683-
#ifdef WC_AES_C_DYNAMIC_FALLBACK
4683+
#ifdef WC_C_DYNAMIC_FALLBACK
46844684

46854685
#define VECTOR_REGISTERS_PUSH { \
46864686
int orig_use_aesni = aes->use_aesni; \
@@ -12369,7 +12369,7 @@ int wc_AesXtsSetKeyNoInit(XtsAes* aes, const byte* key, word32 len, int dir)
1236912369

1237012370
#ifdef WOLFSSL_AESNI
1237112371
if (ret == 0) {
12372-
/* With WC_AES_C_DYNAMIC_FALLBACK, the main and tweak keys could have
12372+
/* With WC_C_DYNAMIC_FALLBACK, the main and tweak keys could have
1237312373
* conflicting _aesni status, but the AES-XTS asm implementations need
1237412374
* them to all be AESNI. If any aren't, disable AESNI on all.
1237512375
*/
@@ -12382,7 +12382,7 @@ int wc_AesXtsSetKeyNoInit(XtsAes* aes, const byte* key, word32 len, int dir)
1238212382
(dir == AES_ENCRYPTION_AND_DECRYPTION))
1238312383
&& (aes->aes_decrypt.use_aesni != aes->tweak.use_aesni)))
1238412384
{
12385-
#ifdef WC_AES_C_DYNAMIC_FALLBACK
12385+
#ifdef WC_C_DYNAMIC_FALLBACK
1238612386
aes->aes.use_aesni = 0;
1238712387
aes->aes_decrypt.use_aesni = 0;
1238812388
aes->tweak.use_aesni = 0;
@@ -12392,7 +12392,7 @@ int wc_AesXtsSetKeyNoInit(XtsAes* aes, const byte* key, word32 len, int dir)
1239212392
}
1239312393
#else /* !WC_AES_XTS_SUPPORT_SIMULTANEOUS_ENC_AND_DEC_KEYS */
1239412394
if (aes->aes.use_aesni != aes->tweak.use_aesni) {
12395-
#ifdef WC_AES_C_DYNAMIC_FALLBACK
12395+
#ifdef WC_C_DYNAMIC_FALLBACK
1239612396
aes->aes.use_aesni = 0;
1239712397
aes->tweak.use_aesni = 0;
1239812398
#else

0 commit comments

Comments
 (0)