pub(crate) struct ExtendedInt<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> ExtendedInt<LIMBS, EXTRA>
impl<const LIMBS: usize, const EXTRA: usize> ExtendedInt<LIMBS, EXTRA>
pub(super) const ZERO: Self
pub(super) const ONE: Self
Sourcepub const fn from_product(lhs: Uint<LIMBS>, rhs: Uint<EXTRA>) -> Self
pub const fn from_product(lhs: Uint<LIMBS>, rhs: Uint<EXTRA>) -> Self
Construct an ExtendedInt from the product of a Uint<LIMBS> and a Uint<EXTRA>.
Assumes the top bit of the product is not set.
Sourcepub(crate) const fn wrapping_mul<const RHS_LIMBS: usize>(
&self,
rhs: (&Uint<RHS_LIMBS>, &Choice),
) -> Self
pub(crate) const fn wrapping_mul<const RHS_LIMBS: usize>( &self, rhs: (&Uint<RHS_LIMBS>, &Choice), ) -> Self
Wrapping multiply self with rhs, which is passed as a
Sourcepub const fn as_extended_uint(&self) -> ExtendedUint<LIMBS, EXTRA>
pub const fn as_extended_uint(&self) -> ExtendedUint<LIMBS, EXTRA>
Interpret this as an ExtendedUint.
Sourcepub const fn wrapping_neg_if(&self, negate: Choice) -> Self
pub const fn wrapping_neg_if(&self, negate: Choice) -> Self
Return the negation of self if negate is truthy. Otherwise, return self.
pub(crate) const fn wrapping_add(&self, rhs: &Self) -> Self
Sourcepub const fn wrapping_sub(&self, rhs: &Self) -> Self
pub const fn wrapping_sub(&self, rhs: &Self) -> Self
Compute self - rhs, wrapping any underflow.
Sourcepub const fn dropped_abs_sign(&self) -> (Uint<LIMBS>, Choice)
pub const fn dropped_abs_sign(&self) -> (Uint<LIMBS>, Choice)
Returns the absolute value and sign of self, without the extension.
Sourcepub const fn abs_sign(&self) -> (ExtendedUint<LIMBS, EXTRA>, Choice)
pub const fn abs_sign(&self) -> (ExtendedUint<LIMBS, EXTRA>, Choice)
Decompose self into is absolute value and signum.
Sourcepub const fn bounded_div_2k<const UPPER_BOUND: u32>(&self, k: u32) -> Self
pub const fn bounded_div_2k<const UPPER_BOUND: u32>(&self, k: u32) -> Self
Sourcepub const fn div_2k_vartime(&self, k: u32) -> Self
pub const fn div_2k_vartime(&self, k: u32) -> Self
Divide self by 2^k, rounding towards zero.
Trait Implementations§
Source§impl<const LIMBS: usize, const EXTENSION_LIMBS: usize> Clone for ExtendedInt<LIMBS, EXTENSION_LIMBS>
impl<const LIMBS: usize, const EXTENSION_LIMBS: usize> Clone for ExtendedInt<LIMBS, EXTENSION_LIMBS>
Source§fn clone(&self) -> ExtendedInt<LIMBS, EXTENSION_LIMBS>
fn clone(&self) -> ExtendedInt<LIMBS, EXTENSION_LIMBS>
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 moreSource§impl<const LIMBS: usize, const EXTENSION_LIMBS: usize> Debug for ExtendedInt<LIMBS, EXTENSION_LIMBS>
impl<const LIMBS: usize, const EXTENSION_LIMBS: usize> Debug for ExtendedInt<LIMBS, EXTENSION_LIMBS>
Source§impl<const LIMBS: usize, const EXTENSION_LIMBS: usize> PartialEq for ExtendedInt<LIMBS, EXTENSION_LIMBS>
impl<const LIMBS: usize, const EXTENSION_LIMBS: usize> PartialEq for ExtendedInt<LIMBS, EXTENSION_LIMBS>
Source§fn eq(&self, other: &ExtendedInt<LIMBS, EXTENSION_LIMBS>) -> bool
fn eq(&self, other: &ExtendedInt<LIMBS, EXTENSION_LIMBS>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<const LIMBS: usize, const EXTENSION_LIMBS: usize> Copy for ExtendedInt<LIMBS, EXTENSION_LIMBS>
impl<const LIMBS: usize, const EXTENSION_LIMBS: usize> StructuralPartialEq for ExtendedInt<LIMBS, EXTENSION_LIMBS>
Auto Trait Implementations§
impl<const LIMBS: usize, const EXTENSION_LIMBS: usize> Freeze for ExtendedInt<LIMBS, EXTENSION_LIMBS>
impl<const LIMBS: usize, const EXTENSION_LIMBS: usize> RefUnwindSafe for ExtendedInt<LIMBS, EXTENSION_LIMBS>
impl<const LIMBS: usize, const EXTENSION_LIMBS: usize> Send for ExtendedInt<LIMBS, EXTENSION_LIMBS>
impl<const LIMBS: usize, const EXTENSION_LIMBS: usize> Sync for ExtendedInt<LIMBS, EXTENSION_LIMBS>
impl<const LIMBS: usize, const EXTENSION_LIMBS: usize> Unpin for ExtendedInt<LIMBS, EXTENSION_LIMBS>
impl<const LIMBS: usize, const EXTENSION_LIMBS: usize> UnsafeUnpin for ExtendedInt<LIMBS, EXTENSION_LIMBS>
impl<const LIMBS: usize, const EXTENSION_LIMBS: usize> UnwindSafe for ExtendedInt<LIMBS, EXTENSION_LIMBS>
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