Check all of the limbs of result

Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com>
This commit is contained in:
Xiaokang Qian 2023-05-17 09:20:34 +00:00
parent 1ae7ca435b
commit c81272461e

View File

@ -1563,7 +1563,7 @@ void ecp_mod_mul_inv(char *input_A, int id, int ctype, int iret)
mbedtls_mpi_uint *A_inverse = NULL;
mbedtls_mpi_uint *A = NULL;
mbedtls_mpi_uint *bufx = NULL;
const mbedtls_mpi_uint one = 1;
const mbedtls_mpi_uint one[2] = {1, 0};
((void) iret);
@ -1592,7 +1592,7 @@ void ecp_mod_mul_inv(char *input_A, int id, int ctype, int iret)
TEST_EQUAL(mbedtls_mpi_mod_write(&rX, &m, (unsigned char *) bufx,
limbs * sizeof(mbedtls_mpi_uint),
MBEDTLS_MPI_MOD_EXT_REP_LE), 0);
TEST_EQUAL(memcmp(bufx, &one, sizeof(mbedtls_mpi_uint)), 0);
TEST_EQUAL(memcmp(bufx, one, sizeof(one)), 0);
exit: