mbedtls_ct_uint_mask() function
Turn a value into a mask: - if \p value == 0, return the all-bits 0 mask, aka 0 - otherwise, return the all-bits 1 mask, aka (unsigned) -1 This function can be used to write constant-time code by replacing branches with bit operations using masks.
Syntax
unsigned mbedtls_ct_uint_mask(unsigned value); Arguments
value
The value to analyze.
Return value
Zero if \p value is zero, otherwise all-bits-one.