From c51168039bd0e7c502666ad95bbc3001ef7b725c Mon Sep 17 00:00:00 2001 From: Felix Conway Date: Tue, 29 Jul 2025 15:50:05 +0100 Subject: [PATCH] Clarify mpi_gdc() documentation when B is 0 Signed-off-by: Felix Conway --- include/mbedtls/bignum.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/mbedtls/bignum.h b/include/mbedtls/bignum.h index b06aec9ce8..297c0a6ba4 100644 --- a/include/mbedtls/bignum.h +++ b/include/mbedtls/bignum.h @@ -974,6 +974,8 @@ int mbedtls_mpi_random(mbedtls_mpi *X, * \brief Compute the greatest common divisor: G = gcd(A, B) * * \param G The destination MPI. This must point to an initialized MPI. + * This will be positive unless \p B is 0, in which case \p A + * will be returned, where \p A could be negative. * \param A The first operand. This must point to an initialized MPI. * \param B The second operand. This must point to an initialized MPI. *