Function constant_time_compare

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

Constant-time comparison of two byte slices

This function performs a constant-time comparison to prevent timing attacks.

§Arguments

  • a - First byte slice
  • b - Second byte slice

§Returns

true if the slices are equal, false otherwise