mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-02-20 21:39:54 +00:00
test_suite_ecp: Added MBEDTLS_ECP_NIST_OPTIM
define guards.
This patch updates `ecp_mod_p_generic_raw` and corresponding curve test methods, that depend on the NIST optimisation parameter to not run when it is not included. The following curves are affected: * SECP192R1 * SECP224R1 * SECP256R1 * SECP384R1 * SECP521R1 Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
This commit is contained in:
parent
effff764e1
commit
450abfd922
@ -34,7 +34,8 @@ class EcpP192R1Raw(bignum_common.ModOperationCommon,
|
||||
test_name = "ecp_mod_p192_raw"
|
||||
input_style = "fixed"
|
||||
arity = 1
|
||||
dependencies = ["MBEDTLS_ECP_DP_SECP192R1_ENABLED"]
|
||||
dependencies = ["MBEDTLS_ECP_DP_SECP192R1_ENABLED",
|
||||
"MBEDTLS_ECP_NIST_OPTIM"]
|
||||
|
||||
moduli = ["fffffffffffffffffffffffffffffffeffffffffffffffff"] # type: List[str]
|
||||
|
||||
@ -110,7 +111,8 @@ class EcpP224R1Raw(bignum_common.ModOperationCommon,
|
||||
test_name = "ecp_mod_p224_raw"
|
||||
input_style = "arch_split"
|
||||
arity = 1
|
||||
dependencies = ["MBEDTLS_ECP_DP_SECP224R1_ENABLED"]
|
||||
dependencies = ["MBEDTLS_ECP_DP_SECP224R1_ENABLED",
|
||||
"MBEDTLS_ECP_NIST_OPTIM"]
|
||||
|
||||
moduli = ["ffffffffffffffffffffffffffffffff000000000000000000000001"] # type: List[str]
|
||||
|
||||
@ -187,7 +189,8 @@ class EcpP256R1Raw(bignum_common.ModOperationCommon,
|
||||
test_name = "ecp_mod_p256_raw"
|
||||
input_style = "fixed"
|
||||
arity = 1
|
||||
dependencies = ["MBEDTLS_ECP_DP_SECP256R1_ENABLED"]
|
||||
dependencies = ["MBEDTLS_ECP_DP_SECP256R1_ENABLED",
|
||||
"MBEDTLS_ECP_NIST_OPTIM"]
|
||||
|
||||
moduli = ["ffffffff00000001000000000000000000000000ffffffffffffffffffffffff"] # type: List[str]
|
||||
|
||||
@ -270,7 +273,8 @@ class EcpP384R1Raw(bignum_common.ModOperationCommon,
|
||||
test_name = "ecp_mod_p384_raw"
|
||||
input_style = "fixed"
|
||||
arity = 1
|
||||
dependencies = ["MBEDTLS_ECP_DP_SECP384R1_ENABLED"]
|
||||
dependencies = ["MBEDTLS_ECP_DP_SECP384R1_ENABLED",
|
||||
"MBEDTLS_ECP_NIST_OPTIM"]
|
||||
|
||||
moduli = [("ffffffffffffffffffffffffffffffffffffffffffffffff"
|
||||
"fffffffffffffffeffffffff0000000000000000ffffffff")
|
||||
@ -392,7 +396,8 @@ class EcpP521R1Raw(bignum_common.ModOperationCommon,
|
||||
test_name = "ecp_mod_p521_raw"
|
||||
input_style = "arch_split"
|
||||
arity = 1
|
||||
dependencies = ["MBEDTLS_ECP_DP_SECP521R1_ENABLED"]
|
||||
dependencies = ["MBEDTLS_ECP_DP_SECP521R1_ENABLED",
|
||||
"MBEDTLS_ECP_NIST_OPTIM"]
|
||||
|
||||
moduli = [("01ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
|
||||
"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")
|
||||
|
@ -1294,35 +1294,35 @@ void ecp_mod_p_generic_raw(int curve_id,
|
||||
bytes = limbs_N * sizeof(mbedtls_mpi_uint);
|
||||
|
||||
switch (curve_id) {
|
||||
#if defined(MBEDTLS_ECP_DP_SECP192R1_ENABLED)
|
||||
#if defined(MBEDTLS_ECP_DP_SECP192R1_ENABLED) && defined(MBEDTLS_ECP_NIST_OPTIM)
|
||||
case MBEDTLS_ECP_DP_SECP192R1:
|
||||
limbs = 2 * limbs_N;
|
||||
curve_bits = 192;
|
||||
curve_func = &mbedtls_ecp_mod_p192_raw;
|
||||
break;
|
||||
#endif
|
||||
#if defined(MBEDTLS_ECP_DP_SECP224R1_ENABLED)
|
||||
#if defined(MBEDTLS_ECP_DP_SECP224R1_ENABLED) && defined(MBEDTLS_ECP_NIST_OPTIM)
|
||||
case MBEDTLS_ECP_DP_SECP224R1:
|
||||
limbs = 448 / biL;
|
||||
curve_bits = 224;
|
||||
curve_func = &mbedtls_ecp_mod_p224_raw;
|
||||
break;
|
||||
#endif
|
||||
#if defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED)
|
||||
#if defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) && defined(MBEDTLS_ECP_NIST_OPTIM)
|
||||
case MBEDTLS_ECP_DP_SECP256R1:
|
||||
limbs = 2 * limbs_N;
|
||||
curve_bits = 256;
|
||||
curve_func = &mbedtls_ecp_mod_p256_raw;
|
||||
break;
|
||||
#endif
|
||||
#if defined(MBEDTLS_ECP_DP_SECP384R1_ENABLED)
|
||||
#if defined(MBEDTLS_ECP_DP_SECP384R1_ENABLED) && defined(MBEDTLS_ECP_NIST_OPTIM)
|
||||
case MBEDTLS_ECP_DP_SECP384R1:
|
||||
limbs = 2 * limbs_N;
|
||||
curve_bits = 384;
|
||||
curve_func = &mbedtls_ecp_mod_p384_raw;
|
||||
break;
|
||||
#endif
|
||||
#if defined(MBEDTLS_ECP_DP_SECP521R1_ENABLED)
|
||||
#if defined(MBEDTLS_ECP_DP_SECP521R1_ENABLED) && defined(MBEDTLS_ECP_NIST_OPTIM)
|
||||
case MBEDTLS_ECP_DP_SECP521R1:
|
||||
limbs = 2 * limbs_N;
|
||||
curve_bits = 522;
|
||||
|
Loading…
x
Reference in New Issue
Block a user