@@ -11613,6 +11613,8 @@ static wc_test_ret_t aes_xts_128_test(void)
1161311613}
1161411614#endif /* WOLFSSL_AES_128 */
1161511615
11616+ #ifndef HAVE_FIPS
11617+ /* FIPS won't allow for XTS-384 (two 192-bit keys) */
1161611618#ifdef WOLFSSL_AES_192
1161711619static wc_test_ret_t aes_xts_192_test(void)
1161811620{
@@ -11703,7 +11705,6 @@ static wc_test_ret_t aes_xts_192_test(void)
1170311705 0x65, 0x37, 0x15, 0x53, 0xf1, 0x98, 0xab, 0xb4
1170411706 };
1170511707
11706- #ifndef HAVE_FIPS /* FIPS requires different keys for main and tweak. */
1170711708 WOLFSSL_SMALL_STACK_STATIC unsigned char k3[] = {
1170811709 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
1170911710 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
@@ -11730,7 +11731,6 @@ static wc_test_ret_t aes_xts_192_test(void)
1173011731 0xe8, 0xc5, 0x99, 0x3d, 0x58, 0x3c, 0xeb, 0xba,
1173111732 0x86, 0xea, 0x2c, 0x7e, 0x1f, 0xba, 0x81, 0xde
1173211733 };
11733- #endif /* HAVE_FIPS */
1173411734
1173511735#if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_NO_MALLOC)
1173611736 if ((aes = (XtsAes *)XMALLOC(sizeof *aes, HEAP_HINT, DYNAMIC_TYPE_AES)) == NULL)
@@ -12045,8 +12045,6 @@ static wc_test_ret_t aes_xts_192_test(void)
1204512045 if (XMEMCMP(p2, buf, sizeof(p2)))
1204612046 ERROR_OUT(WC_TEST_RET_ENC_NC, out);
1204712047
12048- #ifndef HAVE_FIPS
12049-
1205012048 /* Test ciphertext stealing in-place. */
1205112049 XMEMCPY(buf, p3, sizeof(p3));
1205212050 ret = wc_AesXtsSetKeyNoInit(aes, k3, sizeof(k3), AES_ENCRYPTION);
@@ -12130,8 +12128,6 @@ static wc_test_ret_t aes_xts_192_test(void)
1213012128 ERROR_OUT(WC_TEST_RET_ENC_NC, out);
1213112129#endif /* WOLFSSL_AESXTS_STREAM */
1213212130
12133- #endif /* !HAVE_FIPS */
12134-
1213512131#if !defined(BENCH_EMBEDDED) && !defined(HAVE_CAVIUM) && \
1213612132 !defined(WOLFSSL_AFALG)
1213712133 {
@@ -12316,7 +12312,7 @@ static wc_test_ret_t aes_xts_192_test(void)
1231612312 return ret;
1231712313}
1231812314#endif /* WOLFSSL_AES_192 */
12319-
12315+ #endif /* HAVE_FIPS */
1232012316
1232112317#ifdef WOLFSSL_AES_256
1232212318static wc_test_ret_t aes_xts_256_test(void)
@@ -14665,11 +14661,14 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t aes_xts_test(void)
1466514661 return ret;
1466614662 #endif
1466714663
14664+ /* FIPS won't allow for XTS-384 (two 192-bit keys) */
14665+ #ifndef HAVE_FIPS
1466814666 #ifdef WOLFSSL_AES_192
1466914667 ret = aes_xts_192_test();
1467014668 if (ret != 0)
1467114669 return ret;
1467214670 #endif
14671+ #endif
1467314672
1467414673 #ifdef WOLFSSL_AES_256
1467514674 ret = aes_xts_256_test();
0 commit comments