pub trait ConstantTimeEq<Rhs: ?Sized = Self> {
// Required method
fn ct_eq(&self, other: &Rhs) -> Choice;
// Provided method
fn ct_ne(&self, other: &Rhs) -> Choice { ... }
}Expand description
Native data-oblivious equality trait.
For slices, length is public: length mismatch may return immediately, while equal-length inputs must compare all elements.
Required Methods§
Provided Methods§
Sourcefn ct_ne(&self, other: &Rhs) -> Choice
fn ct_ne(&self, other: &Rhs) -> Choice
Negated ConstantTimeEq::ct_eq.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Implementors§
impl ConstantTimeEq for GuardedSecretVec
impl ConstantTimeEq for LockedSecretVec
Available on non-
miri and non-WebAssembly only.impl ConstantTimeEq for SecretString
Available on crate feature
alloc only.impl ConstantTimeEq for SecretVec
Available on crate feature
alloc only.impl ConstantTimeEq<[u8]> for GuardedSecretVec
impl ConstantTimeEq<[u8]> for LockedSecretVec
Available on non-
miri and non-WebAssembly only.impl ConstantTimeEq<[u8]> for SecretVec
Available on crate feature
alloc only.impl ConstantTimeEq<str> for SecretString
Available on crate feature
alloc only.