diff --git a/library/bignum_core.c b/library/bignum_core.c index 998c06c8fd..ba6c0c13ae 100644 --- a/library/bignum_core.c +++ b/library/bignum_core.c @@ -33,16 +33,6 @@ #include "bn_mul.h" #include "constant_time_internal.h" -/** - * \brief Count leading zeros - * - * \warning The result is undefined if \p a == 0 - * - * \param a The value to operate on - * - * \return The number of leading zeros, if \p a != 0. If \p a == 0, the result - * is undefined. - */ inline size_t mbedtls_mpi_core_clz(mbedtls_mpi_uint a) { #if defined(__has_builtin) diff --git a/library/bignum_core.h b/library/bignum_core.h index b3d05a34ef..158d2b3222 100644 --- a/library/bignum_core.h +++ b/library/bignum_core.h @@ -101,10 +101,13 @@ (((X)[(i) / ciL] >> (((i) % ciL) * 8)) & 0xff) /** Count leading zero bits in a given integer. + * + * \warning The result is undefined if \p a == 0 * * \param a Integer to count leading zero bits. * - * \return The number of leading zero bits in \p a. + * \return The number of leading zero bits in \p a, if \p a != 0. + * If \p a == 0, the result is undefined. */ size_t mbedtls_mpi_core_clz(mbedtls_mpi_uint a);