mbedtls icon indicating copy to clipboard operation
mbedtls copied to clipboard

Document and test the input ranges for which mbedtls_mpi_core_montmul() produces canonical results

Open tom-cosgrove-arm opened this issue 3 years ago • 0 comments

It is common (especially in PQC, less so in ECC) to accumulate non-canonical results (>= N, the modulus), reducing when the value nears the word boundary (the number of limbs in N).

This task is to document which of the inputs to mbedtls_mpi_core_montmul() must be canonical (< N), and which do not need to be, in order for the result to be correct, and in order for the output to be in canonical form.

Unit tests should be added, including corner cases.

tom-cosgrove-arm avatar Aug 25 '22 13:08 tom-cosgrove-arm