mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-10-12 11:57:25 +00:00
Add another round in the Koblitz reduction
The addition can result in an overflow so another round is needed in the reduction. Signed-off-by: Gabor Mezei <[email protected]>
This commit is contained in:
@@ -5571,7 +5571,7 @@ static inline int ecp_mod_koblitz(mbedtls_mpi_uint *X,
|
||||
mask = ((mbedtls_mpi_uint) 1 << shift) - 1;
|
||||
}
|
||||
|
||||
for (size_t pass = 0; pass < 2; pass++) {
|
||||
for (size_t pass = 0; pass < 3; pass++) {
|
||||
/* Copy A1 */
|
||||
memcpy(A1, X + P_limbs - adjust, P_limbs * ciL);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user