Skip to main content

CtEqSlice

Trait CtEqSlice 

Source
pub trait CtEqSlice: CtEq + Sized {
    // Provided methods
    fn ct_eq_slice(a: &[Self], b: &[Self]) -> Choice { ... }
    fn ct_ne_slice(a: &[Self], b: &[Self]) -> Choice { ... }
}
Expand description

Implementing this trait enables use of the CtEq trait for [T] where T is the Self type implementing the trait, via a blanket impl.

It needs to be a separate trait from CtEq because we need to be able to impl CtEq for [T] which is ?Sized.

Provided Methods§

Source

fn ct_eq_slice(a: &[Self], b: &[Self]) -> Choice

Determine if a is equal to b in constant-time.

Source

fn ct_ne_slice(a: &[Self], b: &[Self]) -> Choice

Determine if a is NOT equal to b in constant-time.

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.

Implementations on Foreign Types§

Source§

impl CtEqSlice for Ordering

Source§

impl CtEqSlice for i8

Source§

fn ct_eq_slice(a: &[Self], b: &[Self]) -> Choice

Source§

impl CtEqSlice for i16

Source§

fn ct_eq_slice(a: &[Self], b: &[Self]) -> Choice

Source§

impl CtEqSlice for i32

Source§

fn ct_eq_slice(a: &[Self], b: &[Self]) -> Choice

Source§

impl CtEqSlice for i64

Source§

fn ct_eq_slice(a: &[Self], b: &[Self]) -> Choice

Source§

impl CtEqSlice for i128

Source§

fn ct_eq_slice(a: &[Self], b: &[Self]) -> Choice

Source§

impl CtEqSlice for isize

Source§

impl CtEqSlice for u8

Source§

fn ct_eq_slice(a: &[Self], b: &[Self]) -> Choice

Source§

impl CtEqSlice for u16

Source§

fn ct_eq_slice(a: &[Self], b: &[Self]) -> Choice

Source§

impl CtEqSlice for u32

Source§

fn ct_eq_slice(a: &[Self], b: &[Self]) -> Choice

Source§

impl CtEqSlice for u64

Source§

fn ct_eq_slice(a: &[Self], b: &[Self]) -> Choice

Source§

impl CtEqSlice for u128

Source§

fn ct_eq_slice(a: &[Self], b: &[Self]) -> Choice

Source§

impl CtEqSlice for usize

Source§

impl CtEqSlice for NonZeroI8

Source§

impl CtEqSlice for NonZeroI16

Source§

impl CtEqSlice for NonZeroI32

Source§

impl CtEqSlice for NonZeroI64

Source§

impl CtEqSlice for NonZeroI128

Source§

impl CtEqSlice for NonZeroU8

Source§

impl CtEqSlice for NonZeroU16

Source§

impl CtEqSlice for NonZeroU32

Source§

impl CtEqSlice for NonZeroU64

Source§

impl CtEqSlice for NonZeroU128

Source§

impl<T, const N: usize> CtEqSlice for [T; N]
where T: CtEqSlice,

Implementors§