mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-02-27 06:41:08 +00:00
Merge pull request #7857 from minosgalanakis/bugifx/address_curve_bits
[BigNum] test_suite_ecp: Fixed curve bit-length.
This commit is contained in:
commit
b5d97156e4
@ -1324,8 +1324,8 @@ void ecp_mod_p_generic_raw(int curve_id,
|
|||||||
#endif
|
#endif
|
||||||
#if defined(MBEDTLS_ECP_DP_SECP521R1_ENABLED) && defined(MBEDTLS_ECP_NIST_OPTIM)
|
#if defined(MBEDTLS_ECP_DP_SECP521R1_ENABLED) && defined(MBEDTLS_ECP_NIST_OPTIM)
|
||||||
case MBEDTLS_ECP_DP_SECP521R1:
|
case MBEDTLS_ECP_DP_SECP521R1:
|
||||||
limbs = BITS_TO_LIMBS(522) * 2;
|
limbs = BITS_TO_LIMBS(521) * 2;
|
||||||
curve_bits = 522;
|
curve_bits = 521;
|
||||||
curve_func = &mbedtls_ecp_mod_p521_raw;
|
curve_func = &mbedtls_ecp_mod_p521_raw;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
@ -1377,8 +1377,8 @@ void ecp_mod_p_generic_raw(int curve_id,
|
|||||||
|
|
||||||
TEST_EQUAL((*curve_func)(X, limbs_X), 0);
|
TEST_EQUAL((*curve_func)(X, limbs_X), 0);
|
||||||
|
|
||||||
TEST_LE_U(mbedtls_mpi_core_bitlen(X, limbs_X), curve_bits);
|
|
||||||
mbedtls_mpi_mod_raw_fix_quasi_reduction(X, &m);
|
mbedtls_mpi_mod_raw_fix_quasi_reduction(X, &m);
|
||||||
|
TEST_LE_U(mbedtls_mpi_core_bitlen(X, limbs_X), curve_bits);
|
||||||
TEST_MEMORY_COMPARE(X, bytes, res, bytes);
|
TEST_MEMORY_COMPARE(X, bytes, res, bytes);
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user