mbedtls_ct_size_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 (size_t) -1 This function can be used to write constant-time code by replacing branches with bit operations using masks.
Syntax
size_t mbedtls_ct_size_mask(size_t value); Arguments
value
The value to analyze.
Return value
Zero if \p value is zero, otherwise all-bits-one.