@@ -645,17 +645,19 @@ block cipher mechanism that uses n-bit binary string parameter key with 128-bits
645645 #define WOLFSSL_AES_DIRECT
646646
647647 /* Encrypt: If we choose to never have a fallback to SW: */
648- #if !defined(NEED_AES_HW_FALLBACK) && (defined(HAVE_AESGCM) || defined(WOLFSSL_AES_DIRECT))
649- static WARN_UNUSED_RESULT int wc_AesEncrypt( /* calling this one when NO_AES_192 is defined */
648+ #if !defined(NEED_AES_HW_FALLBACK) && \
649+ (defined(HAVE_AESGCM) || defined(WOLFSSL_AES_DIRECT))
650+ /* calling this one when NO_AES_192 is defined */
651+ static WARN_UNUSED_RESULT int wc_AesEncrypt(
650652 Aes* aes, const byte* inBlock, byte* outBlock)
651653 {
652654 int ret;
653655
654- #ifdef WC_DEBUG_CIPHER_LIFECYCLE
656+ #ifdef WC_DEBUG_CIPHER_LIFECYCLE
655657 ret = wc_debug_CipherLifecycleCheck(aes->CipherLifecycleTag, 0);
656658 if (ret < 0)
657659 return ret;
658- #endif
660+ #endif
659661
660662 /* Thread mutex protection handled in esp_aes_hw_InUse */
661663 #ifdef NEED_AES_HW_FALLBACK
@@ -670,7 +672,8 @@ block cipher mechanism that uses n-bit binary string parameter key with 128-bits
670672 #endif
671673
672674 /* Decrypt: If we choose to never have a fallback to SW: */
673- #if !defined(NEED_AES_HW_FALLBACK) && (defined(HAVE_AES_DECRYPT) && defined(WOLFSSL_AES_DIRECT))
675+ #if !defined(NEED_AES_HW_FALLBACK) && \
676+ (defined(HAVE_AES_DECRYPT) && defined(WOLFSSL_AES_DIRECT))
674677 static WARN_UNUSED_RESULT int wc_AesDecrypt(
675678 Aes* aes, const byte* inBlock, byte* outBlock)
676679 {
@@ -1111,6 +1114,9 @@ static WARN_UNUSED_RESULT int wc_AesDecrypt(Aes* aes, const byte* inBlock,
11111114#elif defined(WOLFSSL_RISCV_ASM)
11121115/* implemented in wolfcrypt/src/port/risc-v/riscv-64-aes.c */
11131116
1117+ #elif defined(WOLFSSL_SILABS_SE_ACCEL)
1118+ /* implemented in wolfcrypt/src/port/silabs/silabs_aes.c */
1119+
11141120#else
11151121
11161122 /* using wolfCrypt software implementation */
@@ -1127,17 +1133,17 @@ static WARN_UNUSED_RESULT int wc_AesDecrypt(Aes* aes, const byte* inBlock,
11271133
11281134#ifndef WC_AES_BITSLICED
11291135#if defined(__aarch64__) || !defined(WOLFSSL_ARMASM)
1130- #if !defined(WOLFSSL_SILABS_SE_ACCEL ) || \
1131- defined(NO_ESP32_CRYPT) || defined(NO_WOLFSSL_ESP32_CRYPT_AES) || \
1132- defined(NEED_AES_HW_FALLBACK)
1136+ #if !defined(WOLFSSL_ESP32_CRYPT ) || \
1137+ ( defined(NO_ESP32_CRYPT) || defined(NO_WOLFSSL_ESP32_CRYPT_AES) || \
1138+ defined(NEED_AES_HW_FALLBACK))
11331139static const FLASH_QUALIFIER word32 rcon[] = {
11341140 0x01000000, 0x02000000, 0x04000000, 0x08000000,
11351141 0x10000000, 0x20000000, 0x40000000, 0x80000000,
11361142 0x1B000000, 0x36000000,
11371143 /* for 128-bit blocks, Rijndael never uses more than 10 rcon values */
11381144};
1139- #endif
1140- #endif
1145+ #endif /* ESP32 */
1146+ #endif /* __aarch64__ || !WOLFSSL_ARMASM */
11411147
11421148#if defined(__aarch64__) || !defined(WOLFSSL_ARMASM) || \
11431149 defined(WOLFSSL_ARMASM_NO_HW_CRYPTO) || defined(WOLFSSL_AES_DIRECT) || \
@@ -1410,7 +1416,7 @@ static const FLASH_QUALIFIER word32 Te[4][256] = {
14101416}
14111417};
14121418
1413- #if defined( HAVE_AES_DECRYPT) && !defined(WOLFSSL_SILABS_SE_ACCEL)
1419+ #ifdef HAVE_AES_DECRYPT
14141420#if defined(__aarch64__) || !defined(WOLFSSL_ARMASM)
14151421static const FLASH_QUALIFIER word32 Td[4][256] = {
14161422{
@@ -1679,14 +1685,13 @@ static const FLASH_QUALIFIER word32 Td[4][256] = {
16791685 0xcb84617bU, 0x32b670d5U, 0x6c5c7448U, 0xb85742d0U,
16801686}
16811687};
1682- #endif
1688+ #endif /* __aarch64__ || !WOLFSSL_ARMASM */
16831689#endif /* HAVE_AES_DECRYPT */
16841690#endif /* WOLFSSL_AES_SMALL_TABLES */
16851691
16861692#ifdef HAVE_AES_DECRYPT
1687- #if (defined(HAVE_AES_CBC) && !defined(WOLFSSL_DEVCRYPTO_CBC) && \
1688- !defined(WOLFSSL_SILABS_SE_ACCEL)) || \
1689- defined(HAVE_AES_ECB) || defined(WOLFSSL_AES_DIRECT)
1693+ #if (defined(HAVE_AES_CBC) && !defined(WOLFSSL_DEVCRYPTO_CBC)) || \
1694+ defined(HAVE_AES_ECB) || defined(WOLFSSL_AES_DIRECT)
16901695#if defined(__aarch64__) || !defined(WOLFSSL_ARMASM)
16911696static const FLASH_QUALIFIER byte Td4[256] =
16921697{
@@ -3091,8 +3096,7 @@ static WARN_UNUSED_RESULT int wc_AesEncrypt(
30913096#endif /* HAVE_AES_CBC || WOLFSSL_AES_DIRECT || HAVE_AESGCM */
30923097
30933098#if defined(HAVE_AES_DECRYPT)
3094- #if ((defined(HAVE_AES_CBC) && !defined(WOLFSSL_DEVCRYPTO_CBC) && \
3095- !defined(WOLFSSL_SILABS_SE_ACCEL)) || \
3099+ #if ((defined(HAVE_AES_CBC) && !defined(WOLFSSL_DEVCRYPTO_CBC)) || \
30963100 defined(HAVE_AES_ECB) || defined(WOLFSSL_AES_DIRECT)) && \
30973101 (defined(__aarch64__) || !defined(WOLFSSL_ARMASM))
30983102
@@ -3731,8 +3735,7 @@ static void AesDecryptBlocks_C(Aes* aes, const byte* in, byte* out, word32 sz)
37313735#endif /* !WC_AES_BITSLICED */
37323736#endif
37333737
3734- #if (defined(HAVE_AES_CBC) && !defined(WOLFSSL_DEVCRYPTO_CBC) && \
3735- !defined(WOLFSSL_SILABS_SE_ACCEL)) || \
3738+ #if (defined(HAVE_AES_CBC) && !defined(WOLFSSL_DEVCRYPTO_CBC)) || \
37363739 defined(WOLFSSL_AES_DIRECT)
37373740#if defined(__aarch64__) || !defined(WOLFSSL_ARMASM)
37383741#if !defined(WC_AES_BITSLICED) || defined(WOLFSSL_AES_DIRECT)
0 commit comments