pub trait SecureCompare: Sized {
// Required methods
fn secure_eq(&self, other: &Self) -> bool;
fn secure_cmp(&self, other: &Self) -> Choice;
}
Expand description
Trait for types that can be securely compared
This trait provides constant-time comparison operations to prevent timing attacks.
Required Methods§
Sourcefn secure_cmp(&self, other: &Self) -> Choice
fn secure_cmp(&self, other: &Self) -> Choice
Compare two values and return a constant-time choice
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.