Skip to main content

conditional_copy_bytes

Function conditional_copy_bytes 

Source
pub fn conditional_copy_bytes<const LEN: usize>(
    a: &[u8; LEN],
    b: &[u8; LEN],
    out: &mut [u8; LEN],
    take_a: bool,
)
Expand description

Copies either the contents of a or b into out according to take_a and it does it in a constant-time manner without branching.