constant_time_eq

Function constant_time_eq 

Source
fn constant_time_eq(a: &[u8], b: &[u8]) -> bool
Expand description

Length-aware constant-time byte comparison to avoid leaking the token via early-exit timing. Returns false immediately on length mismatch (the length itself is not secret), then folds all remaining bytes.