mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-11 22:15:44 +00:00
Clean up some comments
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
fa85cc2da5
commit
f3317e6035
|
@ -1104,7 +1104,7 @@ cleanup:
|
||||||
return( ret );
|
return( ret );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Helper for mbedtls_mpi subtraction.
|
* Helper for mbedtls_mpi subtraction.
|
||||||
*
|
*
|
||||||
* Calculate d - s where d and s have the same size.
|
* Calculate d - s where d and s have the same size.
|
||||||
|
@ -1114,7 +1114,7 @@ cleanup:
|
||||||
* \param n Number of limbs of \p d and \p s.
|
* \param n Number of limbs of \p d and \p s.
|
||||||
* \param[in,out] d On input, the left operand.
|
* \param[in,out] d On input, the left operand.
|
||||||
* On output, the result of the subtraction:
|
* On output, the result of the subtraction:
|
||||||
* \param[s] The right operand.
|
* \param[in] s The right operand.
|
||||||
*
|
*
|
||||||
* \return 1 if `d < s`.
|
* \return 1 if `d < s`.
|
||||||
* 0 if `d >= s`.
|
* 0 if `d >= s`.
|
||||||
|
@ -1145,9 +1145,6 @@ int mbedtls_mpi_sub_abs( mbedtls_mpi *X, const mbedtls_mpi *A, const mbedtls_mpi
|
||||||
size_t n;
|
size_t n;
|
||||||
mbedtls_mpi_uint carry;
|
mbedtls_mpi_uint carry;
|
||||||
|
|
||||||
/* if( mbedtls_mpi_cmp_abs( A, B ) < 0 ) */
|
|
||||||
/* return( MBEDTLS_ERR_MPI_NEGATIVE_VALUE ); */
|
|
||||||
|
|
||||||
mbedtls_mpi_init( &TB );
|
mbedtls_mpi_init( &TB );
|
||||||
|
|
||||||
if( X == B )
|
if( X == B )
|
||||||
|
@ -1788,7 +1785,7 @@ static void mpi_montmul( mbedtls_mpi *A, const mbedtls_mpi *B, const mbedtls_mpi
|
||||||
/* Copy the n least significant limbs of d to A, so that
|
/* Copy the n least significant limbs of d to A, so that
|
||||||
* A = d if d < N (recall that N has n limbs). */
|
* A = d if d < N (recall that N has n limbs). */
|
||||||
memcpy( A->p, d, n * ciL );
|
memcpy( A->p, d, n * ciL );
|
||||||
/* If d >= N then we want to set A to N - d. To prevent timing attacks,
|
/* If d >= N then we want to set A to d - N. To prevent timing attacks,
|
||||||
* do the calculation without using conditional tests. */
|
* do the calculation without using conditional tests. */
|
||||||
/* Set d to d0 + (2^biL)^n - N where d0 is the current value of d. */
|
/* Set d to d0 + (2^biL)^n - N where d0 is the current value of d. */
|
||||||
d[n] += 1;
|
d[n] += 1;
|
||||||
|
|
Loading…
Reference in a new issue