mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-30 22:43:08 +03:00
@ -33,16 +33,6 @@
|
|||||||
#include "bn_mul.h"
|
#include "bn_mul.h"
|
||||||
#include "constant_time_internal.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)
|
inline size_t mbedtls_mpi_core_clz(mbedtls_mpi_uint a)
|
||||||
{
|
{
|
||||||
#if defined(__has_builtin)
|
#if defined(__has_builtin)
|
||||||
|
@ -101,10 +101,13 @@
|
|||||||
(((X)[(i) / ciL] >> (((i) % ciL) * 8)) & 0xff)
|
(((X)[(i) / ciL] >> (((i) % ciL) * 8)) & 0xff)
|
||||||
|
|
||||||
/** Count leading zero bits in a given integer.
|
/** 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.
|
* \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);
|
size_t mbedtls_mpi_core_clz(mbedtls_mpi_uint a);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user