mbedtls icon indicating copy to clipboard operation
mbedtls copied to clipboard

Bignum: Add comparison for the fixed width MPI types

Open yanesca opened this issue 2 years ago • 0 comments

Add the following functions to bignum_mod and bignum_mod_raw

  • _equals(): takes two MPI and a modulus argument and tests whether they are equal
  • _is_zero(): takes an MPI argument and tests whether it is zero
  • _check(): takes an MPI and a modulus argument and checks whether the MPI is the canonical representative (whether it is less than the modulus)

Make these functions constant time and test them with the constant time macros (TEST_CF_PUBLIC, TEST_CF_PUBLIC). For an example unit tests like this, see mpi_core_lt_ct().

yanesca avatar Aug 25 '22 10:08 yanesca