hacspec_lib::prelude

Function cswap_bit

Source
pub fn cswap_bit<T: Integer + Copy>(x: T, y: T, c: T) -> (T, T)
Expand description

Conditional, constant-time swapping. Returns (x, y) if c == 0 and (y, x) if c == 1.