mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
Implement mbedtls_mpi_mod_add()
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
This commit is contained in:
@ -199,7 +199,35 @@ int mbedtls_mpi_mod_sub( mbedtls_mpi_mod_residue *X,
|
||||
/* END MERGE SLOT 4 */
|
||||
|
||||
/* BEGIN MERGE SLOT 5 */
|
||||
|
||||
/**
|
||||
* \brief Perform a fixed-size modular addition.
|
||||
*
|
||||
* Calculate `A + B modulo N`.
|
||||
*
|
||||
* \p A, \p B and \p X must all have the same number of limbs as \p N.
|
||||
*
|
||||
* \p X may be aliased to \p A or \p B, or even both, but may not overlap
|
||||
* either otherwise.
|
||||
*
|
||||
* \note This function does not check that \p A or \p B are in canonical
|
||||
* form (that is, are < \p N) - that will have been done by
|
||||
* mbedtls_mpi_mod_residue_setup().
|
||||
*
|
||||
* \param[out] X The address of the result MPI. Must be initialized.
|
||||
* Must have the same number of limbs as the modulus \p N.
|
||||
* \param[in] A The address of the first MPI.
|
||||
* \param[in] B The address of the second MPI.
|
||||
* \param[in] N The address of the modulus. Used to perform a modulo
|
||||
* operation on the result of the addition.
|
||||
*
|
||||
* \return \c 0 if successful.
|
||||
* \return #MBEDTLS_ERR_MPI_BAD_INPUT_DATA if the given MPIs do not
|
||||
* have the correct number of limbs.
|
||||
*/
|
||||
int mbedtls_mpi_mod_add( mbedtls_mpi_mod_residue *X,
|
||||
const mbedtls_mpi_mod_residue *A,
|
||||
const mbedtls_mpi_mod_residue *B,
|
||||
const mbedtls_mpi_mod_modulus *N );
|
||||
/* END MERGE SLOT 5 */
|
||||
|
||||
/* BEGIN MERGE SLOT 6 */
|
||||
|
Reference in New Issue
Block a user