Skip to content

Commit 685764f

Browse files
Fix useless calls in PSA crypto metadata tests
In ecc_key_family test, the parity of the elliptic curve identifier was computed but not tested to be even. In dh_key_family test, the parity of the PSA Diffie-Hellman group identifier was computed but not tested to be even. Signed-off-by: Ronald Cron <[email protected]>
1 parent 9dde11f commit 685764f

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

tests/suites/test_suite_psa_crypto_metadata.function

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ int test_parity( uint32_t value )
7070
value ^= value >> 4;
7171
return( 0x9669 & 1 << ( value & 0xf ) );
7272
}
73-
#define TEST_PARITY( value ) \
74-
TEST_ASSERT( test_parity( value ) )
7573

7674
void algorithm_classification( psa_algorithm_t alg, unsigned flags )
7775
{
@@ -130,7 +128,7 @@ void key_type_classification( psa_key_type_t type, unsigned flags )
130128
( PSA_KEY_TYPE_IS_DH( type ) &&
131129
PSA_KEY_TYPE_IS_PUBLIC_KEY( type ) ) );
132130

133-
TEST_PARITY( type );
131+
TEST_ASSERT( test_parity( type ) );
134132

135133
exit: ;
136134
}
@@ -502,7 +500,7 @@ void ecc_key_family( int curve_arg )
502500
psa_key_type_t public_type = PSA_KEY_TYPE_ECC_PUBLIC_KEY( curve );
503501
psa_key_type_t pair_type = PSA_KEY_TYPE_ECC_KEY_PAIR( curve );
504502

505-
test_parity( curve );
503+
TEST_ASSERT( test_parity( curve ) );
506504

507505
test_key_type( public_type, KEY_TYPE_IS_ECC | KEY_TYPE_IS_PUBLIC_KEY );
508506
test_key_type( pair_type, KEY_TYPE_IS_ECC | KEY_TYPE_IS_KEY_PAIR );
@@ -519,7 +517,7 @@ void dh_key_family( int group_arg )
519517
psa_key_type_t public_type = PSA_KEY_TYPE_DH_PUBLIC_KEY( group );
520518
psa_key_type_t pair_type = PSA_KEY_TYPE_DH_KEY_PAIR( group );
521519

522-
test_parity( group );
520+
TEST_ASSERT( test_parity( group ) );
523521

524522
test_key_type( public_type, KEY_TYPE_IS_DH | KEY_TYPE_IS_PUBLIC_KEY );
525523
test_key_type( pair_type, KEY_TYPE_IS_DH | KEY_TYPE_IS_KEY_PAIR );

0 commit comments

Comments
 (0)