Function subtle::byte_is_nonzero [] [src]

pub fn byte_is_nonzero(b: u8) -> Mask

Test if a byte is non-zero in constant time.

let mut x: u8;
x = 0;
assert!(byte_is_nonzero(x) == 0);
x = 3;
assert!(byte_is_nonzero(x) == 1);

Return

  • If b != 0, returns 1u8.
  • If b == 0, returns 0u8.