pub trait SubtleEqExt {
// Required method
fn subtle_ct_eq(&self, expected: &[u8]) -> Choice;
// Provided method
fn subtle_verify(&self, expected: &[u8]) -> bool { ... }
}Expand description
Extension trait for comparing base64-ng buffers with subtle.
The comparison delegates equal-length byte comparisons to
subtle::ConstantTimeEq. Length mismatch remains public and returns
Choice::from(0).
Required Methods§
Sourcefn subtle_ct_eq(&self, expected: &[u8]) -> Choice
fn subtle_ct_eq(&self, expected: &[u8]) -> Choice
Compares self with expected using subtle for equal-length inputs.
Length is public. If lengths differ, this returns Choice::from(0).
Provided Methods§
Sourcefn subtle_verify(&self, expected: &[u8]) -> bool
fn subtle_verify(&self, expected: &[u8]) -> bool
Convenience boolean wrapper around Self::subtle_ct_eq.
Prefer Self::subtle_ct_eq when composing with other subtle
decisions.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl SubtleEqExt for &[u8]
impl SubtleEqExt for &[u8]
fn subtle_ct_eq(&self, expected: &[u8]) -> Choice
Source§impl SubtleEqExt for SecretBuffer
Available on crate feature alloc only.
impl SubtleEqExt for SecretBuffer
Available on crate feature
alloc only.