mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-12-24 17:41:01 +03:00
Change E closer to where it's used
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
committed by
Janos Follath
parent
07f2c69511
commit
7af166b827
@@ -616,7 +616,6 @@ int mbedtls_mpi_core_exp_mod( mbedtls_mpi_uint *X,
|
||||
mbedtls_mpi_uint one = 1, mm;
|
||||
|
||||
mm = mbedtls_mpi_core_montmul_init( N ); /* Compute Montgomery constant */
|
||||
E += E_limbs; /* Skip to end of exponent buffer */
|
||||
|
||||
wsize = exp_mod_get_window_size( E_limbs * biL );
|
||||
welem = ( (size_t) 1 ) << wsize;
|
||||
@@ -664,6 +663,9 @@ int mbedtls_mpi_core_exp_mod( mbedtls_mpi_uint *X,
|
||||
/* X = 1 (in Montgomery presentation) initially */
|
||||
memcpy( X, Wtable, AN_limbs * ciL );
|
||||
|
||||
/* Start from the end of exponent buffer */
|
||||
E += E_limbs;
|
||||
|
||||
size_t limb_bits_remaining = 0;
|
||||
mbedtls_mpi_uint cur_limb, window = 0;
|
||||
size_t window_bits = 0;
|
||||
|
||||
Reference in New Issue
Block a user