Skip to content

Commit 4da3652

Browse files
Merge pull request #9412 from SparkiDev/regression_fixes_21
Regression testing fixes
2 parents 967f520 + d845642 commit 4da3652

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

tests/api/test_aes.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2218,7 +2218,7 @@ int test_wc_AesCtrEncryptDecrypt(void)
22182218
};
22192219
#endif
22202220
#if defined(WOLFSSL_AES_128)
2221-
byte expected16[CBC_LEN] = {
2221+
byte expected16[CTR_LEN] = {
22222222
0x46, 0x1a, 0x5f, 0xfd, 0x9d, 0xf7, 0x91, 0x71,
22232223
0x35, 0x8e, 0x9e, 0x01, 0x77, 0xd8, 0x4e, 0xaa,
22242224
0x5f, 0x1f, 0x16, 0x26, 0xf9, 0xcd, 0xee, 0x15,
@@ -2239,7 +2239,7 @@ int test_wc_AesCtrEncryptDecrypt(void)
22392239
0xe4, 0x01, 0x2c, 0xd0, 0x82, 0xe2, 0x7a, 0x4a,
22402240
};
22412241
#elif defined(WOLFSSL_AES_192)
2242-
byte expected24[CBC_LEN] = {
2242+
byte expected24[CTR_LEN] = {
22432243
0x7b, 0xde, 0x53, 0xac, 0x88, 0x24, 0xe6, 0xde,
22442244
0x68, 0xd4, 0x64, 0x18, 0x20, 0x96, 0x62, 0x68,
22452245
0xb4, 0xc8, 0x6c, 0xa1, 0xae, 0xcc, 0x1e, 0x74,
@@ -2260,7 +2260,7 @@ int test_wc_AesCtrEncryptDecrypt(void)
22602260
0x5a, 0x4d, 0x6d, 0x7f, 0xfe, 0xb8, 0xaa, 0x9b,
22612261
};
22622262
#else
2263-
byte expected32[CBC_LEN] = {
2263+
byte expected32[CTR_LEN] = {
22642264
0x18, 0x5a, 0x48, 0xfd, 0xb7, 0xd5, 0x35, 0xf3,
22652265
0x3f, 0xb9, 0x14, 0x16, 0xf3, 0x05, 0xf3, 0x71,
22662266
0x72, 0x84, 0x88, 0x9a, 0x51, 0xe2, 0x97, 0xaa,

wolfcrypt/test/test.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16492,7 +16492,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t aesgcm_test(void)
1649216492

1649316493
int alen = 0;
1649416494
int plen = 0;
16495-
#ifdef ENABLE_NON_12BYTE_IV_TEST
16495+
#if defined(ENABLE_NON_12BYTE_IV_TEST) && defined(WOLFSSL_AES_128)
1649616496
int tlen = 0;
1649716497
#endif
1649816498
#if defined(WOLFSSL_XILINX_CRYPT_VERSAL)
@@ -16918,12 +16918,14 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t aesgcm_test(void)
1691816918
ERROR_OUT(WC_TEST_RET_ENC_NC, out);
1691916919
}
1692016920
#endif
16921+
#ifdef HAVE_AES_DECRYPT
1692116922
ret = wc_AesGcmDecrypt(enc, resultP, resultC, sizeof(c3),
1692216923
iv3, sizeof(iv3), resultT, tlen, a3, sizeof(a3));
1692316924
if (ret != 0)
1692416925
ERROR_OUT(WC_TEST_RET_ENC_EC(ret), out);
1692516926
if (XMEMCMP(p3, resultP, sizeof(p3)))
1692616927
ERROR_OUT(WC_TEST_RET_ENC_NC, out);
16928+
#endif
1692716929
}
1692816930

1692916931
/* Large buffer test */

0 commit comments

Comments
 (0)