Replace TEST_ASSERT with TEST_EQUAL in LMS tests

Signed-off-by: Raef Coles <raef.coles@arm.com>
This commit is contained in:
Raef Coles 2022-10-12 14:19:52 +01:00
parent f9b8502865
commit d0c701237a
No known key found for this signature in database
GPG Key ID: 1AAF1B43DF2086F4

View File

@ -27,16 +27,16 @@ void lms_sign_verify_test ( data_t *msg, data_t *seed )
mbedtls_test_rnd_std_rand, NULL,
seed->x, seed->len );
TEST_ASSUME( rc != MBEDTLS_ERR_LMS_ALLOC_FAILED );
TEST_ASSERT( rc == 0 );
TEST_EQUAL( rc, 0 );
TEST_ASSERT( mbedtls_lms_calculate_public_key( &pub_ctx, &priv_ctx ) == 0 );
TEST_EQUAL( mbedtls_lms_calculate_public_key( &pub_ctx, &priv_ctx ), 0 );
TEST_ASSERT( mbedtls_lms_sign( &priv_ctx, mbedtls_test_rnd_std_rand, NULL,
TEST_EQUAL( mbedtls_lms_sign( &priv_ctx, mbedtls_test_rnd_std_rand, NULL,
msg->x, msg->len, sig, sizeof( sig ),
NULL ) == 0 );
NULL ), 0 );
TEST_ASSERT( mbedtls_lms_verify( &pub_ctx, msg->x, msg->len, sig,
sizeof( sig ) ) == 0 );
TEST_EQUAL( mbedtls_lms_verify( &pub_ctx, msg->x, msg->len, sig,
sizeof( sig ) ), 0 );
exit:
mbedtls_lms_public_free( &pub_ctx );
@ -63,16 +63,16 @@ void lms_sign_verify_null_msg_test( data_t *seed )
mbedtls_test_rnd_std_rand, NULL,
seed->x, seed->len );
TEST_ASSUME( rc != MBEDTLS_ERR_LMS_ALLOC_FAILED );
TEST_ASSERT( rc == 0 );
TEST_EQUAL( rc, 0 );
TEST_ASSERT( mbedtls_lms_calculate_public_key( &pub_ctx, &priv_ctx ) == 0 );
TEST_EQUAL( mbedtls_lms_calculate_public_key( &pub_ctx, &priv_ctx ), 0 );
TEST_ASSERT( mbedtls_lms_sign( &priv_ctx, mbedtls_test_rnd_std_rand, NULL,
TEST_EQUAL( mbedtls_lms_sign( &priv_ctx, mbedtls_test_rnd_std_rand, NULL,
NULL, 0, sig, sizeof( sig ),
NULL ) == 0 );
NULL ), 0 );
TEST_ASSERT( mbedtls_lms_verify( &pub_ctx, NULL, 0, sig,
sizeof( sig ) ) == 0 );
TEST_EQUAL( mbedtls_lms_verify( &pub_ctx, NULL, 0, sig,
sizeof( sig ) ), 0 );
exit:
mbedtls_lms_public_free( &pub_ctx );