Skip to main content

ct_eq

Function ct_eq 

Source
pub fn ct_eq<A, B>(a: A, b: B) -> bool
where A: AsRef<[u8]>, B: AsRef<[u8]>,
Expand description

Constant-time comparison of two byte slices

Returns true if the slices are equal, false otherwise. Length is treated as public and a mismatch returns early; for equal lengths, comparison has no data-dependent early exit in this source implementation. Concrete compiler and target behavior remains subject to the release assembly checks.