Struct crypto_bigint::UInt

source ·
pub struct UInt<const LIMBS: usize> { /* private fields */ }
Expand description

Big unsigned integer.

Generic over the given number of LIMBS

Encoding support

This type supports many different types of encodings, either via the Encoding trait or various const fn decoding and encoding functions that can be used with UInt constants.

Optional crate features for encoding (off-by-default):

Implementations§

source§

impl<const LIMBS: usize> UInt<LIMBS>

source

pub const fn adc(&self, rhs: &Self, carry: Limb) -> (Self, Limb)

Computes a + b + carry, returning the result along with the new carry.

source

pub const fn saturating_add(&self, rhs: &Self) -> Self

Perform saturating addition, returning MAX on overflow.

source

pub const fn wrapping_add(&self, rhs: &Self) -> Self

Perform wrapping addition, discarding overflow.

source§

impl<const LIMBS: usize> UInt<LIMBS>

source

pub const fn add_mod(&self, rhs: &UInt<LIMBS>, p: &UInt<LIMBS>) -> UInt<LIMBS>

Computes self + rhs mod p in constant time.

Assumes self + rhs as unbounded integer is < 2p.

source

pub const fn add_mod_special(&self, rhs: &Self, c: Limb) -> Self

Computes self + rhs mod p in constant time for the special modulus p = MAX+1-c where c is small enough to fit in a single Limb.

Assumes self + rhs as unbounded integer is < 2p.

source§

impl<const LIMBS: usize> UInt<LIMBS>

source

pub const fn bitand(&self, rhs: &Self) -> Self

Computes bitwise a & b.

source

pub const fn wrapping_and(&self, rhs: &Self) -> Self

Perform wrapping bitwise AND.

There’s no way wrapping could ever happen. This function exists so that all operations are accounted for in the wrapping operations

source

pub fn checked_and(&self, rhs: &Self) -> CtOption<Self>

Perform checked bitwise AND, returning a CtOption which is_some always

source§

impl<const LIMBS: usize> UInt<LIMBS>

source

pub const fn not(&self) -> Self

Computes bitwise !a.

source§

impl<const LIMBS: usize> UInt<LIMBS>

source

pub const fn bitor(&self, rhs: &Self) -> Self

Computes bitwise a & b.

source

pub const fn wrapping_or(&self, rhs: &Self) -> Self

Perform wrapping bitwise OR.

There’s no way wrapping could ever happen. This function exists so that all operations are accounted for in the wrapping operations

source

pub fn checked_or(&self, rhs: &Self) -> CtOption<Self>

Perform checked bitwise OR, returning a CtOption which is_some always

source§

impl<const LIMBS: usize> UInt<LIMBS>

source

pub const fn bitxor(&self, rhs: &Self) -> Self

Computes bitwise a ^ b.

source

pub const fn wrapping_xor(&self, rhs: &Self) -> Self

Perform wrapping bitwise `XOR``.

There’s no way wrapping could ever happen. This function exists so that all operations are accounted for in the wrapping operations

source

pub fn checked_xor(&self, rhs: &Self) -> CtOption<Self>

Perform checked bitwise XOR, returning a CtOption which is_some always

source§

impl<const LIMBS: usize> UInt<LIMBS>

source

pub const fn bit_vartime(self, index: usize) -> Word

Get the value of the bit at position index, as a 0- or 1-valued Word. Returns 0 for indices out of range.

source

pub const fn bits(self) -> usize

👎Deprecated: please use bits_vartime instead

Calculate the number of bits needed to represent this number.

source

pub const fn bits_vartime(self) -> usize

Calculate the number of bits needed to represent this number.

source§

impl<const LIMBS: usize> UInt<LIMBS>

source

pub const fn reduce2k(&self, k: usize) -> Self

Computes self % 2^k. Faster than reduce since its a power of 2. Limited to 2^16-1 since UInt doesn’t support higher.

source

pub fn div_rem(&self, rhs: &Self) -> CtOption<(Self, Self)>

Computes self / rhs, returns the quotient, remainder if rhs != 0

source

pub fn reduce(&self, rhs: &Self) -> CtOption<Self>

Computes self % rhs, returns the remainder if rhs != 0

source

pub const fn wrapping_div(&self, rhs: &Self) -> Self

Wrapped division is just normal division i.e. self / rhs There’s no way wrapping could ever happen. This function exists, so that all operations are accounted for in the wrapping operations.

source

pub fn checked_div(&self, rhs: &Self) -> CtOption<Self>

Perform checked division, returning a CtOption which is_some only if the rhs != 0

source

pub const fn wrapping_rem(&self, rhs: &Self) -> Self

Wrapped (modular) remainder calculation is just self % rhs. There’s no way wrapping could ever happen. This function exists, so that all operations are accounted for in the wrapping operations.

source

pub fn checked_rem(&self, rhs: &Self) -> CtOption<Self>

Perform checked reduction, returning a CtOption which is_some only if the rhs != 0

source§

impl<const LIMBS: usize> UInt<LIMBS>

source

pub const fn from_be_slice(bytes: &[u8]) -> Self

Create a new UInt from the provided big endian bytes.

source

pub const fn from_be_hex(hex: &str) -> Self

Create a new UInt from the provided big endian hex string.

source

pub const fn from_le_slice(bytes: &[u8]) -> Self

Create a new UInt from the provided little endian bytes.

source

pub const fn from_le_hex(hex: &str) -> Self

Create a new UInt from the provided little endian hex string.

source§

impl<const LIMBS: usize> UInt<LIMBS>

source

pub const fn from_u8(n: u8) -> Self

Create a UInt from a u8 (const-friendly)

source

pub const fn from_u16(n: u16) -> Self

Create a UInt from a u16 (const-friendly)

source

pub const fn from_u32(n: u32) -> Self

Create a UInt from a u32 (const-friendly)

source

pub const fn from_u64(n: u64) -> Self

Create a UInt from a u64 (const-friendly)

source

pub const fn from_u128(n: u128) -> Self

Create a UInt from a u128 (const-friendly)

source

pub const fn from_word(n: Word) -> Self

Create a UInt from a Word (const-friendly)

source

pub const fn from_wide_word(n: WideWord) -> Self

Create a UInt from a WideWord (const-friendly)

source§

impl<const LIMBS: usize> UInt<LIMBS>

source

pub const fn inv_mod2k(&self, k: usize) -> Self

Computes 1/self mod 2^k as specified in Algorithm 4 from A Secure Algorithm for Inversion Modulo 2k by Sadiel de la Fe and Carles Ferrer. See https://www.mdpi.com/2410-387X/2/3/23.

Conditions: self < 2^k and self must be odd

source§

impl<const LIMBS: usize> UInt<LIMBS>

source

pub const fn mul_wide(&self, rhs: &Self) -> (Self, Self)

Compute “wide” multiplication, with a product twice the size of the input.

Returns a tuple containing the (lo, hi) components of the product.

Ordering note

Releases of crypto-bigint prior to v0.3 used (hi, lo) ordering instead. This has been changed for better consistency with the rest of the APIs in this crate.

For more info see: https://github.com/RustCrypto/crypto-bigint/issues/4

source

pub const fn saturating_mul(&self, rhs: &Self) -> Self

Perform saturating multiplication, returning MAX on overflow.

source

pub const fn wrapping_mul(&self, rhs: &Self) -> Self

Perform wrapping multiplication, discarding overflow.

source

pub fn square(&self) -> <Self as Concat>::Outputwhere Self: Concat,

Square self, returning a “wide” result.

source§

impl<const LIMBS: usize> UInt<LIMBS>

source

pub const fn mul_mod_special(&self, rhs: &Self, c: Limb) -> Self

Computes self * rhs mod p in constant time for the special modulus p = MAX+1-c where c is small enough to fit in a single Limb. For the modulus reduction, this function implements Algorithm 14.47 from the “Handbook of Applied Cryptography”, by A. Menezes, P. van Oorschot, and S. Vanstone, CRC Press, 1996.

source§

impl<const LIMBS: usize> UInt<LIMBS>

source

pub const fn neg_mod(&self, p: &Self) -> Self

Computes -a mod p in constant time. Assumes self is in [0, p).

source

pub const fn neg_mod_special(&self, c: Limb) -> Self

Computes -a mod p in constant time for the special modulus p = MAX+1-c where c is small enough to fit in a single Limb.

source§

impl<const LIMBS: usize> UInt<LIMBS>

source

pub const fn resize<const T: usize>(&self) -> UInt<T>

Construct a UInt<T> from the unsigned integer value, truncating the upper bits if the value is too large to be represented.

source§

impl<const LIMBS: usize> UInt<LIMBS>

source

pub const fn shl_vartime(&self, n: usize) -> Self

Computes self << shift.

NOTE: this operation is variable time with respect to n ONLY.

When used with a fixed n, this function is constant-time with respect to self.

source§

impl<const LIMBS: usize> UInt<LIMBS>

source

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

Computes self >> n.

NOTE: this operation is variable time with respect to n ONLY.

When used with a fixed n, this function is constant-time with respect to self.

source§

impl<const LIMBS: usize> UInt<LIMBS>

source

pub const fn sqrt(&self) -> Self

Computes √(self) Uses Brent & Zimmermann, Modern Computer Arithmetic, v0.5.9, Algorithm 1.13

Callers can check if self is a square by squaring the result

source

pub const fn wrapping_sqrt(&self) -> Self

Wrapped sqrt is just normal √(self) There’s no way wrapping could ever happen. This function exists, so that all operations are accounted for in the wrapping operations.

source

pub fn checked_sqrt(&self) -> CtOption<Self>

Perform checked sqrt, returning a CtOption which is_some only if the √(self)² == self

source§

impl<const LIMBS: usize> UInt<LIMBS>

source

pub const fn sbb(&self, rhs: &Self, borrow: Limb) -> (Self, Limb)

Computes a - (b + borrow), returning the result along with the new borrow.

source

pub const fn saturating_sub(&self, rhs: &Self) -> Self

Perform saturating subtraction, returning ZERO on underflow.

source

pub const fn wrapping_sub(&self, rhs: &Self) -> Self

Perform wrapping subtraction, discarding underflow and wrapping around the boundary of the type.

source§

impl<const LIMBS: usize> UInt<LIMBS>

source

pub const fn sub_mod(&self, rhs: &UInt<LIMBS>, p: &UInt<LIMBS>) -> UInt<LIMBS>

Computes self - rhs mod p in constant time.

Assumes self - rhs as unbounded signed integer is in [-p, p).

source

pub const fn sub_mod_special(&self, rhs: &Self, c: Limb) -> Self

Computes self - rhs mod p in constant time for the special modulus p = MAX+1-c where c is small enough to fit in a single Limb.

Assumes self - rhs as unbounded signed integer is in [-p, p).

source§

impl<const LIMBS: usize> UInt<LIMBS>

source

pub const ZERO: Self = _

The value 0.

source

pub const ONE: Self = _

The value 1.

source

pub const LIMBS: usize = LIMBS

The number of limbs used on this platform.

source

pub const MAX: Self = _

Maximum value this UInt can express.

source

pub const fn new(limbs: [Limb; LIMBS]) -> Self

Const-friendly UInt constructor.

source

pub const fn from_words(arr: [Word; LIMBS]) -> Self

Create a UInt from an array of Words (i.e. word-sized unsigned integers).

source

pub const fn to_words(self) -> [Word; LIMBS]

Create an array of Words (i.e. word-sized unsigned integers) from a UInt.

source

pub const fn as_words(&self) -> &[Word; LIMBS]

Borrow the inner limbs as an array of Words.

source

pub fn as_words_mut(&mut self) -> &mut [Word; LIMBS]

Borrow the inner limbs as a mutable array of Words.

source

pub const fn as_uint_array(&self) -> &[Word; LIMBS]

👎Deprecated since 0.4.8: please use as_words instead

Deprecated: borrow the inner limbs as an array of Words.

source

pub const fn from_uint_array(words: [Word; LIMBS]) -> Self

👎Deprecated since 0.4.8: please use from_words instead

Deprecated: create a UInt from an array of Words.

source

pub const fn to_uint_array(self) -> [Word; LIMBS]

👎Deprecated since 0.4.8: please use to_words instead

Deprecated: create an array of Words from a UInt.

source

pub const fn limbs(&self) -> &[Limb; LIMBS]

Borrow the limbs of this UInt.

source

pub fn limbs_mut(&mut self) -> &mut [Limb; LIMBS]

Borrow the limbs of this UInt mutably.

source

pub const fn into_limbs(self) -> [Limb; LIMBS]

Convert this UInt into its inner limbs.

source§

impl UInt<{nlimbs!($bits)}>

source

pub const fn concat(&self, rhs: &Self) -> UInt<{ _ }>

Concatenate the two values, with self as most significant and rhs as the least significant.

source§

impl UInt<{nlimbs!($bits)}>

source

pub const fn concat(&self, rhs: &Self) -> UInt<{ _ }>

Concatenate the two values, with self as most significant and rhs as the least significant.

source§

impl UInt<{nlimbs!($bits)}>

source

pub const fn concat(&self, rhs: &Self) -> UInt<{ _ }>

Concatenate the two values, with self as most significant and rhs as the least significant.

source§

impl UInt<{nlimbs!($bits)}>

source

pub const fn concat(&self, rhs: &Self) -> UInt<{ _ }>

Concatenate the two values, with self as most significant and rhs as the least significant.

source§

impl UInt<{nlimbs!($bits)}>

source

pub const fn concat(&self, rhs: &Self) -> UInt<{ _ }>

Concatenate the two values, with self as most significant and rhs as the least significant.

source§

impl UInt<{nlimbs!($bits)}>

source

pub const fn concat(&self, rhs: &Self) -> UInt<{ _ }>

Concatenate the two values, with self as most significant and rhs as the least significant.

source§

impl UInt<{nlimbs!($bits)}>

source

pub const fn concat(&self, rhs: &Self) -> UInt<{ _ }>

Concatenate the two values, with self as most significant and rhs as the least significant.

source§

impl UInt<{nlimbs!($bits)}>

source

pub const fn concat(&self, rhs: &Self) -> UInt<{ _ }>

Concatenate the two values, with self as most significant and rhs as the least significant.

source§

impl UInt<{nlimbs!($bits)}>

source

pub const fn concat(&self, rhs: &Self) -> UInt<{ _ }>

Concatenate the two values, with self as most significant and rhs as the least significant.

source§

impl UInt<{nlimbs!($bits)}>

source

pub const fn concat(&self, rhs: &Self) -> UInt<{ _ }>

Concatenate the two values, with self as most significant and rhs as the least significant.

source§

impl UInt<{nlimbs!($bits)}>

source

pub const fn concat(&self, rhs: &Self) -> UInt<{ _ }>

Concatenate the two values, with self as most significant and rhs as the least significant.

source§

impl UInt<{nlimbs!($bits)}>

source

pub const fn concat(&self, rhs: &Self) -> UInt<{ _ }>

Concatenate the two values, with self as most significant and rhs as the least significant.

source§

impl UInt<{nlimbs!($bits)}>

source

pub const fn concat(&self, rhs: &Self) -> UInt<{ _ }>

Concatenate the two values, with self as most significant and rhs as the least significant.

source§

impl UInt<{nlimbs!($bits)}>

source

pub const fn concat(&self, rhs: &Self) -> UInt<{ _ }>

Concatenate the two values, with self as most significant and rhs as the least significant.

source§

impl UInt<{nlimbs!($bits)}>

source

pub const fn concat(&self, rhs: &Self) -> UInt<{ _ }>

Concatenate the two values, with self as most significant and rhs as the least significant.

source§

impl UInt<{nlimbs!($bits)}>

source

pub const fn split(&self) -> (UInt<{ _ }>, UInt<{ _ }>)

Split this number in half, returning its high and low components respectively.

source§

impl UInt<{nlimbs!($bits)}>

source

pub const fn split(&self) -> (UInt<{ _ }>, UInt<{ _ }>)

Split this number in half, returning its high and low components respectively.

source§

impl UInt<{nlimbs!($bits)}>

source

pub const fn split(&self) -> (UInt<{ _ }>, UInt<{ _ }>)

Split this number in half, returning its high and low components respectively.

source§

impl UInt<{nlimbs!($bits)}>

source

pub const fn split(&self) -> (UInt<{ _ }>, UInt<{ _ }>)

Split this number in half, returning its high and low components respectively.

source§

impl UInt<{nlimbs!($bits)}>

source

pub const fn split(&self) -> (UInt<{ _ }>, UInt<{ _ }>)

Split this number in half, returning its high and low components respectively.

source§

impl UInt<{nlimbs!($bits)}>

source

pub const fn split(&self) -> (UInt<{ _ }>, UInt<{ _ }>)

Split this number in half, returning its high and low components respectively.

source§

impl UInt<{nlimbs!($bits)}>

source

pub const fn split(&self) -> (UInt<{ _ }>, UInt<{ _ }>)

Split this number in half, returning its high and low components respectively.

source§

impl UInt<{nlimbs!($bits)}>

source

pub const fn split(&self) -> (UInt<{ _ }>, UInt<{ _ }>)

Split this number in half, returning its high and low components respectively.

source§

impl UInt<{nlimbs!($bits)}>

source

pub const fn split(&self) -> (UInt<{ _ }>, UInt<{ _ }>)

Split this number in half, returning its high and low components respectively.

source§

impl UInt<{nlimbs!($bits)}>

source

pub const fn split(&self) -> (UInt<{ _ }>, UInt<{ _ }>)

Split this number in half, returning its high and low components respectively.

source§

impl UInt<{nlimbs!($bits)}>

source

pub const fn split(&self) -> (UInt<{ _ }>, UInt<{ _ }>)

Split this number in half, returning its high and low components respectively.

source§

impl UInt<{nlimbs!($bits)}>

source

pub const fn split(&self) -> (UInt<{ _ }>, UInt<{ _ }>)

Split this number in half, returning its high and low components respectively.

source§

impl UInt<{nlimbs!($bits)}>

source

pub const fn split(&self) -> (UInt<{ _ }>, UInt<{ _ }>)

Split this number in half, returning its high and low components respectively.

source§

impl UInt<{nlimbs!($bits)}>

source

pub const fn split(&self) -> (UInt<{ _ }>, UInt<{ _ }>)

Split this number in half, returning its high and low components respectively.

source§

impl UInt<{nlimbs!($bits)}>

source

pub const fn split(&self) -> (UInt<{ _ }>, UInt<{ _ }>)

Split this number in half, returning its high and low components respectively.

source§

impl UInt<{nlimbs!($bits)}>

source

pub const fn split(&self) -> (UInt<{ _ }>, UInt<{ _ }>)

Split this number in half, returning its high and low components respectively.

source§

impl UInt<{nlimbs!($bits)}>

source

pub const fn split(&self) -> (UInt<{ _ }>, UInt<{ _ }>)

Split this number in half, returning its high and low components respectively.

Trait Implementations§

source§

impl<const LIMBS: usize> AddMod<UInt<LIMBS>> for UInt<LIMBS>

§

type Output = UInt<LIMBS>

Output type.
source§

fn add_mod(&self, rhs: &Self, p: &Self) -> Self

Compute self + rhs mod p. Read more
source§

impl<const LIMBS: usize> AsMut<[Limb]> for UInt<LIMBS>

source§

fn as_mut(&mut self) -> &mut [Limb]

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<const LIMBS: usize> AsMut<[u64; LIMBS]> for UInt<LIMBS>

source§

fn as_mut(&mut self) -> &mut [Word; LIMBS]

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<const LIMBS: usize> AsRef<[Limb]> for UInt<LIMBS>

source§

fn as_ref(&self) -> &[Limb]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<const LIMBS: usize> AsRef<[u64; LIMBS]> for UInt<LIMBS>

source§

fn as_ref(&self) -> &[Word; LIMBS]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<const LIMBS: usize> BitAnd<&UInt<LIMBS>> for &UInt<LIMBS>

§

type Output = UInt<LIMBS>

The resulting type after applying the & operator.
source§

fn bitand(self, rhs: &UInt<LIMBS>) -> UInt<LIMBS>

Performs the & operation. Read more
source§

impl<const LIMBS: usize> BitAnd<&UInt<LIMBS>> for UInt<LIMBS>

§

type Output = UInt<LIMBS>

The resulting type after applying the & operator.
source§

fn bitand(self, rhs: &UInt<LIMBS>) -> UInt<LIMBS>

Performs the & operation. Read more
source§

impl<const LIMBS: usize> BitAnd<UInt<LIMBS>> for &UInt<LIMBS>

§

type Output = UInt<LIMBS>

The resulting type after applying the & operator.
source§

fn bitand(self, rhs: UInt<LIMBS>) -> UInt<LIMBS>

Performs the & operation. Read more
source§

impl<const LIMBS: usize> BitAnd<UInt<LIMBS>> for UInt<LIMBS>

§

type Output = UInt<LIMBS>

The resulting type after applying the & operator.
source§

fn bitand(self, rhs: Self) -> UInt<LIMBS>

Performs the & operation. Read more
source§

impl<const LIMBS: usize> BitAndAssign<&UInt<LIMBS>> for UInt<LIMBS>

source§

fn bitand_assign(&mut self, other: &Self)

Performs the &= operation. Read more
source§

impl<const LIMBS: usize> BitAndAssign<UInt<LIMBS>> for UInt<LIMBS>

source§

fn bitand_assign(&mut self, other: Self)

Performs the &= operation. Read more
source§

impl<const LIMBS: usize> BitOr<&UInt<LIMBS>> for &UInt<LIMBS>

§

type Output = UInt<LIMBS>

The resulting type after applying the | operator.
source§

fn bitor(self, rhs: &UInt<LIMBS>) -> UInt<LIMBS>

Performs the | operation. Read more
source§

impl<const LIMBS: usize> BitOr<&UInt<LIMBS>> for UInt<LIMBS>

§

type Output = UInt<LIMBS>

The resulting type after applying the | operator.
source§

fn bitor(self, rhs: &UInt<LIMBS>) -> UInt<LIMBS>

Performs the | operation. Read more
source§

impl<const LIMBS: usize> BitOr<UInt<LIMBS>> for &UInt<LIMBS>

§

type Output = UInt<LIMBS>

The resulting type after applying the | operator.
source§

fn bitor(self, rhs: UInt<LIMBS>) -> UInt<LIMBS>

Performs the | operation. Read more
source§

impl<const LIMBS: usize> BitOr<UInt<LIMBS>> for UInt<LIMBS>

§

type Output = UInt<LIMBS>

The resulting type after applying the | operator.
source§

fn bitor(self, rhs: Self) -> UInt<LIMBS>

Performs the | operation. Read more
source§

impl<const LIMBS: usize> BitOrAssign<&UInt<LIMBS>> for UInt<LIMBS>

source§

fn bitor_assign(&mut self, other: &Self)

Performs the |= operation. Read more
source§

impl<const LIMBS: usize> BitOrAssign<UInt<LIMBS>> for UInt<LIMBS>

source§

fn bitor_assign(&mut self, other: Self)

Performs the |= operation. Read more
source§

impl<const LIMBS: usize> BitXor<&UInt<LIMBS>> for &UInt<LIMBS>

§

type Output = UInt<LIMBS>

The resulting type after applying the ^ operator.
source§

fn bitxor(self, rhs: &UInt<LIMBS>) -> UInt<LIMBS>

Performs the ^ operation. Read more
source§

impl<const LIMBS: usize> BitXor<&UInt<LIMBS>> for UInt<LIMBS>

§

type Output = UInt<LIMBS>

The resulting type after applying the ^ operator.
source§

fn bitxor(self, rhs: &UInt<LIMBS>) -> UInt<LIMBS>

Performs the ^ operation. Read more
source§

impl<const LIMBS: usize> BitXor<UInt<LIMBS>> for &UInt<LIMBS>

§

type Output = UInt<LIMBS>

The resulting type after applying the ^ operator.
source§

fn bitxor(self, rhs: UInt<LIMBS>) -> UInt<LIMBS>

Performs the ^ operation. Read more
source§

impl<const LIMBS: usize> BitXor<UInt<LIMBS>> for UInt<LIMBS>

§

type Output = UInt<LIMBS>

The resulting type after applying the ^ operator.
source§

fn bitxor(self, rhs: Self) -> UInt<LIMBS>

Performs the ^ operation. Read more
source§

impl<const LIMBS: usize> BitXorAssign<&UInt<LIMBS>> for UInt<LIMBS>

source§

fn bitxor_assign(&mut self, other: &Self)

Performs the ^= operation. Read more
source§

impl<const LIMBS: usize> BitXorAssign<UInt<LIMBS>> for UInt<LIMBS>

source§

fn bitxor_assign(&mut self, other: Self)

Performs the ^= operation. Read more
source§

impl<const LIMBS: usize> CheckedAdd<&UInt<LIMBS>> for UInt<LIMBS>

§

type Output = UInt<LIMBS>

Output type.
source§

fn checked_add(&self, rhs: &Self) -> CtOption<Self>

Perform checked subtraction, returning a CtOption which is_some only if the operation did not overflow.
source§

impl<const LIMBS: usize> CheckedMul<&UInt<LIMBS>> for UInt<LIMBS>

§

type Output = UInt<LIMBS>

Output type.
source§

fn checked_mul(&self, rhs: &Self) -> CtOption<Self>

Perform checked multiplication, returning a CtOption which is_some only if the operation did not overflow.
source§

impl<const LIMBS: usize> CheckedSub<&UInt<LIMBS>> for UInt<LIMBS>

§

type Output = UInt<LIMBS>

Output type.
source§

fn checked_sub(&self, rhs: &Self) -> CtOption<Self>

Perform checked subtraction, returning a CtOption which is_some only if the operation did not underflow.
source§

impl<const LIMBS: usize> Clone for UInt<LIMBS>

source§

fn clone(&self) -> UInt<LIMBS>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Concat<UInt<{nlimbs!($bits)}>> for U1024

§

type Output = UInt<{nlimbs!($bits) * 2}>

Concatenated output: twice the width of Self.
source§

fn concat(&self, rhs: &Self) -> Self::Output

Concatenate the two values, with self as most significant and rhs as the least significant.
source§

impl Concat<UInt<{nlimbs!($bits)}>> for U128

§

type Output = UInt<{nlimbs!($bits) * 2}>

Concatenated output: twice the width of Self.
source§

fn concat(&self, rhs: &Self) -> Self::Output

Concatenate the two values, with self as most significant and rhs as the least significant.
source§

impl Concat<UInt<{nlimbs!($bits)}>> for U1536

§

type Output = UInt<{nlimbs!($bits) * 2}>

Concatenated output: twice the width of Self.
source§

fn concat(&self, rhs: &Self) -> Self::Output

Concatenate the two values, with self as most significant and rhs as the least significant.
source§

impl Concat<UInt<{nlimbs!($bits)}>> for U1792

§

type Output = UInt<{nlimbs!($bits) * 2}>

Concatenated output: twice the width of Self.
source§

fn concat(&self, rhs: &Self) -> Self::Output

Concatenate the two values, with self as most significant and rhs as the least significant.
source§

impl Concat<UInt<{nlimbs!($bits)}>> for U192

§

type Output = UInt<{nlimbs!($bits) * 2}>

Concatenated output: twice the width of Self.
source§

fn concat(&self, rhs: &Self) -> Self::Output

Concatenate the two values, with self as most significant and rhs as the least significant.
source§

impl Concat<UInt<{nlimbs!($bits)}>> for U2048

§

type Output = UInt<{nlimbs!($bits) * 2}>

Concatenated output: twice the width of Self.
source§

fn concat(&self, rhs: &Self) -> Self::Output

Concatenate the two values, with self as most significant and rhs as the least significant.
source§

impl Concat<UInt<{nlimbs!($bits)}>> for U256

§

type Output = UInt<{nlimbs!($bits) * 2}>

Concatenated output: twice the width of Self.
source§

fn concat(&self, rhs: &Self) -> Self::Output

Concatenate the two values, with self as most significant and rhs as the least significant.
source§

impl Concat<UInt<{nlimbs!($bits)}>> for U3072

§

type Output = UInt<{nlimbs!($bits) * 2}>

Concatenated output: twice the width of Self.
source§

fn concat(&self, rhs: &Self) -> Self::Output

Concatenate the two values, with self as most significant and rhs as the least significant.
source§

impl Concat<UInt<{nlimbs!($bits)}>> for U384

§

type Output = UInt<{nlimbs!($bits) * 2}>

Concatenated output: twice the width of Self.
source§

fn concat(&self, rhs: &Self) -> Self::Output

Concatenate the two values, with self as most significant and rhs as the least significant.
source§

impl Concat<UInt<{nlimbs!($bits)}>> for U4096

§

type Output = UInt<{nlimbs!($bits) * 2}>

Concatenated output: twice the width of Self.
source§

fn concat(&self, rhs: &Self) -> Self::Output

Concatenate the two values, with self as most significant and rhs as the least significant.
source§

impl Concat<UInt<{nlimbs!($bits)}>> for U448

§

type Output = UInt<{nlimbs!($bits) * 2}>

Concatenated output: twice the width of Self.
source§

fn concat(&self, rhs: &Self) -> Self::Output

Concatenate the two values, with self as most significant and rhs as the least significant.
source§

impl Concat<UInt<{nlimbs!($bits)}>> for U512

§

type Output = UInt<{nlimbs!($bits) * 2}>

Concatenated output: twice the width of Self.
source§

fn concat(&self, rhs: &Self) -> Self::Output

Concatenate the two values, with self as most significant and rhs as the least significant.
source§

impl Concat<UInt<{nlimbs!($bits)}>> for U64

§

type Output = UInt<{nlimbs!($bits) * 2}>

Concatenated output: twice the width of Self.
source§

fn concat(&self, rhs: &Self) -> Self::Output

Concatenate the two values, with self as most significant and rhs as the least significant.
source§

impl Concat<UInt<{nlimbs!($bits)}>> for U768

§

type Output = UInt<{nlimbs!($bits) * 2}>

Concatenated output: twice the width of Self.
source§

fn concat(&self, rhs: &Self) -> Self::Output

Concatenate the two values, with self as most significant and rhs as the least significant.
source§

impl Concat<UInt<{nlimbs!($bits)}>> for U896

§

type Output = UInt<{nlimbs!($bits) * 2}>

Concatenated output: twice the width of Self.
source§

fn concat(&self, rhs: &Self) -> Self::Output

Concatenate the two values, with self as most significant and rhs as the least significant.
source§

impl<const LIMBS: usize> ConditionallySelectable for UInt<LIMBS>

source§

fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self

Select a or b according to choice. Read more
source§

fn conditional_assign(&mut self, other: &Self, choice: Choice)

Conditionally assign other to self, according to choice. Read more
source§

fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)

Conditionally swap self and other if choice == 1; otherwise, reassign both unto themselves. Read more
source§

impl<const LIMBS: usize> ConstantTimeEq for UInt<LIMBS>

source§

fn ct_eq(&self, other: &Self) -> Choice

Determine if two items are equal. Read more
source§

impl<const LIMBS: usize> ConstantTimeGreater for UInt<LIMBS>

source§

fn ct_gt(&self, other: &Self) -> Choice

Determine whether self > other. Read more
source§

impl<const LIMBS: usize> ConstantTimeLess for UInt<LIMBS>

source§

fn ct_lt(&self, other: &Self) -> Choice

Determine whether self < other. Read more
source§

impl<const LIMBS: usize> Debug for UInt<LIMBS>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<const LIMBS: usize> Default for UInt<LIMBS>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<const LIMBS: usize> Display for UInt<LIMBS>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<const LIMBS: usize> Div<&NonZero<UInt<LIMBS>>> for &UInt<LIMBS>where UInt<LIMBS>: Integer,

§

type Output = UInt<LIMBS>

The resulting type after applying the / operator.
source§

fn div(self, rhs: &NonZero<UInt<LIMBS>>) -> Self::Output

Performs the / operation. Read more
source§

impl<const LIMBS: usize> Div<&NonZero<UInt<LIMBS>>> for UInt<LIMBS>where UInt<LIMBS>: Integer,

§

type Output = UInt<LIMBS>

The resulting type after applying the / operator.
source§

fn div(self, rhs: &NonZero<UInt<LIMBS>>) -> Self::Output

Performs the / operation. Read more
source§

impl<const LIMBS: usize> Div<NonZero<UInt<LIMBS>>> for &UInt<LIMBS>where UInt<LIMBS>: Integer,

§

type Output = UInt<LIMBS>

The resulting type after applying the / operator.
source§

fn div(self, rhs: NonZero<UInt<LIMBS>>) -> Self::Output

Performs the / operation. Read more
source§

impl<const LIMBS: usize> Div<NonZero<UInt<LIMBS>>> for UInt<LIMBS>where UInt<LIMBS>: Integer,

§

type Output = UInt<LIMBS>

The resulting type after applying the / operator.
source§

fn div(self, rhs: NonZero<UInt<LIMBS>>) -> Self::Output

Performs the / operation. Read more
source§

impl<const LIMBS: usize> DivAssign<&NonZero<UInt<LIMBS>>> for UInt<LIMBS>where UInt<LIMBS>: Integer,

source§

fn div_assign(&mut self, rhs: &NonZero<UInt<LIMBS>>)

Performs the /= operation. Read more
source§

impl<const LIMBS: usize> DivAssign<NonZero<UInt<LIMBS>>> for UInt<LIMBS>where UInt<LIMBS>: Integer,

source§

fn div_assign(&mut self, rhs: NonZero<UInt<LIMBS>>)

Performs the /= operation. Read more
source§

impl<const LIMBS: usize> From<[Limb; LIMBS]> for UInt<LIMBS>

source§

fn from(limbs: [Limb; LIMBS]) -> Self

Converts to this type from the input type.
source§

impl<const LIMBS: usize> From<[u64; LIMBS]> for UInt<LIMBS>

source§

fn from(arr: [Word; LIMBS]) -> Self

Converts to this type from the input type.
source§

impl From<(UInt<{nlimbs!($bits)}>, UInt<{nlimbs!($bits)}>)> for UInt<{ _ }>

source§

fn from(nums: (U512, U512)) -> UInt<{ _ }>

Converts to this type from the input type.
source§

impl From<(UInt<{nlimbs!($bits)}>, UInt<{nlimbs!($bits)}>)> for UInt<{ _ }>

source§

fn from(nums: (U448, U448)) -> UInt<{ _ }>

Converts to this type from the input type.
source§

impl From<(UInt<{nlimbs!($bits)}>, UInt<{nlimbs!($bits)}>)> for UInt<{ _ }>

source§

fn from(nums: (U256, U256)) -> UInt<{ _ }>

Converts to this type from the input type.
source§

impl From<(UInt<{nlimbs!($bits)}>, UInt<{nlimbs!($bits)}>)> for UInt<{ _ }>

source§

fn from(nums: (U192, U192)) -> UInt<{ _ }>

Converts to this type from the input type.
source§

impl From<(UInt<{nlimbs!($bits)}>, UInt<{nlimbs!($bits)}>)> for UInt<{ _ }>

source§

fn from(nums: (U4096, U4096)) -> UInt<{ _ }>

Converts to this type from the input type.
source§

impl From<(UInt<{nlimbs!($bits)}>, UInt<{nlimbs!($bits)}>)> for UInt<{ _ }>

source§

fn from(nums: (U896, U896)) -> UInt<{ _ }>

Converts to this type from the input type.
source§

impl From<(UInt<{nlimbs!($bits)}>, UInt<{nlimbs!($bits)}>)> for UInt<{ _ }>

source§

fn from(nums: (U768, U768)) -> UInt<{ _ }>

Converts to this type from the input type.
source§

impl From<(UInt<{nlimbs!($bits)}>, UInt<{nlimbs!($bits)}>)> for UInt<{ _ }>

source§

fn from(nums: (U1024, U1024)) -> UInt<{ _ }>

Converts to this type from the input type.
source§

impl From<(UInt<{nlimbs!($bits)}>, UInt<{nlimbs!($bits)}>)> for UInt<{ _ }>

source§

fn from(nums: (U2048, U2048)) -> UInt<{ _ }>

Converts to this type from the input type.
source§

impl From<(UInt<{nlimbs!($bits)}>, UInt<{nlimbs!($bits)}>)> for UInt<{ _ }>

source§

fn from(nums: (U64, U64)) -> UInt<{ _ }>

Converts to this type from the input type.
source§

impl From<(UInt<{nlimbs!($bits)}>, UInt<{nlimbs!($bits)}>)> for UInt<{ _ }>

source§

fn from(nums: (U3072, U3072)) -> UInt<{ _ }>

Converts to this type from the input type.
source§

impl From<(UInt<{nlimbs!($bits)}>, UInt<{nlimbs!($bits)}>)> for UInt<{ _ }>

source§

fn from(nums: (U128, U128)) -> UInt<{ _ }>

Converts to this type from the input type.
source§

impl From<(UInt<{nlimbs!($bits)}>, UInt<{nlimbs!($bits)}>)> for UInt<{ _ }>

source§

fn from(nums: (U1792, U1792)) -> UInt<{ _ }>

Converts to this type from the input type.
source§

impl From<(UInt<{nlimbs!($bits)}>, UInt<{nlimbs!($bits)}>)> for UInt<{ _ }>

source§

fn from(nums: (U384, U384)) -> UInt<{ _ }>

Converts to this type from the input type.
source§

impl From<(UInt<{nlimbs!($bits)}>, UInt<{nlimbs!($bits)}>)> for UInt<{ _ }>

source§

fn from(nums: (U1536, U1536)) -> UInt<{ _ }>

Converts to this type from the input type.
source§

impl<const LIMBS: usize> From<Limb> for UInt<LIMBS>

source§

fn from(limb: Limb) -> Self

Converts to this type from the input type.
source§

impl From<UInt<{nlimbs!($bits)}>> for (UInt<{ _ }>, UInt<{ _ }>)

source§

fn from(num: U192) -> (UInt<{ _ }>, UInt<{ _ }>)

Converts to this type from the input type.
source§

impl From<UInt<{nlimbs!($bits)}>> for (UInt<{ _ }>, UInt<{ _ }>)

source§

fn from(num: U768) -> (UInt<{ _ }>, UInt<{ _ }>)

Converts to this type from the input type.
source§

impl From<UInt<{nlimbs!($bits)}>> for (UInt<{ _ }>, UInt<{ _ }>)

source§

fn from(num: U512) -> (UInt<{ _ }>, UInt<{ _ }>)

Converts to this type from the input type.
source§

impl From<UInt<{nlimbs!($bits)}>> for (UInt<{ _ }>, UInt<{ _ }>)

source§

fn from(num: U256) -> (UInt<{ _ }>, UInt<{ _ }>)

Converts to this type from the input type.
source§

impl From<UInt<{nlimbs!($bits)}>> for (UInt<{ _ }>, UInt<{ _ }>)

source§

fn from(num: U8192) -> (UInt<{ _ }>, UInt<{ _ }>)

Converts to this type from the input type.
source§

impl From<UInt<{nlimbs!($bits)}>> for (UInt<{ _ }>, UInt<{ _ }>)

source§

fn from(num: U6144) -> (UInt<{ _ }>, UInt<{ _ }>)

Converts to this type from the input type.
source§

impl From<UInt<{nlimbs!($bits)}>> for (UInt<{ _ }>, UInt<{ _ }>)

source§

fn from(num: U4096) -> (UInt<{ _ }>, UInt<{ _ }>)

Converts to this type from the input type.
source§

impl From<UInt<{nlimbs!($bits)}>> for (UInt<{ _ }>, UInt<{ _ }>)

source§

fn from(num: U128) -> (UInt<{ _ }>, UInt<{ _ }>)

Converts to this type from the input type.
source§

impl From<UInt<{nlimbs!($bits)}>> for (UInt<{ _ }>, UInt<{ _ }>)

source§

fn from(num: U2048) -> (UInt<{ _ }>, UInt<{ _ }>)

Converts to this type from the input type.
source§

impl From<UInt<{nlimbs!($bits)}>> for (UInt<{ _ }>, UInt<{ _ }>)

source§

fn from(num: U3072) -> (UInt<{ _ }>, UInt<{ _ }>)

Converts to this type from the input type.
source§

impl From<UInt<{nlimbs!($bits)}>> for (UInt<{ _ }>, UInt<{ _ }>)

source§

fn from(num: U1792) -> (UInt<{ _ }>, UInt<{ _ }>)

Converts to this type from the input type.
source§

impl From<UInt<{nlimbs!($bits)}>> for (UInt<{ _ }>, UInt<{ _ }>)

source§

fn from(num: U3584) -> (UInt<{ _ }>, UInt<{ _ }>)

Converts to this type from the input type.
source§

impl From<UInt<{nlimbs!($bits)}>> for (UInt<{ _ }>, UInt<{ _ }>)

source§

fn from(num: U1536) -> (UInt<{ _ }>, UInt<{ _ }>)

Converts to this type from the input type.
source§

impl From<UInt<{nlimbs!($bits)}>> for (UInt<{ _ }>, UInt<{ _ }>)

source§

fn from(num: U896) -> (UInt<{ _ }>, UInt<{ _ }>)

Converts to this type from the input type.
source§

impl From<UInt<{nlimbs!($bits)}>> for (UInt<{ _ }>, UInt<{ _ }>)

source§

fn from(num: U1024) -> (UInt<{ _ }>, UInt<{ _ }>)

Converts to this type from the input type.
source§

impl From<UInt<{nlimbs!($bits)}>> for (UInt<{ _ }>, UInt<{ _ }>)

source§

fn from(num: U384) -> (UInt<{ _ }>, UInt<{ _ }>)

Converts to this type from the input type.
source§

impl From<UInt<{nlimbs!($bits)}>> for (UInt<{ _ }>, UInt<{ _ }>)

source§

fn from(num: U448) -> (UInt<{ _ }>, UInt<{ _ }>)

Converts to this type from the input type.
source§

impl From<UInt<{nlimbs!($bits)}>> for u128

source§

fn from(n: U128) -> u128

Converts to this type from the input type.
source§

impl From<UInt<{nlimbs!($bits)}>> for u64

source§

fn from(n: U64) -> u64

Converts to this type from the input type.
source§

impl<const LIMBS: usize> From<UInt<LIMBS>> for [Limb; LIMBS]

source§

fn from(n: UInt<LIMBS>) -> [Limb; LIMBS]

Converts to this type from the input type.
source§

impl<const LIMBS: usize> From<UInt<LIMBS>> for [Word; LIMBS]

source§

fn from(n: UInt<LIMBS>) -> [Word; LIMBS]

Converts to this type from the input type.
source§

impl<const LIMBS: usize> From<u128> for UInt<LIMBS>

source§

fn from(n: u128) -> Self

Converts to this type from the input type.
source§

impl<const LIMBS: usize> From<u16> for UInt<LIMBS>

source§

fn from(n: u16) -> Self

Converts to this type from the input type.
source§

impl<const LIMBS: usize> From<u32> for UInt<LIMBS>

source§

fn from(n: u32) -> Self

Converts to this type from the input type.
source§

impl<const LIMBS: usize> From<u64> for UInt<LIMBS>

source§

fn from(n: u64) -> Self

Converts to this type from the input type.
source§

impl<const LIMBS: usize> From<u8> for UInt<LIMBS>

source§

fn from(n: u8) -> Self

Converts to this type from the input type.
source§

impl<const LIMBS: usize> Hash for UInt<LIMBS>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<const LIMBS: usize> Integer for UInt<LIMBS>

source§

const ONE: Self = Self::ONE

The value 1.
source§

const MAX: Self = Self::MAX

Maximum value this integer can express.
source§

fn is_odd(&self) -> Choice

Is this integer value an odd number? Read more
source§

fn is_even(&self) -> Choice

Is this integer value an even number? Read more
source§

impl<const LIMBS: usize> LowerHex for UInt<LIMBS>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl<const LIMBS: usize> NegMod for UInt<LIMBS>

§

type Output = UInt<LIMBS>

Output type.
source§

fn neg_mod(&self, p: &Self) -> Self

Compute -self mod p.
source§

impl<const LIMBS: usize> Not for UInt<LIMBS>

§

type Output = UInt<LIMBS>

The resulting type after applying the ! operator.
source§

fn not(self) -> <Self as Not>::Output

Performs the unary ! operation. Read more
source§

impl<const LIMBS: usize> Ord for UInt<LIMBS>

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl<const LIMBS: usize> PartialEq<UInt<LIMBS>> for UInt<LIMBS>

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<const LIMBS: usize> PartialOrd<UInt<LIMBS>> for UInt<LIMBS>

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<const LIMBS: usize> Random for UInt<LIMBS>

source§

fn random(rng: impl CryptoRng + RngCore) -> Self

Generate a cryptographically secure random UInt.

source§

impl<const LIMBS: usize> RandomMod for UInt<LIMBS>

source§

fn random_mod(rng: impl CryptoRng + RngCore, modulus: &NonZero<Self>) -> Self

Generate a cryptographically secure random UInt which is less than a given modulus.

This function uses rejection sampling, a method which produces an unbiased distribution of in-range values provided the underlying CryptoRng is unbiased, but runs in variable-time.

The variable-time nature of the algorithm should not pose a security issue so long as the underlying random number generator is truly a CryptoRng, where previous outputs are unrelated to subsequent outputs and do not reveal information about the RNG’s internal state.

source§

impl<const LIMBS: usize> Rem<&NonZero<UInt<LIMBS>>> for &UInt<LIMBS>where UInt<LIMBS>: Integer,

§

type Output = UInt<LIMBS>

The resulting type after applying the % operator.
source§

fn rem(self, rhs: &NonZero<UInt<LIMBS>>) -> Self::Output

Performs the % operation. Read more
source§

impl<const LIMBS: usize> Rem<&NonZero<UInt<LIMBS>>> for UInt<LIMBS>where UInt<LIMBS>: Integer,

§

type Output = UInt<LIMBS>

The resulting type after applying the % operator.
source§

fn rem(self, rhs: &NonZero<UInt<LIMBS>>) -> Self::Output

Performs the % operation. Read more
source§

impl<const LIMBS: usize> Rem<NonZero<UInt<LIMBS>>> for &UInt<LIMBS>where UInt<LIMBS>: Integer,

§

type Output = UInt<LIMBS>

The resulting type after applying the % operator.
source§

fn rem(self, rhs: NonZero<UInt<LIMBS>>) -> Self::Output

Performs the % operation. Read more
source§

impl<const LIMBS: usize> Rem<NonZero<UInt<LIMBS>>> for UInt<LIMBS>where UInt<LIMBS>: Integer,

§

type Output = UInt<LIMBS>

The resulting type after applying the % operator.
source§

fn rem(self, rhs: NonZero<UInt<LIMBS>>) -> Self::Output

Performs the % operation. Read more
source§

impl<const LIMBS: usize> RemAssign<&NonZero<UInt<LIMBS>>> for UInt<LIMBS>where UInt<LIMBS>: Integer,

source§

fn rem_assign(&mut self, rhs: &NonZero<UInt<LIMBS>>)

Performs the %= operation. Read more
source§

impl<const LIMBS: usize> RemAssign<NonZero<UInt<LIMBS>>> for UInt<LIMBS>where UInt<LIMBS>: Integer,

source§

fn rem_assign(&mut self, rhs: NonZero<UInt<LIMBS>>)

Performs the %= operation. Read more
source§

impl<const LIMBS: usize> Shl<usize> for &UInt<LIMBS>

source§

fn shl(self, rhs: usize) -> UInt<LIMBS>

NOTE: this operation is variable time with respect to rhs ONLY.

When used with a fixed rhs, this function is constant-time with respect to self.

§

type Output = UInt<LIMBS>

The resulting type after applying the << operator.
source§

impl<const LIMBS: usize> Shl<usize> for UInt<LIMBS>

source§

fn shl(self, rhs: usize) -> UInt<LIMBS>

NOTE: this operation is variable time with respect to rhs ONLY.

When used with a fixed rhs, this function is constant-time with respect to self.

§

type Output = UInt<LIMBS>

The resulting type after applying the << operator.
source§

impl<const LIMBS: usize> ShlAssign<usize> for UInt<LIMBS>

source§

fn shl_assign(&mut self, rhs: usize)

NOTE: this operation is variable time with respect to rhs ONLY.

When used with a fixed rhs, this function is constant-time with respect to self.

source§

impl<const LIMBS: usize> Shr<usize> for &UInt<LIMBS>

source§

fn shr(self, rhs: usize) -> UInt<LIMBS>

NOTE: this operation is variable time with respect to rhs ONLY.

When used with a fixed rhs, this function is constant-time with respect to self.

§

type Output = UInt<LIMBS>

The resulting type after applying the >> operator.
source§

impl<const LIMBS: usize> Shr<usize> for UInt<LIMBS>

source§

fn shr(self, rhs: usize) -> UInt<LIMBS>

NOTE: this operation is variable time with respect to rhs ONLY.

When used with a fixed rhs, this function is constant-time with respect to self.

§

type Output = UInt<LIMBS>

The resulting type after applying the >> operator.
source§

impl<const LIMBS: usize> ShrAssign<usize> for UInt<LIMBS>

source§

fn shr_assign(&mut self, rhs: usize)

Performs the >>= operation. Read more
source§

impl Split<UInt<{nlimbs!($bits)}>> for U1024

§

type Output = UInt<{nlimbs!($bits) / 2}>

Split output: high/low components of the value.
source§

fn split(&self) -> (Self::Output, Self::Output)

Split this number in half, returning its high and low components respectively.
source§

impl Split<UInt<{nlimbs!($bits)}>> for U128

§

type Output = UInt<{nlimbs!($bits) / 2}>

Split output: high/low components of the value.
source§

fn split(&self) -> (Self::Output, Self::Output)

Split this number in half, returning its high and low components respectively.
source§

impl Split<UInt<{nlimbs!($bits)}>> for U1536

§

type Output = UInt<{nlimbs!($bits) / 2}>

Split output: high/low components of the value.
source§

fn split(&self) -> (Self::Output, Self::Output)

Split this number in half, returning its high and low components respectively.
source§

impl Split<UInt<{nlimbs!($bits)}>> for U1792

§

type Output = UInt<{nlimbs!($bits) / 2}>

Split output: high/low components of the value.
source§

fn split(&self) -> (Self::Output, Self::Output)

Split this number in half, returning its high and low components respectively.
source§

impl Split<UInt<{nlimbs!($bits)}>> for U192

§

type Output = UInt<{nlimbs!($bits) / 2}>

Split output: high/low components of the value.
source§

fn split(&self) -> (Self::Output, Self::Output)

Split this number in half, returning its high and low components respectively.
source§

impl Split<UInt<{nlimbs!($bits)}>> for U2048

§

type Output = UInt<{nlimbs!($bits) / 2}>

Split output: high/low components of the value.
source§

fn split(&self) -> (Self::Output, Self::Output)

Split this number in half, returning its high and low components respectively.
source§

impl Split<UInt<{nlimbs!($bits)}>> for U256

§

type Output = UInt<{nlimbs!($bits) / 2}>

Split output: high/low components of the value.
source§

fn split(&self) -> (Self::Output, Self::Output)

Split this number in half, returning its high and low components respectively.
source§

impl Split<UInt<{nlimbs!($bits)}>> for U3072

§

type Output = UInt<{nlimbs!($bits) / 2}>

Split output: high/low components of the value.
source§

fn split(&self) -> (Self::Output, Self::Output)

Split this number in half, returning its high and low components respectively.
source§

impl Split<UInt<{nlimbs!($bits)}>> for U3584

§

type Output = UInt<{nlimbs!($bits) / 2}>

Split output: high/low components of the value.
source§

fn split(&self) -> (Self::Output, Self::Output)

Split this number in half, returning its high and low components respectively.
source§

impl Split<UInt<{nlimbs!($bits)}>> for U384

§

type Output = UInt<{nlimbs!($bits) / 2}>

Split output: high/low components of the value.
source§

fn split(&self) -> (Self::Output, Self::Output)

Split this number in half, returning its high and low components respectively.
source§

impl Split<UInt<{nlimbs!($bits)}>> for U4096

§

type Output = UInt<{nlimbs!($bits) / 2}>

Split output: high/low components of the value.
source§

fn split(&self) -> (Self::Output, Self::Output)

Split this number in half, returning its high and low components respectively.
source§

impl Split<UInt<{nlimbs!($bits)}>> for U448

§

type Output = UInt<{nlimbs!($bits) / 2}>

Split output: high/low components of the value.
source§

fn split(&self) -> (Self::Output, Self::Output)

Split this number in half, returning its high and low components respectively.
source§

impl Split<UInt<{nlimbs!($bits)}>> for U512

§

type Output = UInt<{nlimbs!($bits) / 2}>

Split output: high/low components of the value.
source§

fn split(&self) -> (Self::Output, Self::Output)

Split this number in half, returning its high and low components respectively.
source§

impl Split<UInt<{nlimbs!($bits)}>> for U6144

§

type Output = UInt<{nlimbs!($bits) / 2}>

Split output: high/low components of the value.
source§

fn split(&self) -> (Self::Output, Self::Output)

Split this number in half, returning its high and low components respectively.
source§

impl Split<UInt<{nlimbs!($bits)}>> for U768

§

type Output = UInt<{nlimbs!($bits) / 2}>

Split output: high/low components of the value.
source§

fn split(&self) -> (Self::Output, Self::Output)

Split this number in half, returning its high and low components respectively.
source§

impl Split<UInt<{nlimbs!($bits)}>> for U8192

§

type Output = UInt<{nlimbs!($bits) / 2}>

Split output: high/low components of the value.
source§

fn split(&self) -> (Self::Output, Self::Output)

Split this number in half, returning its high and low components respectively.
source§

impl Split<UInt<{nlimbs!($bits)}>> for U896

§

type Output = UInt<{nlimbs!($bits) / 2}>

Split output: high/low components of the value.
source§

fn split(&self) -> (Self::Output, Self::Output)

Split this number in half, returning its high and low components respectively.
source§

impl<const LIMBS: usize> SubMod<UInt<LIMBS>> for UInt<LIMBS>

§

type Output = UInt<LIMBS>

Output type.
source§

fn sub_mod(&self, rhs: &Self, p: &Self) -> Self

Compute self - rhs mod p. Read more
source§

impl<const LIMBS: usize> UpperHex for UInt<LIMBS>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl<const LIMBS: usize> Zero for UInt<LIMBS>

source§

const ZERO: Self = Self::ZERO

The value 0.
source§

fn is_zero(&self) -> Choice

Determine if this value is equal to zero. Read more
source§

impl<const LIMBS: usize> Copy for UInt<LIMBS>

source§

impl<const LIMBS: usize> DefaultIsZeroes for UInt<LIMBS>

source§

impl<const LIMBS: usize> Eq for UInt<LIMBS>

Auto Trait Implementations§

§

impl<const LIMBS: usize> RefUnwindSafe for UInt<LIMBS>

§

impl<const LIMBS: usize> Send for UInt<LIMBS>

§

impl<const LIMBS: usize> Sync for UInt<LIMBS>

§

impl<const LIMBS: usize> Unpin for UInt<LIMBS>

§

impl<const LIMBS: usize> UnwindSafe for UInt<LIMBS>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.
source§

impl<Z> Zeroize for Zwhere Z: DefaultIsZeroes,

source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler.