1

(3 replies, posted in wolfCrypt)

I am upgrading our wolfssl version from 5.6.4 to 5.7.6 and am encountering a build issue with woflcrypt/aes.c. We haven't modified our application or user_settings, just updated the wolfssl version.

This is the compilation error:

wolfssl/wolfcrypt/src/aes.c:243:35: error: 'wc_AesDecrypt' defined but not used [-Werror=unused-function]
  243 |     static WARN_UNUSED_RESULT int wc_AesDecrypt(
      | 

These are our user_settings pertaining to AES. We only use the CCM AES functions in our application

/*---------- WOLF_CONF_AESGCM -----------*/
#define WOLF_CONF_AESGCM      0

/*---------- WOLF_CONF_AESCBC -----------*/
#define WOLF_CONF_AESCBC      0
...
/* AES */
#if defined(WOLF_CONF_AESGCM) && WOLF_CONF_AESGCM == 1
    #define HAVE_AESGCM
    /* GCM Method: GCM_SMALL, GCM_WORD32, GCM_TABLE or GCM_TABLE_4BIT */
    /* GCM_TABLE is about 4K larger and 3x faster for GHASH */
    #define GCM_SMALL
    // #define HAVE_AES_DECRYPT
#endif

#if defined(WOLF_CONF_AESCBC) && WOLF_CONF_AESCBC == 1
    #define HAVE_AES_CBC
    // #define HAVE_AES_DECRYPT
#endif

/* Other possible AES modes */
//#define WOLFSSL_AES_COUNTER
#define HAVE_AESCCM
// #define NO_AES_DECRYPT
//#define WOLFSSL_AES_XTS
//#define WOLFSSL_AES_DIRECT
//#define HAVE_AES_ECB
//#define HAVE_AES_KEYWRAP
//#define AES_MAX_KEY_SIZE 256

It appears this stems from how the wc_AesDecrypt function is brought in in aes.c

#ifdef HAVE_AES_DECRYPT
    #if defined(WOLFSSL_AES_DIRECT) || defined(HAVE_AESCCM)
    static WARN_UNUSED_RESULT int wc_AesDecrypt(
        Aes* aes, const byte* inBlock, byte* outBlock)
    {

If you have AESCCM enabled then this is brought in automatically. Given we don't use this function and want to avoid the compilation error, is there a combination of user settings that can accomplish this?

Thank you.