From 88ecbe176da8600c982e008b90b7135a9b0f4722 Mon Sep 17 00:00:00 2001 From: Paul Elliott Date: Wed, 22 Sep 2021 17:23:03 +0100 Subject: [PATCH] Test generated nonce test generates expected sizes (But only in the positive test cases) Signed-off-by: Paul Elliott --- tests/suites/test_suite_psa_crypto.function | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/suites/test_suite_psa_crypto.function b/tests/suites/test_suite_psa_crypto.function index 406509091..cd97c5063 100644 --- a/tests/suites/test_suite_psa_crypto.function +++ b/tests/suites/test_suite_psa_crypto.function @@ -3747,6 +3747,10 @@ void aead_multipart_generate_nonce( int key_type_arg, data_t *key_data, TEST_EQUAL( actual_nonce_length, expected_nonce_length ); + if( expected_status == PSA_SUCCESS ) + TEST_EQUAL( actual_nonce_length, PSA_AEAD_NONCE_LENGTH( key_type, + alg ) ); + TEST_ASSERT( actual_nonce_length < PSA_AEAD_NONCE_MAX_SIZE ); if( expected_status == PSA_SUCCESS )