1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00

Add low level subtraction with modulus

Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
This commit is contained in:
Gabor Mezei
2022-11-09 14:07:43 +01:00
parent 531a871b88
commit 4c7cf7d742
2 changed files with 30 additions and 0 deletions

View File

@ -108,6 +108,16 @@ int mbedtls_mpi_mod_raw_write( const mbedtls_mpi_uint *A,
/* BEGIN MERGE SLOT 2 */
void mbedtls_mpi_mod_raw_sub( mbedtls_mpi_uint *X,
const mbedtls_mpi_uint *A,
const mbedtls_mpi_uint *B,
const mbedtls_mpi_mod_modulus *N )
{
mbedtls_mpi_uint c = mbedtls_mpi_core_sub( X, A, B, N->limbs );
(void) mbedtls_mpi_core_add_if( X, N->p, N->limbs, c );
}
/* END MERGE SLOT 2 */
/* BEGIN MERGE SLOT 3 */