Fix documentation

Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
This commit is contained in:
Gabor Mezei 2022-10-14 16:29:42 +02:00
parent 8bcd7cca94
commit 4086de667d
No known key found for this signature in database
GPG Key ID: F072ACA227ACD71D
2 changed files with 18 additions and 16 deletions

View File

@ -75,12 +75,13 @@ void mbedtls_mpi_core_bigendian_to_host( mbedtls_mpi_uint *A,
size_t A_limbs ); size_t A_limbs );
/** /**
* \brief Perform a safe conditional copy of MPI which doesn't reveal whether * \brief Perform a safe conditional copy of an MPI which doesn't reveal
* the condition was true or not. * whether assignment was done or not.
* *
* \param[out] X The address of the first MPI. This must be initialized. * \param[out] X The address of the destination MPI.
* Must have enough limbs to store the full value of \p A. * This must be initialized. Must have enough limbs to
* \param[in] A The address of the second MPI. This must be initialized. * 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 limbs The number of limbs of \p A.
* \param assign The condition deciding whether to perform the * \param assign The condition deciding whether to perform the
* assignment or not. Must be either 0 or 1: * 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 * \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 * 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, void mbedtls_mpi_core_cond_assign( mbedtls_mpi_uint *X,
const mbedtls_mpi_uint *A, const mbedtls_mpi_uint *A,
@ -100,8 +101,8 @@ void mbedtls_mpi_core_cond_assign( mbedtls_mpi_uint *X,
unsigned char assign ); unsigned char assign );
/** /**
* \brief Perform a safe conditional swap of MPI which doesn't reveal whether * \brief Perform a safe conditional swap of two MPIs which doesn't reveal
* the condition was true or not. * whether the swap was done or not.
* *
* \param[in,out] X The address of the first MPI. * \param[in,out] X The address of the first MPI.
* This must be initialized. * This must be initialized.

View File

@ -34,14 +34,15 @@
#include "bignum_mod.h" #include "bignum_mod.h"
/** /**
* \brief Perform a safe conditional copy of MPI which doesn't reveal whether * \brief Perform a safe conditional copy of an MPI which doesn't reveal
* the condition was true or not. * whether the assignment was done or not.
* *
* The size to copy is determined by \p N. * The size to copy is determined by \p N.
* *
* \param[out] X The address of the first MPI. This must be initialized. * \param[out] X The address of the destination MPI.
* Must have enough limbs to store the full value of \p A. * This must be initialized. Must have enough limbs to
* \param[in] A The address of the second MPI. This must be initialized. * 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[in] N The address of the modulus related to \p X and \p A.
* \param assign The condition deciding whether to perform the * \param assign The condition deciding whether to perform the
* assignment or not. Must be either 0 or 1: * 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 * \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 * 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, void mbedtls_mpi_mod_raw_cond_assign( mbedtls_mpi_uint *X,
const mbedtls_mpi_uint *A, const mbedtls_mpi_uint *A,
@ -61,8 +62,8 @@ void mbedtls_mpi_mod_raw_cond_assign( mbedtls_mpi_uint *X,
unsigned char assign ); unsigned char assign );
/** /**
* \brief Perform a safe conditional swap of MPI which doesn't reveal whether * \brief Perform a safe conditional swap of two MPIs which doesn't reveal
* the condition was true or not. * whether the swap was done or not.
* *
* The size to swap is determined by \p N. * The size to swap is determined by \p N.
* *