test/crypto: add negative cases for NXP drivers
authorHemant Agrawal <hemant.agrawal@nxp.com>
Tue, 1 Oct 2019 11:41:19 +0000 (17:11 +0530)
committerAkhil Goyal <akhil.goyal@nxp.com>
Wed, 9 Oct 2019 09:50:12 +0000 (11:50 +0200)
Negative cases with wrong cipher/auth text added
to dpaa_sec and dpaa2_sec PMD test suites.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
app/test/test_cryptodev.c

index c83d962..089adf8 100644 (file)
@@ -12128,6 +12128,16 @@ static struct unit_test_suite cryptodev_dpaa_sec_testsuite  = {
                TEST_CASE_ST(ut_setup, ut_teardown,
                        test_AES_GCM_auth_encrypt_SGL_out_of_place_1500B_2000B),
 
+               /** Negative tests */
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       authentication_verify_HMAC_SHA1_fail_data_corrupt),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       authentication_verify_HMAC_SHA1_fail_tag_corrupt),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       auth_decryption_AES128CBC_HMAC_SHA1_fail_data_corrupt),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       auth_decryption_AES128CBC_HMAC_SHA1_fail_tag_corrupt),
+
                TEST_CASES_END() /**< NULL terminate unit test array */
        }
 };
@@ -12351,6 +12361,16 @@ static struct unit_test_suite cryptodev_dpaa2_sec_testsuite  = {
                TEST_CASE_ST(ut_setup, ut_teardown,
                        test_zuc_hash_generate_test_case_8),
 
+               /** Negative tests */
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       authentication_verify_HMAC_SHA1_fail_data_corrupt),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       authentication_verify_HMAC_SHA1_fail_tag_corrupt),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       auth_decryption_AES128CBC_HMAC_SHA1_fail_data_corrupt),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       auth_decryption_AES128CBC_HMAC_SHA1_fail_tag_corrupt),
+
                TEST_CASES_END() /**< NULL terminate unit test array */
        }
 };