Skip to main content

constant_time_eq

Function constant_time_eq 

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

Compare two byte strings without returning early on the first difference, so the time taken does not reveal how much of a secret was guessed right. Different lengths compare unequal (the length itself is not hidden).