Skip to content

Commit 00add89

Browse files
committed
Fix for unused AesDecrypt in aes.c with SiLabs AES acceleration enabled (WOLFSSL_SILABS_SE_ACCEL). ZD15874
1 parent 4bf6422 commit 00add89

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

wolfcrypt/src/aes.c

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,6 +1046,7 @@ block cipher mechanism that uses n-bit binary string parameter key with 128-bits
10461046
#endif
10471047
#elif defined(WOLFSSL_HAVE_PSA) && !defined(WOLFSSL_PSA_NO_AES)
10481048
/* implemented in wolfcrypt/src/port/psa/psa_aes.c */
1049+
10491050
#else
10501051

10511052
/* using wolfCrypt software implementation */
@@ -1056,12 +1057,14 @@ block cipher mechanism that uses n-bit binary string parameter key with 128-bits
10561057

10571058
#ifdef NEED_AES_TABLES
10581059

1060+
#if !defined(WOLFSSL_SILABS_SE_ACCEL)
10591061
static const FLASH_QUALIFIER word32 rcon[] = {
10601062
0x01000000, 0x02000000, 0x04000000, 0x08000000,
10611063
0x10000000, 0x20000000, 0x40000000, 0x80000000,
10621064
0x1B000000, 0x36000000,
10631065
/* for 128-bit blocks, Rijndael never uses more than 10 rcon values */
10641066
};
1067+
#endif
10651068

10661069
#ifndef WOLFSSL_AES_SMALL_TABLES
10671070
static const FLASH_QUALIFIER word32 Te[4][256] = {
@@ -1331,7 +1334,7 @@ static const FLASH_QUALIFIER word32 Te[4][256] = {
13311334
}
13321335
};
13331336

1334-
#ifdef HAVE_AES_DECRYPT
1337+
#if defined(HAVE_AES_DECRYPT) && !defined(WOLFSSL_SILABS_SE_ACCEL)
13351338
static const FLASH_QUALIFIER word32 Td[4][256] = {
13361339
{
13371340
0x51f4a750U, 0x7e416553U, 0x1a17a4c3U, 0x3a275e96U,
@@ -1603,8 +1606,9 @@ static const FLASH_QUALIFIER word32 Td[4][256] = {
16031606
#endif /* WOLFSSL_AES_SMALL_TABLES */
16041607

16051608
#ifdef HAVE_AES_DECRYPT
1606-
#if (defined(HAVE_AES_CBC) && !defined(WOLFSSL_DEVCRYPTO_CBC)) \
1607-
|| defined(WOLFSSL_AES_DIRECT)
1609+
#if (defined(HAVE_AES_CBC) && !defined(WOLFSSL_DEVCRYPTO_CBC) && \
1610+
!defined(WOLFSSL_SILABS_SE_ACCEL)) || \
1611+
defined(WOLFSSL_AES_DIRECT)
16081612
static const FLASH_QUALIFIER byte Td4[256] =
16091613
{
16101614
0x52U, 0x09U, 0x6aU, 0xd5U, 0x30U, 0x36U, 0xa5U, 0x38U,
@@ -2323,8 +2327,9 @@ static WARN_UNUSED_RESULT int wc_AesEncrypt(
23232327
#endif /* HAVE_AES_CBC || WOLFSSL_AES_DIRECT || HAVE_AESGCM */
23242328

23252329
#if defined(HAVE_AES_DECRYPT)
2326-
#if (defined(HAVE_AES_CBC) && !defined(WOLFSSL_DEVCRYPTO_CBC)) || \
2327-
defined(WOLFSSL_AES_DIRECT)
2330+
#if (defined(HAVE_AES_CBC) && !defined(WOLFSSL_DEVCRYPTO_CBC) && \
2331+
!defined(WOLFSSL_SILABS_SE_ACCEL)) || \
2332+
defined(WOLFSSL_AES_DIRECT)
23282333

23292334
#ifndef WC_NO_CACHE_RESISTANT
23302335
#ifndef WOLFSSL_AES_SMALL_TABLES
@@ -2998,7 +3003,7 @@ static WARN_UNUSED_RESULT int wc_AesDecrypt(
29983003
/* implemented in wolfcrypt/src/port/devcrypto/devcrypto_aes.c */
29993004

30003005
#elif defined(WOLFSSL_SILABS_SE_ACCEL)
3001-
/* implemented in wolfcrypt/src/port/silabs/silabs_hash.c */
3006+
/* implemented in wolfcrypt/src/port/silabs/silabs_aes.c */
30023007

30033008
#else
30043009

@@ -4186,7 +4191,7 @@ int wc_AesSetIV(Aes* aes, const byte* iv)
41864191
/* implemented in wolfcrypt/src/port/devcrypt/devcrypto_aes.c */
41874192

41884193
#elif defined(WOLFSSL_SILABS_SE_ACCEL)
4189-
/* implemented in wolfcrypt/src/port/silabs/silabs_hash.c */
4194+
/* implemented in wolfcrypt/src/port/silabs/silabs_aes.c */
41904195

41914196
#elif defined(WOLFSSL_HAVE_PSA) && !defined(WOLFSSL_PSA_NO_AES)
41924197
/* implemented in wolfcrypt/src/port/psa/psa_aes.c */

0 commit comments

Comments
 (0)