Skip to main content

UnsignedModularInt

Trait UnsignedModularInt 

Source
pub trait UnsignedModularInt:
    Zeroize
    + Clone
    + PartialOrd
    + IntegerResize<Output = Self>
    + TryFromBeBytes {
    type Bytes: NumBytes + AsMut<[u8]>;

    // Required methods
    fn leading_zeros(&self) -> u32;
    fn to_be_bytes(&self) -> Self::Bytes;
    fn rem_vartime(&self, modulus: &NonZero<Self>) -> Self;
    fn as_nz_ref(&self) -> NonZero<Self>;
    fn bits(&self) -> u32;
    fn bits_precision(&self) -> u32;
    fn to_be_bytes_trimmed_vartime(&self) -> Box<[u8]>;
}

Required Associated Types§

Source

type Bytes: NumBytes + AsMut<[u8]>

Required Methods§

Source

fn leading_zeros(&self) -> u32

Source

fn to_be_bytes(&self) -> Self::Bytes

Source

fn rem_vartime(&self, modulus: &NonZero<Self>) -> Self

Source

fn as_nz_ref(&self) -> NonZero<Self>

Source

fn bits(&self) -> u32

Source

fn bits_precision(&self) -> u32

Source

fn to_be_bytes_trimmed_vartime(&self) -> Box<[u8]>

Available on crate feature alloc only.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl UnsignedModularInt for BoxedUint

Available on crate feature alloc only.
Source§

type Bytes = Box<[u8]>

Source§

impl<T> UnsignedModularInt for ModMathValue<T>
where T: ModMathInt,

Available on crate features modmath and alloc only.