mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-01 10:06:53 +03:00
Merge pull request #6656 from tom-cosgrove-arm/bignum_pr_6225-updated
Bignum: add mod_raw_add
This commit is contained in:
@ -129,7 +129,16 @@ void mbedtls_mpi_mod_raw_sub( mbedtls_mpi_uint *X,
|
||||
/* END MERGE SLOT 4 */
|
||||
|
||||
/* BEGIN MERGE SLOT 5 */
|
||||
|
||||
void mbedtls_mpi_mod_raw_add( mbedtls_mpi_uint *X,
|
||||
const mbedtls_mpi_uint *A,
|
||||
const mbedtls_mpi_uint *B,
|
||||
const mbedtls_mpi_mod_modulus *N )
|
||||
{
|
||||
mbedtls_mpi_uint carry, borrow;
|
||||
carry = mbedtls_mpi_core_add( X, A, B, N->limbs );
|
||||
borrow = mbedtls_mpi_core_sub( X, X, N->p, N->limbs );
|
||||
(void) mbedtls_mpi_core_add_if( X, N->p, N->limbs, (unsigned) ( carry ^ borrow ) );
|
||||
}
|
||||
/* END MERGE SLOT 5 */
|
||||
|
||||
/* BEGIN MERGE SLOT 6 */
|
||||
|
Reference in New Issue
Block a user