Trait crypto_bigint::Zero

source ·
pub trait Zero: ConstantTimeEq + Sized {
    // Required method
    fn zero() -> Self;

    // Provided methods
    fn is_zero(&self) -> Choice { ... }
    fn set_zero(&mut self) { ... }
    fn zero_like(other: &Self) -> Self
       where Self: Clone { ... }
}
Expand description

Zero values.

Required Methods§

source

fn zero() -> Self

The value 0.

Provided Methods§

source

fn is_zero(&self) -> Choice

Determine if this value is equal to zero.

Returns

If zero, returns Choice(1). Otherwise, returns Choice(0).

source

fn set_zero(&mut self)

Set self to its additive identity, i.e. Self::zero.

source

fn zero_like(other: &Self) -> Self
where Self: Clone,

Return the value 0 with the same precision as other.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Zero for BoxedUint

Available on crate feature alloc only.
source§

impl<T: ConstZero> Zero for T

source§

impl<T: Zero> Zero for Wrapping<T>