mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-02-28 09:39:53 +00:00
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
@ -5223,7 +5223,7 @@ static int ecp_mod_p255( mbedtls_mpi *N )
|
|||||||
/* Helper references for top part of N */
|
/* Helper references for top part of N */
|
||||||
mbedtls_mpi_uint * const NT_p = N->p + P255_WIDTH;
|
mbedtls_mpi_uint * const NT_p = N->p + P255_WIDTH;
|
||||||
unsigned const NT_n = N->n - 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 );
|
return( 0 );
|
||||||
|
|
||||||
/* Split N as N + 2^256 M */
|
/* Split N as N + 2^256 M */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user