test_suite_ecp: Updated ecp_mod_p_generic_raw for optimised reduction.

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
This commit is contained in:
Minos Galanakis 2023-06-09 15:11:41 +01:00
parent 65210952ec
commit effff764e1

View file

@ -1406,16 +1406,18 @@ void ecp_mod_setup(char *input_A, int id, int ctype, int iret)
TEST_EQUAL(ret, iret);
if (ret == 0) {
TEST_ASSERT(m.int_rep != MBEDTLS_MPI_MOD_REP_INVALID);
/* Test for limb sizes */
TEST_EQUAL(m.limbs, p_limbs);
bytes = p_limbs * sizeof(mbedtls_mpi_uint);
/* Test for validity of moduli by the presence of Montgomery consts */
TEST_ASSERT(m.rep.mont.mm != 0);
TEST_ASSERT(m.rep.mont.rr != NULL);
if (m.int_rep == MBEDTLS_MPI_MOD_REP_MONTGOMERY) {
/* Test for validity of moduli by the presence of Montgomery consts */
TEST_ASSERT(m.rep.mont.mm != 0);
TEST_ASSERT(m.rep.mont.rr != NULL);
} else {
TEST_ASSERT(m.rep.ored.modp != NULL);
}
/* Compare output byte-by-byte */
ASSERT_COMPARE(p, bytes, m.p, bytes);