From 4086de667d1f6e091f068bbad1d3582c2946f33a Mon Sep 17 00:00:00 2001 From: Gabor Mezei Date: Fri, 14 Oct 2022 16:29:42 +0200 Subject: [PATCH] Fix documentation Signed-off-by: Gabor Mezei --- library/bignum_core.h | 17 +++++++++-------- library/bignum_mod_raw.h | 17 +++++++++-------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/library/bignum_core.h b/library/bignum_core.h index bd246d5e36..b626fab6e1 100644 --- a/library/bignum_core.h +++ b/library/bignum_core.h @@ -75,12 +75,13 @@ void mbedtls_mpi_core_bigendian_to_host( mbedtls_mpi_uint *A, size_t A_limbs ); /** - * \brief Perform a safe conditional copy of MPI which doesn't reveal whether - * the condition was true or not. + * \brief Perform a safe conditional copy of an MPI which doesn't reveal + * whether assignment was done or not. * - * \param[out] X The address of the first MPI. This must be initialized. - * Must have enough limbs to store the full value of \p A. - * \param[in] A The address of the second MPI. This must be initialized. + * \param[out] X The address of the destination MPI. + * This must be initialized. Must have enough limbs to + * store the full value of \p A. + * \param[in] A The address of the source MPI. This must be initialized. * \param limbs The number of limbs of \p A. * \param assign The condition deciding whether to perform the * assignment or not. Must be either 0 or 1: @@ -92,7 +93,7 @@ void mbedtls_mpi_core_bigendian_to_host( mbedtls_mpi_uint *A, * * \warning If \p assign is neither 0 nor 1, the result of this function * is indeterminate, and the resulting value in \p X might be - * neither its original value nor the value in \p Y. + * neither its original value nor the value in \p A. */ void mbedtls_mpi_core_cond_assign( mbedtls_mpi_uint *X, const mbedtls_mpi_uint *A, @@ -100,8 +101,8 @@ void mbedtls_mpi_core_cond_assign( mbedtls_mpi_uint *X, unsigned char assign ); /** - * \brief Perform a safe conditional swap of MPI which doesn't reveal whether - * the condition was true or not. + * \brief Perform a safe conditional swap of two MPIs which doesn't reveal + * whether the swap was done or not. * * \param[in,out] X The address of the first MPI. * This must be initialized. diff --git a/library/bignum_mod_raw.h b/library/bignum_mod_raw.h index 845ebaa5a7..f698a9a622 100644 --- a/library/bignum_mod_raw.h +++ b/library/bignum_mod_raw.h @@ -34,14 +34,15 @@ #include "bignum_mod.h" /** - * \brief Perform a safe conditional copy of MPI which doesn't reveal whether - * the condition was true or not. + * \brief Perform a safe conditional copy of an MPI which doesn't reveal + * whether the assignment was done or not. * * The size to copy is determined by \p N. * - * \param[out] X The address of the first MPI. This must be initialized. - * Must have enough limbs to store the full value of \p A. - * \param[in] A The address of the second MPI. This must be initialized. + * \param[out] X The address of the destination MPI. + * This must be initialized. Must have enough limbs to + * store the full value of \p A. + * \param[in] A The address of the source MPI. This must be initialized. * \param[in] N The address of the modulus related to \p X and \p A. * \param assign The condition deciding whether to perform the * assignment or not. Must be either 0 or 1: @@ -53,7 +54,7 @@ * * \warning If \p assign is neither 0 nor 1, the result of this function * is indeterminate, and the resulting value in \p X might be - * neither its original value nor the value in \p B. + * neither its original value nor the value in \p A. */ void mbedtls_mpi_mod_raw_cond_assign( mbedtls_mpi_uint *X, const mbedtls_mpi_uint *A, @@ -61,8 +62,8 @@ void mbedtls_mpi_mod_raw_cond_assign( mbedtls_mpi_uint *X, unsigned char assign ); /** - * \brief Perform a safe conditional swap of MPI which doesn't reveal whether - * the condition was true or not. + * \brief Perform a safe conditional swap of two MPIs which doesn't reveal + * whether the swap was done or not. * * The size to swap is determined by \p N. *