Skip to main content

CtLesser

Trait CtLesser 

Source
pub trait CtLesser: Sized {
    // Required method
    fn ct_lt(a: Self, b: Self) -> Choice;

    // Provided method
    fn ct_ge(a: Self, b: Self) -> Choice { ... }
}
Expand description

Check in constant time if the left object is lesser than right object

This equivalent to the < operator found in the core library.

Required Methods§

Source

fn ct_lt(a: Self, b: Self) -> Choice

Check that the first element is lesser to the second element in constant time and return the associated Choice

Provided Methods§

Source

fn ct_ge(a: Self, b: Self) -> Choice

Check that the first element is greater or equal to the second element in constant time and return the associated Choice

This is equivalent of calling ct_lt with the argument swapped

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 CtLesser for u64

Source§

fn ct_lt(a: Self, b: Self) -> Choice

Source§

impl<const N: usize> CtLesser for &[u8; N]

Source§

fn ct_lt(a: Self, b: Self) -> Choice

Implementors§