ext/lib/crypto/tinycrypt/source/ecc.c
/*
 * Find the left-most non-zero bit in p_vli.
 *
 * Side-channel countermeasure: algorithm strengthened against timing attack.
 */
Find the left-most non-zero bit in p_vli.
Side-channel countermeasure: algorithm strengthened against timing attack.
Find the left - most non - zero bit in p_vli . Side - channel countermeasure : algorithm strengthened against timing attack .
static uint32_t vli_numBits(uint32_t *p_vli)
{
	uint32_t l_digit;
	uint32_t i, acc = 32;
	uint32_t l_numDigits = vli_numDigits(p_vli);
	l_digit = p_vli[l_numDigits - 1];
	for (i = 0; i < 32; ++i) {
		acc -= !l_digit;
		l_digit >>= 1;
	}
	return ((l_numDigits - 1) * 32 + acc);
}
static uint32_t vli_numBits ( uint32_t * p_vli ) { uint32_t l_digit ; uint32_t i , acc = 32 ; uint32_t l_numDigits = vli_numDigits ( p_vli ) ; l_digit = p_vli [ l_numDigits - 1 ] ; for ( i = 0 ; i < 32 ; ++ i ) { acc -= ! l_digit ; l_digit >>= 1 ; } return ( ( l_numDigits - 1 ) * 32 + acc ) ; }
Find the left-most non-zero bit in p_vli.
Find the left - most non - zero bit in p_vli .