Skip to main content

consttime

Function consttime 

Source
pub fn consttime(bits: impl FnMut() -> u64) -> f64
Expand description

Port of uniformbinary64_consttime_smear: like consttime_cmove, but the flag is computed by smearing every set bit of m down to bit 0, so it is branchless at the source level, independently of the compiler. This is the variant Taylor prefers for security-sensitive uses, since no compiler-inserted test can leak the (secret) value of m through a timing side channel.

Always consumes three 64-bit words.