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 i8

Source§

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

Source§

impl CtEq for i16

Source§

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

Source§

impl CtEq for i32

Source§

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

Source§

impl CtEq for i64

Source§

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

Source§

impl CtEq for i128

Source§

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

Source§

impl CtEq for isize

Source§

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

Source§

impl CtEq for u8

Source§

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

Source§

impl CtEq for u16

Source§

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

Source§

impl CtEq for u32

Source§

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

Source§

impl CtEq for u64

Source§

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

Source§

impl CtEq for u128

Source§

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

Source§

impl CtEq for usize

Source§

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

Source§

impl CtEq for NonZero<i8>

Source§

fn ct_eq(&self, other: &NonZero<i8>) -> Choice

Source§

impl CtEq for NonZero<i16>

Source§

fn ct_eq(&self, other: &NonZero<i16>) -> Choice

Source§

impl CtEq for NonZero<i32>

Source§

fn ct_eq(&self, other: &NonZero<i32>) -> Choice

Source§

impl CtEq for NonZero<i64>

Source§

fn ct_eq(&self, other: &NonZero<i64>) -> Choice

Source§

impl CtEq for NonZero<i128>

Source§

fn ct_eq(&self, other: &NonZero<i128>) -> Choice

Source§

impl CtEq for NonZero<u8>

Source§

fn ct_eq(&self, other: &NonZero<u8>) -> Choice

Source§

impl CtEq for NonZero<u16>

Source§

fn ct_eq(&self, other: &NonZero<u16>) -> Choice

Source§

impl CtEq for NonZero<u32>

Source§

fn ct_eq(&self, other: &NonZero<u32>) -> Choice

Source§

impl CtEq for NonZero<u64>

Source§

fn ct_eq(&self, other: &NonZero<u64>) -> Choice

Source§

impl CtEq for NonZero<u128>

Source§

fn ct_eq(&self, other: &NonZero<u128>) -> Choice

Source§

impl<T> CtEq for [T]
where T: CtEqSlice,

Source§

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

Source§

fn ct_ne(&self, other: &[T]) -> Choice

Source§

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

Source§

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

Implementors§

Source§

impl CtEq for JacobiSymbol

Source§

impl CtEq for Ordering

Source§

impl CtEq for BoxedMontyForm

Source§

impl CtEq for BoxedMontyParams

Source§

impl CtEq for Choice

Source§

impl CtEq for Limb

Source§

impl<MOD, const LIMBS: usize> CtEq for ConstMontyForm<MOD, LIMBS>
where MOD: ConstMontyParams<LIMBS>,

Source§

impl<Rhs: AsRef<UintRef> + ?Sized> CtEq<Rhs> for BoxedUint

Source§

impl<Rhs: AsRef<UintRef> + ?Sized> CtEq<Rhs> for UintRef

Source§

impl<T> CtEq for Checked<T>
where T: CtEq,

Source§

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

Source§

impl<T> CtEq for crypto_bigint::NonZero<T>
where T: CtEq + ?Sized,

Source§

impl<T> CtEq for Odd<T>
where T: CtEq + ?Sized,

Source§

impl<T> CtEq for Wrapping<T>
where T: CtEq,

Source§

impl<U: Unsigned> CtEq for MontyParams<U>

Source§

impl<const LIMBS: usize> CtEq for FixedMontyForm<LIMBS>

Source§

impl<const LIMBS: usize> CtEq for PrimeParams<LIMBS>

Source§

impl<const LIMBS: usize> CtEq for Int<LIMBS>

Source§

impl<const LIMBS: usize, Rhs: AsRef<UintRef> + ?Sized> CtEq<Rhs> for Uint<LIMBS>