Trait timing_shield::TpOrd [] [src]

pub trait TpOrd<Rhs: ?Sized = Self> where
    Rhs: , 
{ 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; }

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

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.

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.

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.

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.

Implementors