Ignore carry since it can not be generated

Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
This commit is contained in:
Gabor Mezei 2023-04-24 16:34:29 +02:00
parent d2c0ba172c
commit 03367fe42d
No known key found for this signature in database
GPG key ID: FEE76C0CF8C6267D

View file

@ -5575,7 +5575,14 @@ static inline int ecp_mod_koblitz(mbedtls_mpi_uint *X,
/* X = A0 + R * A1 */ /* X = A0 + R * A1 */
mbedtls_mpi_core_mul(M, A1, A1_limbs, R, R_limbs); mbedtls_mpi_core_mul(M, A1, A1_limbs, R, R_limbs);
mbedtls_mpi_core_add(X, X, M, A1_limbs + R_limbs); (void) mbedtls_mpi_core_add(X, X, M, A1_limbs + R_limbs);
/* Carry can not be generated since R is a 33-bit value and stored in
* 64 bits. The result value of the multiplication is at most
* P length + 33 bits in length and the result value of the addition
* is at most P length + 34 bits in length. So the result of the
* addition always fits in P length + 64 bits.
*/
} }
cleanup: cleanup: