1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-30 22:43:08 +03:00

Use X rather than A for accumulator-style input (and output!) params, and rename others accordingly

Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
This commit is contained in:
Tom Cosgrove
2022-09-15 15:55:07 +01:00
parent 5c0e8104bc
commit 3bd7bc3add
2 changed files with 27 additions and 27 deletions

View File

@ -293,8 +293,8 @@ int mbedtls_mpi_core_write_be( const mbedtls_mpi_uint *X,
return( 0 );
}
mbedtls_mpi_uint mbedtls_mpi_core_add_if( mbedtls_mpi_uint *A,
const mbedtls_mpi_uint *B,
mbedtls_mpi_uint mbedtls_mpi_core_add_if( mbedtls_mpi_uint *X,
const mbedtls_mpi_uint *A,
size_t limbs,
unsigned cond )
{
@ -305,12 +305,12 @@ mbedtls_mpi_uint mbedtls_mpi_core_add_if( mbedtls_mpi_uint *A,
for( size_t i = 0; i < limbs; i++ )
{
mbedtls_mpi_uint add = mask & B[i];
mbedtls_mpi_uint t = c + A[i];
c = ( t < A[i] );
mbedtls_mpi_uint add = mask & A[i];
mbedtls_mpi_uint t = c + X[i];
c = ( t < X[i] );
t += add;
c += ( t < add );
A[i] = t;
X[i] = t;
}
return( c );