pub struct HardenedBool(/* private fields */);Expand description
Hardened boolean type - values chosen for high Hamming distance and resistance to stuck-at-zero/one faults.
Implementations§
Source§impl HardenedBool
impl HardenedBool
pub const FALSE: Self
pub const TRUE: Self
Sourcepub fn check_true(self) -> bool
pub fn check_true(self) -> bool
Constant-time equality check against TRUE
Sourcepub fn complement(self) -> u32
pub fn complement(self) -> u32
Return the complement - for redundant checking
Trait Implementations§
Source§impl Clone for HardenedBool
impl Clone for HardenedBool
Source§fn clone(&self) -> HardenedBool
fn clone(&self) -> HardenedBool
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for HardenedBool
Auto Trait Implementations§
impl Freeze for HardenedBool
impl RefUnwindSafe for HardenedBool
impl Send for HardenedBool
impl Sync for HardenedBool
impl Unpin for HardenedBool
impl UnwindSafe for HardenedBool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more