Skip to main content

ct_select_array_into

Function ct_select_array_into 

Source
pub fn ct_select_array_into<const N: usize>(
    if_false: &[u8; N],
    if_true: &[u8; N],
    choice: Choice,
    out: &mut [u8; N],
)
Expand description

Constant-time selection of fixed-size byte arrays directly into out.

Used directly in ML-KEM implicit rejection (FIPS 203, Algorithm 18) to choose between the real shared secret K' and the rejection key K_bar without branching or creating an intermediate stack copy of the selected secret.