diff --git a/tests/api/test_aes.c b/tests/api/test_aes.c index 98adc3a03..173b59167 100644 --- a/tests/api/test_aes.c +++ b/tests/api/test_aes.c @@ -273,7 +273,7 @@ int test_wc_AesCtsEncryptDecrypt(void) #if !defined(NO_AES) && defined(WOLFSSL_AES_CTS) && \ defined(HAVE_AES_DECRYPT) && defined(WOLFSSL_AES_128) /* Test vectors taken form RFC3962 Appendix B */ - struct { + const struct { const char* input; const char* output; size_t inLen; @@ -330,7 +330,7 @@ int test_wc_AesCtsEncryptDecrypt(void) 64, 64 } }; - byte keyBytes[AES_128_KEY_SIZE] = { + const byte keyBytes[AES_128_KEY_SIZE] = { 0x63, 0x68, 0x69, 0x63, 0x6b, 0x65, 0x6e, 0x20, 0x74, 0x65, 0x72, 0x69, 0x79, 0x61, 0x6b, 0x69 }; diff --git a/wolfcrypt/src/aes.c b/wolfcrypt/src/aes.c index 754390d4f..095cba94c 100644 --- a/wolfcrypt/src/aes.c +++ b/wolfcrypt/src/aes.c @@ -14925,8 +14925,7 @@ int wc_AesCtsEncrypt(const byte* key, word32 keySz, byte* out, #ifdef WOLFSSL_SMALL_STACK Aes *aes = NULL; #else - Aes _aes; - Aes *aes = &_aes; + Aes aes[1]; #endif int ret = 0; word32 outSz = inSz; @@ -14964,8 +14963,7 @@ int wc_AesCtsDecrypt(const byte* key, word32 keySz, byte* out, #ifdef WOLFSSL_SMALL_STACK Aes *aes = NULL; #else - Aes _aes; - Aes *aes = &_aes; + Aes aes[1]; #endif int ret = 0; word32 outSz = inSz;