Skip to main content

constant_time_eq

Function constant_time_eq 

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

Compares two byte slices in constant time with respect to their contents using 8-byte word XORs.

§Arguments

  • &[u8] - First byte slice.
  • &[u8] - Second byte slice.

§Returns

  • bool - true iff both slices have identical length and contents.