From 35f1d7f0aa9547d305eb4bd947fa6a1ca8e35503 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Thu, 19 Mar 2015 12:42:40 +0000 Subject: [PATCH] Update signature of mpi_mul_mpi() --- ChangeLog | 1 + include/mbedtls/bignum.h | 9 ++++----- library/bignum.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 16b2f84c7..4ae771b05 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ Features * Support for DTLS 1.0 and 1.2 (RFC 6347). API Changes + * Signature of mpi_mul_mpi() changed to make the last argument unsigned * Remove the PBKDF2 module (use PKCS5). * Remove POLARSSL_ERROR_STRERROR_BC (use mbedtls_strerror()). * Headers are now found in the 'mbedtls' directory (previously 'polarssl'). diff --git a/include/mbedtls/bignum.h b/include/mbedtls/bignum.h index df25bd1f1..44248f360 100644 --- a/include/mbedtls/bignum.h +++ b/include/mbedtls/bignum.h @@ -571,18 +571,17 @@ int mpi_mul_mpi( mpi *X, const mpi *A, const mpi *B ); /** * \brief Baseline multiplication: X = A * b - * Note: despite the functon signature, b is treated as a - * t_uint. Negative values of b are treated as large positive - * values. * * \param X Destination MPI * \param A Left-hand MPI - * \param b The integer value to multiply with + * \param b The unsigned integer value to multiply with + * + * \note b is unsigned * * \return 0 if successful, * POLARSSL_ERR_MPI_MALLOC_FAILED if memory allocation failed */ -int mpi_mul_int( mpi *X, const mpi *A, t_sint b ); +int mpi_mul_int( mpi *X, const mpi *A, t_uint b ); /** * \brief Division by mpi: A = Q * B + R diff --git a/library/bignum.c b/library/bignum.c index 86376a470..2d04eb46e 100644 --- a/library/bignum.c +++ b/library/bignum.c @@ -1170,7 +1170,7 @@ cleanup: /* * Baseline multiplication: X = A * b */ -int mpi_mul_int( mpi *X, const mpi *A, t_sint b ) +int mpi_mul_int( mpi *X, const mpi *A, t_uint b ) { mpi _B; t_uint p[1];