Safeguard against calling p255 reduction with single-width MPI
(In this case, there's nothing to do anyway since we only do a quasi-reduction to N+1 limbs) Signed-off-by: Hanno Becker <hanno.becker@arm.com>
This commit is contained in:
parent
25bb732ea7
commit
6454993e2e
1 changed files with 1 additions and 1 deletions
|
@ -5223,7 +5223,7 @@ static int ecp_mod_p255( mbedtls_mpi *N )
|
|||
/* Helper references for top part of N */
|
||||
mbedtls_mpi_uint * const NT_p = N->p + P255_WIDTH;
|
||||
unsigned const NT_n = N->n - P255_WIDTH;
|
||||
if( NT_n > P255_WIDTH )
|
||||
if( NT_n == 0 || NT_n > P255_WIDTH )
|
||||
return( 0 );
|
||||
|
||||
/* Split N as N + 2^256 M */
|
||||
|
|
Loading…
Reference in a new issue