Add dedicated test cases for psa_hash_compare
psa_hash_compare is tested for good cases and invalid-signature cases
in hash_compute_compare. Also test invalid-argument cases. Also run a
few autonomous test cases with valid arguments.
diff --git a/tests/suites/test_suite_psa_crypto.function b/tests/suites/test_suite_psa_crypto.function
index c9c45b7..a2be082 100644
--- a/tests/suites/test_suite_psa_crypto.function
+++ b/tests/suites/test_suite_psa_crypto.function
@@ -2457,6 +2457,26 @@
/* END_CASE */
/* BEGIN_CASE */
+void hash_compare_fail( int alg_arg, data_t *input,
+ data_t *reference_hash,
+ int expected_status_arg )
+{
+ psa_algorithm_t alg = alg_arg;
+ psa_status_t expected_status = expected_status_arg;
+ psa_status_t status;
+
+ PSA_ASSERT( psa_crypto_init( ) );
+
+ status = psa_hash_compare( alg, input->x, input->len,
+ reference_hash->x, reference_hash->len );
+ TEST_EQUAL( status, expected_status );
+
+exit:
+ PSA_DONE( );
+}
+/* END_CASE */
+
+/* BEGIN_CASE */
void hash_compute_compare( int alg_arg, data_t *input,
data_t *expected_output )
{