Skip to main content

ExtendedUint

Struct ExtendedUint 

Source
pub(crate) struct ExtendedUint<const LIMBS: usize, const EXTENSION_LIMBS: usize>(Uint<LIMBS>, Uint<EXTENSION_LIMBS>);

Tuple Fields§

§0: Uint<LIMBS>§1: Uint<EXTENSION_LIMBS>

Implementations§

Source§

impl<const LIMBS: usize, const EXTRA: usize> ExtendedUint<LIMBS, EXTRA>

Source

pub const fn from_product(lhs: Uint<LIMBS>, rhs: Uint<EXTRA>) -> Self

Construct an ExtendedUint from the product of a Uint<LIMBS> and an Uint<EXTRA>.

Assumes the top bit of the product is not set.

Source

pub const fn wrapping_mul<const RHS_LIMBS: usize>( &self, rhs: &Uint<RHS_LIMBS>, ) -> Self

Wrapping multiply self with rhs

Source

pub const fn as_extended_int(&self) -> ExtendedInt<LIMBS, EXTRA>

Interpret self as an ExtendedInt

Source

pub const fn is_zero(&self) -> Choice

Whether this form is Self::ZERO.

Source

pub const fn checked_drop_extension(&self) -> CtOption<Uint<LIMBS>>

Drop the extension.

Source

pub const fn wrapping_neg(&self) -> Self

Construction the binary negation of self, i.e., map self to !self + 1.

Note: maps 0 to itself.

Source

pub const fn wrapping_neg_if(&self, negate: Choice) -> Self

Negate self if negate is truthy. Otherwise returns self.

Source

pub const fn bounded_shr<const UPPER_BOUND: u32>(&self, shift: u32) -> Self

Shift self right by shift bits.

§Panics
  • if shift ≥ UPPER_BOUND.
Source

pub const fn shr_vartime(&self, shift: u32) -> Self

Shift self right by shift bits.

§Panics
  • if shift ≥ Uint::<EXTRA>::BITS.

Auto Trait Implementations§

§

impl<const LIMBS: usize, const EXTENSION_LIMBS: usize> Freeze for ExtendedUint<LIMBS, EXTENSION_LIMBS>

§

impl<const LIMBS: usize, const EXTENSION_LIMBS: usize> RefUnwindSafe for ExtendedUint<LIMBS, EXTENSION_LIMBS>

§

impl<const LIMBS: usize, const EXTENSION_LIMBS: usize> Send for ExtendedUint<LIMBS, EXTENSION_LIMBS>

§

impl<const LIMBS: usize, const EXTENSION_LIMBS: usize> Sync for ExtendedUint<LIMBS, EXTENSION_LIMBS>

§

impl<const LIMBS: usize, const EXTENSION_LIMBS: usize> Unpin for ExtendedUint<LIMBS, EXTENSION_LIMBS>

§

impl<const LIMBS: usize, const EXTENSION_LIMBS: usize> UnsafeUnpin for ExtendedUint<LIMBS, EXTENSION_LIMBS>

§

impl<const LIMBS: usize, const EXTENSION_LIMBS: usize> UnwindSafe for ExtendedUint<LIMBS, EXTENSION_LIMBS>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.