From 7d063f6467478dea6d223dd405bead7e119de9bc Mon Sep 17 00:00:00 2001 From: Thomas Daubney Date: Fri, 22 Apr 2022 11:36:07 +0100 Subject: [PATCH] Adds comments for clarification Adds two comments to clarify 1) why an offset is used in the call to psa_aead_verify() and 2) why the test of .hits_finish is always 0 in this test case. Signed-off-by: Thomas Daubney --- tests/suites/test_suite_psa_crypto_driver_wrappers.function | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/suites/test_suite_psa_crypto_driver_wrappers.function b/tests/suites/test_suite_psa_crypto_driver_wrappers.function index e4a19424f..a5ea8407f 100644 --- a/tests/suites/test_suite_psa_crypto_driver_wrappers.function +++ b/tests/suites/test_suite_psa_crypto_driver_wrappers.function @@ -2521,6 +2521,8 @@ void aead_decrypt_setup( int key_type_arg, data_t *key_data, TEST_EQUAL( mbedtls_test_driver_aead_hooks.hits_update, forced_status == PSA_SUCCESS ? 1 : 0 ); + /* Offset applied to output_data in order to handle cases where verify() + * outputs further data */ PSA_ASSERT( psa_aead_verify( &operation, output_data + output_length, output_size - output_length, &verify_output_length, input_tag->x, @@ -2529,6 +2531,8 @@ void aead_decrypt_setup( int key_type_arg, data_t *key_data, TEST_EQUAL( mbedtls_test_driver_aead_hooks.hits_verify, forced_status == PSA_SUCCESS ? 1 : 0 ); + /* Since this is a decryption operation, + * finish should never be hit */ TEST_EQUAL( mbedtls_test_driver_aead_hooks.hits_finish, 0 ); TEST_EQUAL( mbedtls_test_driver_aead_hooks.hits_abort,