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];