ConstantTime

Trait ConstantTime 

Source
pub trait ConstantTime {
    // Required methods
    fn ct_eq(&self, other: &[u8]) -> bool;
    fn ct_select(condition: bool, a: Self, b: Self) -> Self
       where Self: Sized;
}
Expand description

Trait for constant-time operations

Required Methods§

Source

fn ct_eq(&self, other: &[u8]) -> bool

Compare two byte slices in constant time

Source

fn ct_select(condition: bool, a: Self, b: Self) -> Self
where Self: Sized,

Select between two values in constant time

Implementors§