From 63c3282ec473a76fa7d3d65bc8d57e1fe9022873 Mon Sep 17 00:00:00 2001 From: Gabor Mezei Date: Thu, 15 Sep 2022 20:01:31 +0200 Subject: [PATCH] Remove retrun code from mod_raw_cond_assign/swap Signed-off-by: Gabor Mezei --- library/bignum_mod_raw.c | 24 ++++++++++++------------ library/bignum_mod_raw.h | 27 +++++++++------------------ 2 files changed, 21 insertions(+), 30 deletions(-) diff --git a/library/bignum_mod_raw.c b/library/bignum_mod_raw.c index f04354d4cb..60ff9bbed8 100644 --- a/library/bignum_mod_raw.c +++ b/library/bignum_mod_raw.c @@ -41,22 +41,22 @@ #include "bignum_mod.h" #include "constant_time_internal.h" -int mbedtls_mpi_mod_raw_cond_assign( mbedtls_mpi_uint *X, - mbedtls_mpi_uint *Y, - const mbedtls_mpi_mod_modulus *m, - unsigned char assign ) +void mbedtls_mpi_mod_raw_cond_assign( mbedtls_mpi_uint *X, + mbedtls_mpi_uint *Y, + const mbedtls_mpi_mod_modulus *m, + unsigned char assign ) { - return mbedtls_mpi_core_cond_assign( X, m->limbs, - Y, m->limbs, assign ); + mbedtls_mpi_core_cond_assign( X, m->limbs, + Y, m->limbs, assign ); } -int mbedtls_mpi_mod_raw_cond_swap( mbedtls_mpi_uint *X, - mbedtls_mpi_uint *Y, - const mbedtls_mpi_mod_modulus *m, - unsigned char swap ) +void mbedtls_mpi_mod_raw_cond_swap( mbedtls_mpi_uint *X, + mbedtls_mpi_uint *Y, + const mbedtls_mpi_mod_modulus *m, + unsigned char swap ) { - return mbedtls_mpi_core_cond_swap( X, m->limbs, - Y, m->limbs, swap ); + mbedtls_mpi_core_cond_swap( X, m->limbs, + Y, m->limbs, swap ); } int mbedtls_mpi_mod_raw_read( mbedtls_mpi_uint *X, diff --git a/library/bignum_mod_raw.h b/library/bignum_mod_raw.h index 00ec921e62..bdd2eada90 100644 --- a/library/bignum_mod_raw.h +++ b/library/bignum_mod_raw.h @@ -51,16 +51,11 @@ * \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. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL if \p X isn't - * large enough to hold the value in \p Y. - * \return #MBEDTLS_ERR_MPI_BAD_INPUT_DATA if \p X or \p Y is invalid. */ -int mbedtls_mpi_mod_raw_cond_assign( mbedtls_mpi_uint *X, - mbedtls_mpi_uint *Y, - const mbedtls_mpi_mod_modulus *m, - unsigned char assign ); +void mbedtls_mpi_mod_raw_cond_assign( mbedtls_mpi_uint *X, + mbedtls_mpi_uint *Y, + const mbedtls_mpi_mod_modulus *m, + unsigned char assign ); /** * \brief Perform a safe conditional copy of MPI which doesn't reveal whether @@ -80,15 +75,11 @@ int mbedtls_mpi_mod_raw_cond_assign( mbedtls_mpi_uint *X, * \warning If \p swap is neither 0 nor 1, the result of this function * is indeterminate, and both \p X and \p Y might end up with * values different to either of the original ones. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL if the size of - * \p X and \p Y is differ. - * \return #MBEDTLS_ERR_MPI_BAD_INPUT_DATA if \p X or \p Y is invalid. - */int mbedtls_mpi_mod_raw_cond_swap( mbedtls_mpi_uint *X, - mbedtls_mpi_uint *Y, - const mbedtls_mpi_mod_modulus *m, - unsigned char swap ); + */ +void mbedtls_mpi_mod_raw_cond_swap( mbedtls_mpi_uint *X, + mbedtls_mpi_uint *Y, + const mbedtls_mpi_mod_modulus *m, + unsigned char swap ); /** Import X from unsigned binary data. *