Skip to main content

CtEq

Trait CtEq 

Source
pub trait CtEq<Rhs = Self>
where Rhs: ?Sized,
{ // Required method fn ct_eq(&self, other: &Rhs) -> Choice; // Provided method fn ct_ne(&self, other: &Rhs) -> Choice { ... } }
Expand description

Constant-time equality: like (Partial)Eq with Choice instead of bool.

Impl’d for: u8, u16, u32, u64, u128, usize, cmp::Ordering, Choice, and arrays/slices of any type which also impls CtEq.

This crate provides built-in implementations for the following types:

Required Methods§

Source

fn ct_eq(&self, other: &Rhs) -> Choice

Determine if self is equal to other in constant-time.

Provided Methods§

Source

fn ct_ne(&self, other: &Rhs) -> Choice

Determine if self is NOT equal to other in constant-time.

Implementations on Foreign Types§

Source§

impl CtEq for Ordering

Source§

fn ct_eq(&self, other: &Self) -> Choice

Source§

impl CtEq for i8

Source§

fn ct_eq(&self, other: &Self) -> Choice

Source§

impl CtEq for i16

Source§

fn ct_eq(&self, other: &Self) -> Choice

Source§

impl CtEq for i32

Source§

fn ct_eq(&self, other: &Self) -> Choice

Source§

impl CtEq for i64

Source§

fn ct_eq(&self, other: &Self) -> Choice

Source§

impl CtEq for i128

Source§

fn ct_eq(&self, other: &Self) -> Choice

Source§

impl CtEq for isize

Source§

fn ct_eq(&self, other: &Self) -> Choice

Source§

impl CtEq for u8

Source§

fn ct_eq(&self, other: &Self) -> Choice

Source§

impl CtEq for u16

Source§

fn ct_eq(&self, other: &Self) -> Choice

Source§

impl CtEq for u32

Source§

fn ct_eq(&self, other: &Self) -> Choice

Source§

impl CtEq for u64

Source§

fn ct_eq(&self, other: &Self) -> Choice

Source§

impl CtEq for u128

Source§

fn ct_eq(&self, other: &Self) -> Choice

Source§

impl CtEq for usize

Source§

fn ct_eq(&self, other: &Self) -> Choice

Source§

impl CtEq for NonZeroI8

Source§

fn ct_eq(&self, other: &Self) -> Choice

Source§

impl CtEq for NonZeroI16

Source§

fn ct_eq(&self, other: &Self) -> Choice

Source§

impl CtEq for NonZeroI32

Source§

fn ct_eq(&self, other: &Self) -> Choice

Source§

impl CtEq for NonZeroI64

Source§

fn ct_eq(&self, other: &Self) -> Choice

Source§

impl CtEq for NonZeroI128

Source§

fn ct_eq(&self, other: &Self) -> Choice

Source§

impl CtEq for NonZeroU8

Source§

fn ct_eq(&self, other: &Self) -> Choice

Source§

impl CtEq for NonZeroU16

Source§

fn ct_eq(&self, other: &Self) -> Choice

Source§

impl CtEq for NonZeroU32

Source§

fn ct_eq(&self, other: &Self) -> Choice

Source§

impl CtEq for NonZeroU64

Source§

fn ct_eq(&self, other: &Self) -> Choice

Source§

impl CtEq for NonZeroU128

Source§

fn ct_eq(&self, other: &Self) -> Choice

Source§

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

Source§

fn ct_eq(&self, other: &[T; N]) -> Choice

Source§

impl<T: CtEqSlice> CtEq for [T]

Source§

fn ct_eq(&self, other: &Self) -> Choice

Source§

fn ct_ne(&self, other: &Self) -> Choice

Implementors§

Source§

impl CtEq for Choice

Source§

impl<T: CtEq> CtEq for CtOption<T>