tests: Extend AES-XTS suite
Extend the existing test suite for AES-XTS with checks for error reporting
and the IEEE P1619/D16 test vectors.
diff --git a/tests/suites/test_suite_aes.function b/tests/suites/test_suite_aes.function
index a7da0ac..aec4a49 100644
--- a/tests/suites/test_suite_aes.function
+++ b/tests/suites/test_suite_aes.function
@@ -237,6 +237,29 @@
}
/* END_CASE */
+/* BEGIN_CASE depends_on:MBEDTLS_CIPHER_MODE_XTS */
+void aes_crypt_xts_size( int size, int retval )
+{
+ mbedtls_aes_xts_context ctx;
+ const unsigned char *src = NULL;
+ unsigned char *output = NULL;
+ unsigned char data_unit[16];
+ size_t length = size;
+
+ mbedtls_aes_xts_init( &ctx );
+ memset( data_unit, 0x00, sizeof( data_unit ) );
+
+
+ /* Note that this function will most likely crash on failure, as NULL
+ * parameters will be used. In the passing case, the length check in
+ * mbedtls_aes_crypt_xts() will prevent any accesses to parameters by
+ * exiting the function early. */
+ TEST_ASSERT( mbedtls_aes_crypt_xts( &ctx, MBEDTLS_AES_ENCRYPT, length, data_unit, src, output ) == retval );
+}
+/* END_CASE */
+
+
+
/* BEGIN_CASE depends_on:MBEDTLS_CIPHER_MODE_CFB */
void aes_encrypt_cfb128( char *hex_key_string, char *hex_iv_string,
char *hex_src_string, char *hex_dst_string )