Skip to content

Commit e320b3c

Browse files
committed
fixup! Implement AES-CTS in wolfCrypt
1 parent 62bf90c commit e320b3c

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

tests/api/test_aes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ int test_wc_AesCtsEncryptDecrypt(void)
273273
#if !defined(NO_AES) && defined(WOLFSSL_AES_CTS) && \
274274
defined(HAVE_AES_DECRYPT) && defined(WOLFSSL_AES_128)
275275
/* Test vectors taken form RFC3962 Appendix B */
276-
struct {
276+
const struct {
277277
const char* input;
278278
const char* output;
279279
size_t inLen;
@@ -330,7 +330,7 @@ int test_wc_AesCtsEncryptDecrypt(void)
330330
64, 64
331331
}
332332
};
333-
byte keyBytes[AES_128_KEY_SIZE] = {
333+
const byte keyBytes[AES_128_KEY_SIZE] = {
334334
0x63, 0x68, 0x69, 0x63, 0x6b, 0x65, 0x6e, 0x20,
335335
0x74, 0x65, 0x72, 0x69, 0x79, 0x61, 0x6b, 0x69
336336
};

wolfcrypt/src/aes.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14925,8 +14925,7 @@ int wc_AesCtsEncrypt(const byte* key, word32 keySz, byte* out,
1492514925
#ifdef WOLFSSL_SMALL_STACK
1492614926
Aes *aes = NULL;
1492714927
#else
14928-
Aes _aes;
14929-
Aes *aes = &_aes;
14928+
Aes aes[1];
1493014929
#endif
1493114930
int ret = 0;
1493214931
word32 outSz = inSz;
@@ -14964,8 +14963,7 @@ int wc_AesCtsDecrypt(const byte* key, word32 keySz, byte* out,
1496414963
#ifdef WOLFSSL_SMALL_STACK
1496514964
Aes *aes = NULL;
1496614965
#else
14967-
Aes _aes;
14968-
Aes *aes = &_aes;
14966+
Aes aes[1];
1496914967
#endif
1497014968
int ret = 0;
1497114969
word32 outSz = inSz;

0 commit comments

Comments
 (0)