mirror of
https://github.com/cuberite/polarssl.git
synced 2025-10-03 02:23:32 -04:00
Fix size check in p25519 modular reduction
The check was meant to precisely catch an underflow. Signed-off-by: Hanno Becker <hanno.becker@arm.com>
This commit is contained in:
parent
0235f7512f
commit
2ef0cff6c3
@ -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;
|
||||||
const size_t NT_n = N->n - P255_WIDTH;
|
const size_t NT_n = N->n - P255_WIDTH;
|
||||||
if( NT_n == 0 || NT_n > P255_WIDTH )
|
if( NT_n == 0 || NT_n > N->n )
|
||||||
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