@@ -646,17 +646,19 @@ block cipher mechanism that uses n-bit binary string parameter key with 128-bits
646646 #define WOLFSSL_AES_DIRECT
647647
648648 /* Encrypt: If we choose to never have a fallback to SW: */
649- #if !defined(NEED_AES_HW_FALLBACK) && (defined(HAVE_AESGCM) || defined(WOLFSSL_AES_DIRECT))
650- static WARN_UNUSED_RESULT int wc_AesEncrypt( /* calling this one when NO_AES_192 is defined */
649+ #if !defined(NEED_AES_HW_FALLBACK) && \
650+ (defined(HAVE_AESGCM) || defined(WOLFSSL_AES_DIRECT))
651+ /* calling this one when NO_AES_192 is defined */
652+ static WARN_UNUSED_RESULT int wc_AesEncrypt(
651653 Aes* aes, const byte* inBlock, byte* outBlock)
652654 {
653655 int ret;
654656
655- #ifdef WC_DEBUG_CIPHER_LIFECYCLE
657+ #ifdef WC_DEBUG_CIPHER_LIFECYCLE
656658 ret = wc_debug_CipherLifecycleCheck(aes->CipherLifecycleTag, 0);
657659 if (ret < 0)
658660 return ret;
659- #endif
661+ #endif
660662
661663 /* Thread mutex protection handled in esp_aes_hw_InUse */
662664 #ifdef NEED_AES_HW_FALLBACK
@@ -671,7 +673,8 @@ block cipher mechanism that uses n-bit binary string parameter key with 128-bits
671673 #endif
672674
673675 /* Decrypt: If we choose to never have a fallback to SW: */
674- #if !defined(NEED_AES_HW_FALLBACK) && (defined(HAVE_AES_DECRYPT) && defined(WOLFSSL_AES_DIRECT))
676+ #if !defined(NEED_AES_HW_FALLBACK) && \
677+ (defined(HAVE_AES_DECRYPT) && defined(WOLFSSL_AES_DIRECT))
675678 static WARN_UNUSED_RESULT int wc_AesDecrypt(
676679 Aes* aes, const byte* inBlock, byte* outBlock)
677680 {
@@ -1112,6 +1115,9 @@ static WARN_UNUSED_RESULT int wc_AesDecrypt(Aes* aes, const byte* inBlock,
11121115#elif defined(WOLFSSL_RISCV_ASM)
11131116/* implemented in wolfcrypt/src/port/risc-v/riscv-64-aes.c */
11141117
1118+ #elif defined(WOLFSSL_SILABS_SE_ACCEL)
1119+ /* implemented in wolfcrypt/src/port/silabs/silabs_aes.c */
1120+
11151121#else
11161122
11171123 /* using wolfCrypt software implementation */
@@ -1128,17 +1134,17 @@ static WARN_UNUSED_RESULT int wc_AesDecrypt(Aes* aes, const byte* inBlock,
11281134
11291135#ifndef WC_AES_BITSLICED
11301136#if defined(__aarch64__) || !defined(WOLFSSL_ARMASM)
1131- #if !defined(WOLFSSL_SILABS_SE_ACCEL ) || \
1132- defined(NO_ESP32_CRYPT) || defined(NO_WOLFSSL_ESP32_CRYPT_AES) || \
1133- defined(NEED_AES_HW_FALLBACK)
1137+ #if !defined(WOLFSSL_ESP32_CRYPT ) || \
1138+ ( defined(NO_ESP32_CRYPT) || defined(NO_WOLFSSL_ESP32_CRYPT_AES) || \
1139+ defined(NEED_AES_HW_FALLBACK))
11341140static const FLASH_QUALIFIER word32 rcon[] = {
11351141 0x01000000, 0x02000000, 0x04000000, 0x08000000,
11361142 0x10000000, 0x20000000, 0x40000000, 0x80000000,
11371143 0x1B000000, 0x36000000,
11381144 /* for 128-bit blocks, Rijndael never uses more than 10 rcon values */
11391145};
1140- #endif
1141- #endif
1146+ #endif /* ESP32 */
1147+ #endif /* __aarch64__ || !WOLFSSL_ARMASM */
11421148
11431149#if defined(__aarch64__) || !defined(WOLFSSL_ARMASM) || \
11441150 defined(WOLFSSL_ARMASM_NO_HW_CRYPTO) || defined(WOLFSSL_AES_DIRECT) || \
@@ -1411,7 +1417,7 @@ static const FLASH_QUALIFIER word32 Te[4][256] = {
14111417}
14121418};
14131419
1414- #if defined( HAVE_AES_DECRYPT) && !defined(WOLFSSL_SILABS_SE_ACCEL)
1420+ #ifdef HAVE_AES_DECRYPT
14151421#if defined(__aarch64__) || !defined(WOLFSSL_ARMASM)
14161422static const FLASH_QUALIFIER word32 Td[4][256] = {
14171423{
@@ -1680,14 +1686,13 @@ static const FLASH_QUALIFIER word32 Td[4][256] = {
16801686 0xcb84617bU, 0x32b670d5U, 0x6c5c7448U, 0xb85742d0U,
16811687}
16821688};
1683- #endif
1689+ #endif /* __aarch64__ || !WOLFSSL_ARMASM */
16841690#endif /* HAVE_AES_DECRYPT */
16851691#endif /* WOLFSSL_AES_SMALL_TABLES */
16861692
16871693#ifdef HAVE_AES_DECRYPT
1688- #if (defined(HAVE_AES_CBC) && !defined(WOLFSSL_DEVCRYPTO_CBC) && \
1689- !defined(WOLFSSL_SILABS_SE_ACCEL)) || \
1690- defined(HAVE_AES_ECB) || defined(WOLFSSL_AES_DIRECT)
1694+ #if (defined(HAVE_AES_CBC) && !defined(WOLFSSL_DEVCRYPTO_CBC)) || \
1695+ defined(HAVE_AES_ECB) || defined(WOLFSSL_AES_DIRECT)
16911696#if defined(__aarch64__) || !defined(WOLFSSL_ARMASM)
16921697static const FLASH_QUALIFIER byte Td4[256] =
16931698{
@@ -3092,8 +3097,7 @@ static WARN_UNUSED_RESULT int wc_AesEncrypt(
30923097#endif /* HAVE_AES_CBC || WOLFSSL_AES_DIRECT || HAVE_AESGCM */
30933098
30943099#if defined(HAVE_AES_DECRYPT)
3095- #if ((defined(HAVE_AES_CBC) && !defined(WOLFSSL_DEVCRYPTO_CBC) && \
3096- !defined(WOLFSSL_SILABS_SE_ACCEL)) || \
3100+ #if ((defined(HAVE_AES_CBC) && !defined(WOLFSSL_DEVCRYPTO_CBC)) || \
30973101 defined(HAVE_AES_ECB) || defined(WOLFSSL_AES_DIRECT)) && \
30983102 (defined(__aarch64__) || !defined(WOLFSSL_ARMASM))
30993103
@@ -3732,8 +3736,7 @@ static void AesDecryptBlocks_C(Aes* aes, const byte* in, byte* out, word32 sz)
37323736#endif /* !WC_AES_BITSLICED */
37333737#endif
37343738
3735- #if (defined(HAVE_AES_CBC) && !defined(WOLFSSL_DEVCRYPTO_CBC) && \
3736- !defined(WOLFSSL_SILABS_SE_ACCEL)) || \
3739+ #if (defined(HAVE_AES_CBC) && !defined(WOLFSSL_DEVCRYPTO_CBC)) || \
37373740 defined(WOLFSSL_AES_DIRECT)
37383741#if defined(__aarch64__) || !defined(WOLFSSL_ARMASM)
37393742#if !defined(WC_AES_BITSLICED) || defined(WOLFSSL_AES_DIRECT)
0 commit comments