New macro to get the bit size of an elliptic curve

This commit is contained in:
Gilles Peskine 2019-05-13 12:51:03 +02:00
parent ca5bed742f
commit 536e20571a
2 changed files with 42 additions and 3 deletions

View file

@ -477,9 +477,7 @@ void ecc_key_types( int curve_arg, int curve_bits_arg )
TEST_EQUAL( PSA_KEY_TYPE_GET_CURVE( public_type ), curve );
TEST_EQUAL( PSA_KEY_TYPE_GET_CURVE( pair_type ), curve );
/* Validate that the bit size is less than the maximum ECC bit size
* in this implementation. There's no parameter that should be equal
* to curve_bits and can be validated without creating a key. */
TEST_EQUAL( curve_bits, PSA_ECC_CURVE_BITS( curve ) );
TEST_ASSERT( curve_bits <= PSA_VENDOR_ECC_MAX_CURVE_BITS );
}
/* END_CASE */