pub trait TpOrd<Rhs = Self>where
Rhs: ?Sized,{
// Required methods
fn tp_lt(&self, other: &Rhs) -> TpBool;
fn tp_lt_eq(&self, other: &Rhs) -> TpBool;
fn tp_gt(&self, other: &Rhs) -> TpBool;
fn tp_gt_eq(&self, other: &Rhs) -> TpBool;
}Expand description
A trait for performing comparisons on types with timing leak protection.
Important: implementations of this trait are only required to protect inputs that are already a
timing-protected type. For example, a.tp_lt(&b) is allowed to leak a if a is a u32,
instead of a timing-protected type like TpU32.
Ideally, this trait will be removed in the future if/when Rust allows overloading of the <,
>, <=, and >= operators.
Required Methods§
Sourcefn tp_lt(&self, other: &Rhs) -> TpBool
fn tp_lt(&self, other: &Rhs) -> TpBool
Compute self < other without leaking the result.
Important: if either input is not a timing-protected type, this operation might leak the
value of that type. To prevent timing leaks, protect values before performing any operations
on them.
Sourcefn tp_lt_eq(&self, other: &Rhs) -> TpBool
fn tp_lt_eq(&self, other: &Rhs) -> TpBool
Compute self <= other without leaking the result.
Important: if either input is not a timing-protected type, this operation might leak the
value of that type. To prevent timing leaks, protect values before performing any operations
on them.