Skip to main content

ct_eq_slice

Function ct_eq_slice 

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

Constant-time equality for two byte slices.

Returns Choice::FALSE immediately if slice lengths differ (slice length is assumed to be public metadata, e.g., fixed ciphertext size). When lengths are equal, every byte is inspected without short-circuiting.