Skip to main content

CtCheckedSub

Trait CtCheckedSub 

Source
pub trait CtCheckedSub: Sized {
    // Required method
    fn ct_checked_sub(&self, v: &Self) -> CtOption<Self>;
}
Available on crate feature ct only.
Expand description

Constant-time checked subtraction (the masked counterpart of CheckedSub).

Required Methods§

Source

fn ct_checked_sub(&self, v: &Self) -> CtOption<Self>

Computes self - v, returning a CtOption that is None-masked on overflow.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl CtCheckedSub for i8

Source§

fn ct_checked_sub(&self, v: &Self) -> CtOption<Self>

Source§

impl CtCheckedSub for i16

Source§

fn ct_checked_sub(&self, v: &Self) -> CtOption<Self>

Source§

impl CtCheckedSub for i32

Source§

fn ct_checked_sub(&self, v: &Self) -> CtOption<Self>

Source§

impl CtCheckedSub for i64

Source§

fn ct_checked_sub(&self, v: &Self) -> CtOption<Self>

Source§

impl CtCheckedSub for i128

Source§

fn ct_checked_sub(&self, v: &Self) -> CtOption<Self>

Source§

impl CtCheckedSub for isize

Source§

fn ct_checked_sub(&self, v: &Self) -> CtOption<Self>

Source§

impl CtCheckedSub for u8

Source§

fn ct_checked_sub(&self, v: &Self) -> CtOption<Self>

Source§

impl CtCheckedSub for u16

Source§

fn ct_checked_sub(&self, v: &Self) -> CtOption<Self>

Source§

impl CtCheckedSub for u32

Source§

fn ct_checked_sub(&self, v: &Self) -> CtOption<Self>

Source§

impl CtCheckedSub for u64

Source§

fn ct_checked_sub(&self, v: &Self) -> CtOption<Self>

Source§

impl CtCheckedSub for u128

Source§

fn ct_checked_sub(&self, v: &Self) -> CtOption<Self>

Source§

impl CtCheckedSub for usize

Source§

fn ct_checked_sub(&self, v: &Self) -> CtOption<Self>

Implementors§