Skip to main content

secure_compare

Function secure_compare 

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

Constant-time equality comparison.

Unlike ==, the runtime does not depend on where the first differing byte occurs. Length mismatch still returns false immediately (lengths are not secret in this crate).