Clean up some comments
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
diff --git a/library/bignum.c b/library/bignum.c
index db46a0e..68460df 100644
--- a/library/bignum.c
+++ b/library/bignum.c
@@ -1104,7 +1104,7 @@
return( ret );
}
-/*
+/**
* Helper for mbedtls_mpi subtraction.
*
* Calculate d - s where d and s have the same size.
@@ -1114,7 +1114,7 @@
* \param n Number of limbs of \p d and \p s.
* \param[in,out] d On input, the left operand.
* On output, the result of the subtraction:
- * \param[s] The right operand.
+ * \param[in] s The right operand.
*
* \return 1 if `d < s`.
* 0 if `d >= s`.
@@ -1145,9 +1145,6 @@
size_t n;
mbedtls_mpi_uint carry;
- /* if( mbedtls_mpi_cmp_abs( A, B ) < 0 ) */
- /* return( MBEDTLS_ERR_MPI_NEGATIVE_VALUE ); */
-
mbedtls_mpi_init( &TB );
if( X == B )
@@ -1788,7 +1785,7 @@
/* Copy the n least significant limbs of d to A, so that
* A = d if d < N (recall that N has n limbs). */
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. */
/* Set d to d0 + (2^biL)^n - N where d0 is the current value of d. */
d[n] += 1;