Add curve sizes to ECC curve metadata validation tests
This commit is contained in:
parent
3052f53c37
commit
fa764b161b
@ -285,120 +285,120 @@ key_type:PSA_KEY_TYPE_DSA_KEYPAIR:KEY_TYPE_IS_KEYPAIR | KEY_TYPE_IS_DSA
|
||||
|
||||
ECC key types: sect163k1
|
||||
depends_on:MBEDTLS_ECP_DP_SECT163K1_ENABLED
|
||||
ecc_key_types:PSA_ECC_CURVE_SECT163K1
|
||||
ecc_key_types:PSA_ECC_CURVE_SECT163K1:163
|
||||
|
||||
ECC key types: sect163r1
|
||||
depends_on:MBEDTLS_ECP_DP_SECT163R1_ENABLED
|
||||
ecc_key_types:PSA_ECC_CURVE_SECT163R1
|
||||
ecc_key_types:PSA_ECC_CURVE_SECT163R1:163
|
||||
|
||||
ECC key types: sect163r2
|
||||
depends_on:MBEDTLS_ECP_DP_SECT163R2_ENABLED
|
||||
ecc_key_types:PSA_ECC_CURVE_SECT163R2
|
||||
ecc_key_types:PSA_ECC_CURVE_SECT163R2:163
|
||||
|
||||
ECC key types: sect193r1
|
||||
depends_on:MBEDTLS_ECP_DP_SECT193R1_ENABLED
|
||||
ecc_key_types:PSA_ECC_CURVE_SECT193R1
|
||||
ecc_key_types:PSA_ECC_CURVE_SECT193R1:193
|
||||
|
||||
ECC key types: sect193r2
|
||||
depends_on:MBEDTLS_ECP_DP_SECT193R2_ENABLED
|
||||
ecc_key_types:PSA_ECC_CURVE_SECT193R2
|
||||
ecc_key_types:PSA_ECC_CURVE_SECT193R2:193
|
||||
|
||||
ECC key types: sect233k1
|
||||
depends_on:MBEDTLS_ECP_DP_SECT233K1_ENABLED
|
||||
ecc_key_types:PSA_ECC_CURVE_SECT233K1
|
||||
ecc_key_types:PSA_ECC_CURVE_SECT233K1:233
|
||||
|
||||
ECC key types: sect233r1
|
||||
depends_on:MBEDTLS_ECP_DP_SECT233R1_ENABLED
|
||||
ecc_key_types:PSA_ECC_CURVE_SECT233R1
|
||||
ecc_key_types:PSA_ECC_CURVE_SECT233R1:233
|
||||
|
||||
ECC key types: sect239k1
|
||||
depends_on:MBEDTLS_ECP_DP_SECT239K1_ENABLED
|
||||
ecc_key_types:PSA_ECC_CURVE_SECT239K1
|
||||
ecc_key_types:PSA_ECC_CURVE_SECT239K1:239
|
||||
|
||||
ECC key types: sect283k1
|
||||
depends_on:MBEDTLS_ECP_DP_SECT283K1_ENABLED
|
||||
ecc_key_types:PSA_ECC_CURVE_SECT283K1
|
||||
ecc_key_types:PSA_ECC_CURVE_SECT283K1:283
|
||||
|
||||
ECC key types: sect283r1
|
||||
depends_on:MBEDTLS_ECP_DP_SECT283R1_ENABLED
|
||||
ecc_key_types:PSA_ECC_CURVE_SECT283R1
|
||||
ecc_key_types:PSA_ECC_CURVE_SECT283R1:283
|
||||
|
||||
ECC key types: sect409k1
|
||||
depends_on:MBEDTLS_ECP_DP_SECT409K1_ENABLED
|
||||
ecc_key_types:PSA_ECC_CURVE_SECT409K1
|
||||
ecc_key_types:PSA_ECC_CURVE_SECT409K1:409
|
||||
|
||||
ECC key types: sect409r1
|
||||
depends_on:MBEDTLS_ECP_DP_SECT409R1_ENABLED
|
||||
ecc_key_types:PSA_ECC_CURVE_SECT409R1
|
||||
ecc_key_types:PSA_ECC_CURVE_SECT409R1:409
|
||||
|
||||
ECC key types: sect571k1
|
||||
depends_on:MBEDTLS_ECP_DP_SECT571K1_ENABLED
|
||||
ecc_key_types:PSA_ECC_CURVE_SECT571K1
|
||||
ecc_key_types:PSA_ECC_CURVE_SECT571K1:571
|
||||
|
||||
ECC key types: sect571r1
|
||||
depends_on:MBEDTLS_ECP_DP_SECT571R1_ENABLED
|
||||
ecc_key_types:PSA_ECC_CURVE_SECT571R1
|
||||
ecc_key_types:PSA_ECC_CURVE_SECT571R1:571
|
||||
|
||||
ECC key types: secp160k1
|
||||
depends_on:MBEDTLS_ECP_DP_SECP160K1_ENABLED
|
||||
ecc_key_types:PSA_ECC_CURVE_SECP160K1
|
||||
ecc_key_types:PSA_ECC_CURVE_SECP160K1:160
|
||||
|
||||
ECC key types: secp160r1
|
||||
depends_on:MBEDTLS_ECP_DP_SECP160R1_ENABLED
|
||||
ecc_key_types:PSA_ECC_CURVE_SECP160R1
|
||||
ecc_key_types:PSA_ECC_CURVE_SECP160R1:160
|
||||
|
||||
ECC key types: secp160r2
|
||||
depends_on:MBEDTLS_ECP_DP_SECP160R2_ENABLED
|
||||
ecc_key_types:PSA_ECC_CURVE_SECP160R2
|
||||
ecc_key_types:PSA_ECC_CURVE_SECP160R2:160
|
||||
|
||||
ECC key types: secp192k1
|
||||
depends_on:MBEDTLS_ECP_DP_SECP192K1_ENABLED
|
||||
ecc_key_types:PSA_ECC_CURVE_SECP192K1
|
||||
ecc_key_types:PSA_ECC_CURVE_SECP192K1:192
|
||||
|
||||
ECC key types: secp192r1
|
||||
depends_on:MBEDTLS_ECP_DP_SECP192R1_ENABLED
|
||||
ecc_key_types:PSA_ECC_CURVE_SECP192R1
|
||||
ecc_key_types:PSA_ECC_CURVE_SECP192R1:192
|
||||
|
||||
ECC key types: secp224k1
|
||||
depends_on:MBEDTLS_ECP_DP_SECP224K1_ENABLED
|
||||
ecc_key_types:PSA_ECC_CURVE_SECP224K1
|
||||
ecc_key_types:PSA_ECC_CURVE_SECP224K1:224
|
||||
|
||||
ECC key types: secp224r1
|
||||
depends_on:MBEDTLS_ECP_DP_SECP224R1_ENABLED
|
||||
ecc_key_types:PSA_ECC_CURVE_SECP224R1
|
||||
ecc_key_types:PSA_ECC_CURVE_SECP224R1:224
|
||||
|
||||
ECC key types: secp256k1
|
||||
depends_on:MBEDTLS_ECP_DP_SECP256K1_ENABLED
|
||||
ecc_key_types:PSA_ECC_CURVE_SECP256K1
|
||||
ecc_key_types:PSA_ECC_CURVE_SECP256K1:256
|
||||
|
||||
ECC key types: secp256r1
|
||||
depends_on:MBEDTLS_ECP_DP_SECP256R1_ENABLED
|
||||
ecc_key_types:PSA_ECC_CURVE_SECP256R1
|
||||
ecc_key_types:PSA_ECC_CURVE_SECP256R1:256
|
||||
|
||||
ECC key types: secp384r1
|
||||
depends_on:MBEDTLS_ECP_DP_SECP384R1_ENABLED
|
||||
ecc_key_types:PSA_ECC_CURVE_SECP384R1
|
||||
ecc_key_types:PSA_ECC_CURVE_SECP384R1:384
|
||||
|
||||
ECC key types: secp521r1
|
||||
depends_on:MBEDTLS_ECP_DP_SECP521R1_ENABLED
|
||||
ecc_key_types:PSA_ECC_CURVE_SECP521R1
|
||||
ecc_key_types:PSA_ECC_CURVE_SECP521R1:521
|
||||
|
||||
ECC key types: Brainpool P256R1
|
||||
depends_on:MBEDTLS_ECP_DP_BP256R1_ENABLED
|
||||
ecc_key_types:PSA_ECC_CURVE_BRAINPOOL_P256R1
|
||||
ecc_key_types:PSA_ECC_CURVE_BRAINPOOL_P256R1:256
|
||||
|
||||
ECC key types: Brainpool P384R1
|
||||
depends_on:MBEDTLS_ECP_DP_BP384R1_ENABLED
|
||||
ecc_key_types:PSA_ECC_CURVE_BRAINPOOL_P384R1
|
||||
ecc_key_types:PSA_ECC_CURVE_BRAINPOOL_P384R1:384
|
||||
|
||||
ECC key types: Brainpool P512R1
|
||||
depends_on:MBEDTLS_ECP_DP_BP512R1_ENABLED
|
||||
ecc_key_types:PSA_ECC_CURVE_BRAINPOOL_P512R1
|
||||
ecc_key_types:PSA_ECC_CURVE_BRAINPOOL_P512R1:512
|
||||
|
||||
ECC key types: Curve25519
|
||||
depends_on:MBEDTLS_ECP_DP_CURVE25519_ENABLED
|
||||
ecc_key_types:PSA_ECC_CURVE_CURVE25519
|
||||
ecc_key_types:PSA_ECC_CURVE_CURVE25519:255
|
||||
|
||||
ECC key types: Curve448
|
||||
depends_on:MBEDTLS_ECP_DP_CURVE448_ENABLED
|
||||
ecc_key_types:PSA_ECC_CURVE_CURVE448
|
||||
ecc_key_types:PSA_ECC_CURVE_CURVE448:448
|
||||
|
@ -335,9 +335,10 @@ void key_type( int type_arg, int classification_flags )
|
||||
/* END_CASE */
|
||||
|
||||
/* BEGIN_CASE */
|
||||
void ecc_key_types( int curve_arg )
|
||||
void ecc_key_types( int curve_arg, int curve_bits_arg )
|
||||
{
|
||||
psa_ecc_curve_t curve = curve_arg;
|
||||
size_t curve_bits = curve_bits_arg;
|
||||
psa_key_type_t public_type = PSA_KEY_TYPE_ECC_PUBLIC_KEY( curve );
|
||||
psa_key_type_t pair_type = PSA_KEY_TYPE_ECC_KEYPAIR( curve );
|
||||
|
||||
@ -346,5 +347,10 @@ void ecc_key_types( int curve_arg )
|
||||
|
||||
TEST_ASSERT( PSA_KEY_TYPE_GET_CURVE( public_type ) == curve );
|
||||
TEST_ASSERT( 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_ASSERT( curve_bits <= PSA_VENDOR_ECC_MAX_CURVE_BITS );
|
||||
}
|
||||
/* END_CASE */
|
||||
|
Loading…
Reference in New Issue
Block a user