Skip to main content

Uint

Struct Uint 

Source
pub struct Uint<const LIMBS: usize> { /* private fields */ }
Expand description

Stack-allocated 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)

👎Deprecated since 0.7.0:

please use carrying_add instead

Computes self + rhs + carry, returning the result along with the new carry.

Source

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

Computes self + rhs + 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: &Self, p: &NonZero<Self>) -> Self

Computes self + rhs mod p.

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 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

pub const fn double_mod(&self, p: &NonZero<Self>) -> Self

Computes self + self mod p.

Assumes self as unbounded integer is < p.

Source§

impl<const LIMBS: usize> Uint<LIMBS>

Source

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

Computes bitwise a & b.

Source

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

Perform bitwise AND between self and the given Limb, performing the AND operation on every limb of self.

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 const 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 const 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 const 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(&self, index: u32) -> Choice

Get the value of the bit at position index, as a truthy or falsy Choice. Returns the falsy value for indices out of range.

Source

pub const fn bit_vartime(&self, index: u32) -> bool

Returns true if the bit at position index is set, false otherwise.

§Remarks

This operation is variable time with respect to index only.

Source

pub const fn bits(&self) -> u32

Calculate the number of bits needed to represent this number.

Source

pub const fn bits_vartime(&self) -> u32

Calculate the number of bits needed to represent this number in variable-time with respect to self.

Source

pub const fn leading_zeros(&self) -> u32

Calculate the number of leading zeros in the binary representation of this number.

Source

pub const fn leading_zeros_vartime(&self) -> u32

Calculate the number of leading zeros in the binary representation of this number in variable-time with respect to self.

Source

pub const fn trailing_zeros(&self) -> u32

Calculate the number of trailing zeros in the binary representation of this number.

Source

pub const fn trailing_zeros_vartime(&self) -> u32

Calculate the number of trailing zeros in the binary representation of this number in variable-time with respect to self.

Source

pub const fn trailing_ones(&self) -> u32

Calculate the number of trailing ones in the binary representation of this number.

Source

pub const fn trailing_ones_vartime(&self) -> u32

Calculate the number of trailing ones in the binary representation of this number, variable time in self.

Source§

impl<const LIMBS: usize> Uint<LIMBS>

Source

pub const fn is_nonzero(&self) -> Choice

Returns Choice::TRUE if self != 0 or Choice::FALSE otherwise.

Source

pub const fn is_zero_vartime(&self) -> bool

Determine in variable time whether the self is zero.

Source

pub const fn is_odd(&self) -> Choice

Returns the truthy value if self is odd or the falsy value otherwise.

Source

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

Returns the Ordering between self and rhs in variable time.

Source§

impl<const LIMBS: usize> Uint<LIMBS>

Source

pub const fn concat<const WIDE_LIMBS: usize>( &self, hi: &Self, ) -> Uint<WIDE_LIMBS>
where Self: Concat<LIMBS, Output = Uint<WIDE_LIMBS>>,

Concatenate the two values, with self as least significant and hi as the most significant, with both values having the same size.

Source

pub const fn concat_mixed<const HI_LIMBS: usize, const WIDE_LIMBS: usize>( &self, hi: &Uint<HI_LIMBS>, ) -> Uint<WIDE_LIMBS>
where Self: Concat<HI_LIMBS, Output = Uint<WIDE_LIMBS>>,

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

Source

pub const fn concat_checked<const HI_LIMBS: usize, const WIDE_LIMBS: usize>( &self, hi: &Uint<HI_LIMBS>, ) -> Option<Uint<WIDE_LIMBS>>

Concatenate the two values, with self as least significant and hi as the most significant. If WIDE_LIMBS is not equal to the sum of LIMBS and HI_LIMBS, then None is returned.

Source

pub const fn concat_resize<const HI_LIMBS: usize, const WIDE_LIMBS: usize>( &self, hi: &Uint<HI_LIMBS>, ) -> Uint<WIDE_LIMBS>

Concatenate the two values, with self as least significant and hi as the most significant. The resulting wide integer may be truncated or extended with zeros depending upon whether its size is less than or greater than the sum of LIMBS and HI_LIMBS.

Source§

impl<const LIMBS: usize> Uint<LIMBS>

Source

pub const fn div_rem_limb_with_reciprocal( &self, reciprocal: &Reciprocal, ) -> (Self, Limb)

Computes self / rhs using a pre-made reciprocal, returning the quotient and remainder.

Source

pub const fn div_rem_limb(&self, rhs: NonZero<Limb>) -> (Self, Limb)

Computes self / rhs, returning the quotient and remainder.

Source

pub const fn rem_limb_with_reciprocal(&self, reciprocal: &Reciprocal) -> Limb

Computes self % rhs using a pre-made reciprocal.

Source

pub const fn rem_limb(&self, rhs: NonZero<Limb>) -> Limb

Computes self % rhs for a Limb-sized divisor.

Source

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

Computes self / rhs, returning the quotient and the remainder.

This function is constant-time with respect to both self and rhs.

Source

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

Computes self / rhs, returning the quotient and the remainder.

This is variable-time only with respect to rhs.

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

Source

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

Computes self % rhs.

Source

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

Computes self % rhs in variable-time with respect to rhs.

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

Source

pub const fn rem_wide(lower_upper: (Self, Self), rhs: &NonZero<Self>) -> Self

Computes self % rhs for a double-width Uint.

Source

pub const fn rem_wide_vartime( lower_upper: (Self, Self), rhs: &NonZero<Self>, ) -> Self

Computes self % rhs.

This is variable-time only with respect to rhs.

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

Source

pub const fn rem2k_vartime(&self, k: u32) -> 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.

§Usage:
use crypto_bigint::{U448, Limb};

let a = U448::from(10_u64);
let k = 3; // 2^3 = 8
let remainder = a.rem2k_vartime(k);

// As 10 % 8 = 2
assert_eq!(remainder, U448::from(2_u64));
Source

pub const fn wrapping_div(&self, rhs: &NonZero<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 const fn wrapping_div_vartime<const RHS: usize>( &self, rhs: &NonZero<Uint<RHS>>, ) -> 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<const RHS_LIMBS: usize>( &self, rhs: &Uint<RHS_LIMBS>, ) -> CtOption<Self>

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

§Usage:
use crypto_bigint::{U448, NonZero};

let a = U448::from(8_u64);
let result = NonZero::new(U448::from(4_u64))
    .map(|b| a.div_rem(&b))
    .expect("Division by zero");

assert_eq!(result.0, U448::from(2_u64));

// Check division by zero
let zero = U448::from(0_u64);
assert!(a.checked_div(&zero).is_none().to_bool(), "should be None for division by zero");
Source

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

This function exists, so that all operations are accounted for in the wrapping operations.

§Panics
  • if rhs == 0.
§Usage:
use crypto_bigint::U448;

let a = U448::from(10_u64);
let b = U448::from(3_u64);
let remainder = a.wrapping_rem_vartime(&b);

assert_eq!(remainder, U448::from(1_u64));
Source

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

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

§Usage:
use crypto_bigint::{U448, NonZero};

let a = U448::from(10_u64);
let remainder_option = NonZero::new(U448::from(3_u64))
    .map(|b| a.rem(&b));

assert!(bool::from(remainder_option.is_some()));

// Check reduction by zero
let zero = U448::from(0_u64);

assert!(a.checked_rem(&zero).is_none().to_bool(), "should be None for reduction by zero");
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.

§Panics
  • If the supplied byte slice is the incorrect size
Source

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

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

§Panics
  • if the hex is malformed or not zero-padded accordingly for the size.
Source

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

Create a new Uint from the provided little endian bytes.

§Panics
  • If the supplied byte slice is the incorrect size
Source

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

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

§Panics
  • if the hex is malformed or not zero-padded accordingly for the size.
Source

pub fn from_str_radix_vartime( src: &str, radix: u32, ) -> Result<Self, DecodeError>

Create a new Uint from a string slice in a given base.

The string may begin with a + character, and may use underscore characters to separate digits.

§Errors
§Panics
  • if radix is not in the range from 2 to 36.
Source

pub fn to_string_radix_vartime(&self, radix: u32) -> String

Available on crate feature alloc only.

Format a Uint as a string in a given base.

§Panics
  • if radix is not in the range from 2 to 36.
Source

pub const fn to_be_bytes(&self) -> EncodedUint<LIMBS>

Serialize as big endian bytes.

Source

pub const fn to_le_bytes(&self) -> EncodedUint<LIMBS>

Serialize as little endian bytes.

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 gcd(&self, rhs: &Self) -> Self

Compute the greatest common divisor of self and rhs.

Source

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

Compute the greatest common divisor of self and rhs.

Executes in variable time w.r.t. all input parameters.

Source

pub const fn xgcd(&self, rhs: &Self) -> XgcdOutput<LIMBS, Uint<LIMBS>>

Executes the Extended GCD algorithm.

Given (self, rhs), computes (g, x, y), s.t. self * x + rhs * y = g = gcd(self, rhs).

Source§

impl<const LIMBS: usize> Uint<LIMBS>

Source

pub const fn inv_mod2k_vartime(&self, k: u32) -> CtOption<Self>

👎Deprecated since 0.7.0:

please use invert_mod2k_vartime instead

Computes 1/self mod 2^k. This method is constant-time w.r.t. self but not k.

If the inverse does not exist (k > 0 and self is even), returns Choice::FALSE as the second element of the tuple, otherwise returns Choice::TRUE.

Source

pub const fn invert_mod2k_vartime(&self, k: u32) -> CtOption<Self>

Computes 1/self mod 2^k. This method is constant-time w.r.t. self but not k.

If the inverse does not exist (k > 0 and self is even, or k > Self::BITS), returns CtOption::none, otherwise returns CtOption::some.

Source

pub const fn inv_mod2k(&self, k: u32) -> CtOption<Self>

👎Deprecated since 0.7.0:

please use invert_mod2k instead

Computes 1/self mod 2^k.

If the inverse does not exist (k > 0 and self is even, k > Self::BITS), returns CtOption::none, otherwise returns CtOption::some.

Source

pub const fn invert_mod2k(&self, k: u32) -> CtOption<Self>

Computes 1/self mod 2^k.

If the inverse does not exist (k > 0 and self is even, or k > Self::BITS), returns CtOption::none, otherwise returns CtOption::some.

Source

pub const fn inv_odd_mod(&self, modulus: &Odd<Self>) -> CtOption<Self>

👎Deprecated since 0.7.0:

please use invert_odd_mod instead

Computes the multiplicative inverse of self mod modulus, where modulus is odd.

Source

pub const fn invert_odd_mod(&self, modulus: &Odd<Self>) -> CtOption<Self>

Computes the multiplicative inverse of self mod modulus, where modulus is odd.

Source

pub const fn invert_odd_mod_vartime( &self, modulus: &Odd<Self>, ) -> CtOption<Self>

Computes the multiplicative inverse of self mod modulus, where modulus is odd.

This method is variable-time with respect to self.

Source

pub const fn inv_mod(&self, modulus: &Self) -> CtOption<Self>

👎Deprecated since 0.7.0:

please use invert_mod instead

Computes the multiplicative inverse of self mod modulus.

Returns some if an inverse exists, otherwise none.

Source

pub const fn invert_mod(&self, modulus: &NonZero<Self>) -> CtOption<Self>

Computes the multiplicative inverse of self mod modulus.

Returns some if an inverse exists, otherwise none.

Source§

impl<const LIMBS: usize> Uint<LIMBS>

Source

pub const fn lcm<const WIDE_LIMBS: usize>(&self, rhs: &Self) -> Uint<WIDE_LIMBS>
where Self: Concat<LIMBS, Output = Uint<WIDE_LIMBS>>,

Compute the least common multiple of self and rhs.

Source§

impl<const LIMBS: usize> Uint<LIMBS>

Source

pub const fn jacobi_symbol<const RHS_LIMBS: usize>( &self, rhs: &Odd<Uint<RHS_LIMBS>>, ) -> JacobiSymbol

Compute the Jacobi symbol (self|rhs).

For prime rhs, this corresponds to the Legendre symbol and indicates whether self is quadratic residue modulo rhs.

Source

pub const fn jacobi_symbol_vartime<const RHS_LIMBS: usize>( &self, rhs: &Odd<Uint<RHS_LIMBS>>, ) -> JacobiSymbol

Compute the Jacobi symbol (self|rhs).

For prime rhs, this corresponds to the Legendre symbol and indicates whether self is quadratic residue modulo rhs.

This method executes in variable-time for both inputs.

Source§

impl<const LIMBS: usize> Uint<LIMBS>

Source

pub const fn concatenating_mul<const RHS_LIMBS: usize, const WIDE_LIMBS: usize>( &self, rhs: &Uint<RHS_LIMBS>, ) -> Uint<WIDE_LIMBS>
where Self: Concat<RHS_LIMBS, Output = Uint<WIDE_LIMBS>>,

Multiply self by rhs, returning a concatenated “wide” result.

Source

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

👎Deprecated since 0.7.0:

please use widening_mul instead

Compute “wide” multiplication as a 2-tuple containing the (lo, hi) components of the product, whose sizes correspond to the sizes of the operands.

Source

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

Compute “wide” multiplication as a 2-tuple containing the (lo, hi) components of the product, whose sizes correspond to the sizes of the operands.

Source

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

Perform wrapping multiplication, discarding overflow.

Source

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

Perform saturating multiplication, returning MAX on overflow.

Source

pub const fn checked_mul<const RHS_LIMBS: usize>( &self, rhs: &Uint<RHS_LIMBS>, ) -> CtOption<Uint<LIMBS>>

Perform wrapping multiplication, checking that the result fits in the original Uint size.

Source§

impl<const LIMBS: usize> Uint<LIMBS>

Squaring operations

Source

pub const fn square_wide(&self) -> (Self, Self)

👎Deprecated since 0.7.0:

please use widening_square instead

Square self, returning a “wide” result in two parts as (lo, hi).

Source

pub const fn widening_square(&self) -> (Self, Self)

Square self, returning a “wide” result in two parts as (lo, hi).

Source

pub const fn concatenating_square<const WIDE_LIMBS: usize>( &self, ) -> Uint<WIDE_LIMBS>
where Self: Concat<LIMBS, Output = Uint<WIDE_LIMBS>>,

Square self, returning a concatenated “wide” result.

Source

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

Square self, checking that the result fits in the original Uint size.

Source

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

Perform wrapping square, discarding overflow.

Source

pub const fn saturating_square(&self) -> Self

Perform saturating squaring, returning MAX on overflow.

Source§

impl<const LIMBS: usize, const WIDE_LIMBS: usize> Uint<LIMBS>
where Self: Concat<LIMBS, Output = Uint<WIDE_LIMBS>>,

Source

pub const fn square(&self) -> Uint<WIDE_LIMBS>

👎Deprecated since 0.7.0:

please use concatenating_square instead

Square self, returning a concatenated “wide” result.

Source§

impl<const LIMBS: usize> Uint<LIMBS>

Source

pub fn mul_mod( &self, rhs: &Uint<LIMBS>, p: &NonZero<Uint<LIMBS>>, ) -> Uint<LIMBS>

Computes self * rhs mod p.

Source

pub fn mul_mod_vartime( &self, rhs: &Uint<LIMBS>, p: &NonZero<Uint<LIMBS>>, ) -> Uint<LIMBS>

Computes self * rhs mod p in variable time with respect to p.

Source

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

Computes self * rhs mod p 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

pub const fn square_mod(&self, p: &NonZero<Uint<LIMBS>>) -> Self

Computes self * self mod p.

Source

pub const fn square_mod_vartime(&self, p: &NonZero<Uint<LIMBS>>) -> Self

Computes self * self mod p in variable time with respect to p.

Source§

impl<const LIMBS: usize> Uint<LIMBS>

Source

pub const fn widening_mul_signed<const RHS_LIMBS: usize>( &self, rhs: &Int<RHS_LIMBS>, ) -> (Uint<LIMBS>, Uint<RHS_LIMBS>, Choice)

Compute “wide” multiplication between an Uint and Int as 3-tuple (lo, hi, negate). The (lo, hi) components contain the magnitude of the product, with sizes corresponding to the sizes of the operands; negate indicates whether the result should be negated when converted from Uint to Int.

Note: even if negate is truthy, the magnitude might be zero!

Source

pub const fn concatenating_mul_signed<const RHS_LIMBS: usize, const WIDE_LIMBS: usize>( &self, rhs: &Int<RHS_LIMBS>, ) -> Int<WIDE_LIMBS>
where Uint<LIMBS>: Concat<RHS_LIMBS, Output = Uint<WIDE_LIMBS>>,

Multiply self by Int rhs, returning a concatenated “wide” result.

Source

pub fn checked_mul_signed<const RHS_LIMBS: usize>( &self, rhs: &Int<RHS_LIMBS>, ) -> CtOption<Int<LIMBS>>

Checked multiplication of self with Int rhs.

Source§

impl<const LIMBS: usize> Uint<LIMBS>

Source

pub const fn wrapping_neg(&self) -> Self

Perform wrapping negation.

Source

pub const fn carrying_neg(&self) -> (Self, Choice)

Perform negation: map self to (self ^ 1111...1111) + 0000...0001. Additionally return whether the carry flag is set on the addition.

Note: the carry is set if and only if self == Self::ZERO.

Source

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

Perform wrapping negation, if negate is truthy. Otherwise, return self.

Source§

impl<const LIMBS: usize> Uint<LIMBS>

Source

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

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

Source

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

Computes -a mod p 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 checked_pow<const RHS_LIMBS: usize>( &self, exp: &Uint<RHS_LIMBS>, ) -> CtOption<Self>

Computes self^exp, returning a CtOption which is none in the case of overflow.

Source

pub const fn checked_pow_bounded_exp<const RHS_LIMBS: usize>( &self, exp: &Uint<RHS_LIMBS>, exp_bits: u32, ) -> CtOption<Self>

Computes self^exp, returning a CtOption which is none in the case of overflow.

NOTE: exp_bits may be leaked in the time pattern.

§Panics
  • if exp_bits exceeds the capacity of rhs
Source

pub const fn checked_pow_vartime<const RHS_LIMBS: usize>( &self, exp: &Uint<RHS_LIMBS>, ) -> CtOption<Self>

Computes self^exp, returning a CtOption which is none in the case of overflow.

This method is variable time in the exponent exp only.

Source

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

Computes self^exp, returning a Self::MAX in the case of overflow.

Source

pub const fn saturating_pow_bounded_exp<const RHS_LIMBS: usize>( &self, exp: &Uint<RHS_LIMBS>, exp_bits: u32, ) -> Self

Computes self^exp, returning a Self::MAX in the case of overflow.

NOTE: exp_bits may be leaked in the time pattern.

§Panics
  • if exp_bits exceeds the capacity of rhs
Source

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

Computes self^exp, returning a Self::MAX in the case of overflow.

This method is variable time in the exponent exp.

Source

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

Computes self^exp, discarding overflow.

Source

pub const fn wrapping_pow_bounded_exp<const RHS_LIMBS: usize>( &self, exp: &Uint<RHS_LIMBS>, exp_bits: u32, ) -> Self

Computes self^exp, discarding overflow.

NOTE: exp_bits may be leaked in the time pattern.

§Panics
  • if exp_bits exceeds the capacity of rhs
Source

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

Computes self^exp, discarding overflow.

This method is variable time in the exponent exp only.

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

pub const fn resize_checked<const T: usize>(&self) -> CtOption<Uint<T>>

Construct a Uint<T> from the unsigned integer value, returning a CtOption which is is_none if the upper limbs were non-zero.

Source§

impl<const LIMBS: usize> Uint<LIMBS>

Source

pub const fn floor_root_vartime(&self, exp: NonZeroU32) -> Self

Computes floor(self^(1/exp)).

Callers can check if self is an exact power of exp by exponentiating the result.

This method is variable time in self and in the exponent.

Source

pub fn checked_root_vartime(&self, exp: NonZeroU32) -> Option<Self>

Compute the root self^(1/exp) returning an Option which is_some only if the root is exact.

This method is variable time in self and in the exponent.

Source§

impl<const LIMBS: usize> Uint<LIMBS>

Source

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

Computes self << shift.

§Panics
  • if shift >= Self::BITS.
Source

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

Computes self << shift in variable time.

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

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

§Panics
  • if shift >= Self::BITS.
Source

pub const fn overflowing_shl(&self, shift: u32) -> CtOption<Self>

Computes self << shift.

Returns None if shift >= Self::BITS.

Source

pub const fn overflowing_shl_vartime(&self, shift: u32) -> Option<Self>

Computes self << shift.

Returns None if shift >= Self::BITS.

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

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

Source

pub const fn overflowing_shl_vartime_wide( lower_upper: (Self, Self), shift: u32, ) -> Option<(Self, Self)>

Computes a left shift on a wide input as (lo, hi).

Returns None if shift >= Self::BITS.

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

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

Source

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

Computes self << shift in a panic-free manner, returning zero if the shift exceeds the precision.

Source

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

Computes self << shift in variable time in a panic-free manner, returning zero if the shift exceeds the precision.

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

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

Source

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

Computes self << shift where shift < shift_upper_bound.

The runtime is determined by shift_upper_bound which may be larger or smaller than Self::BITS.

§Panics
  • if the shift exceeds the upper bound.
Source

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

Computes self << shift in a panic-free manner, reducing shift modulo the type’s width.

Source

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

Computes self << shift in variable-time in a panic-free manner, reducing shift modulo the type’s width.

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

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

Source§

impl<const LIMBS: usize> Uint<LIMBS>

Source

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

Computes self >> shift.

§Panics
  • if shift >= Self::BITS.
Source

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

Computes self >> shift in variable time.

§Panics
  • if shift >= Self::BITS.
Source

pub const fn overflowing_shr(&self, shift: u32) -> CtOption<Self>

Computes self >> shift.

Returns None if shift >= Self::BITS.

Source

pub const fn overflowing_shr_vartime(&self, shift: u32) -> Option<Self>

Computes self >> shift.

Returns None if shift >= Self::BITS.

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

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

Source

pub const fn overflowing_shr_vartime_wide( lower_upper: (Self, Self), shift: u32, ) -> Option<(Self, Self)>

Computes a right shift on a wide input as (lo, hi).

Returns None if shift >= Self::BITS.

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

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

Source

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

Computes self >> shift where shift < shift_upper_bound.

The runtime is determined by shift_upper_bound which may be larger or smaller than Self::BITS.

§Panics
  • if the shift exceeds the upper bound.
Source

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

Computes self >> shift in a panic-free manner, returning zero if the shift exceeds the precision.

Source

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

Computes self >> shift in variable time in a panic-free manner, returning zero if the shift exceeds the precision.

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

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

Source

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

Computes self >> shift in a panic-free manner, reducing shift modulo the type’s width.

Source

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

Computes self >> shift in variable-time in a panic-free manner, reducing shift modulo the type’s width.

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

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

Source§

impl<const LIMBS: usize> Uint<LIMBS>

Source

pub const fn split<const HALF_LIMBS: usize>( &self, ) -> (Uint<HALF_LIMBS>, Uint<HALF_LIMBS>)
where Self: SplitEven<Output = Uint<HALF_LIMBS>>,

Split this number in half into low and high components.

Source

pub const fn split_mixed<const LO_LIMBS: usize, const HI_LIMBS: usize>( &self, ) -> (Uint<LO_LIMBS>, Uint<HI_LIMBS>)
where Self: Split<LO_LIMBS, Output = Uint<HI_LIMBS>>,

Split this number into low and high components respectively.

Source

pub const fn split_checked<const LO_LIMBS: usize, const HI_LIMBS: usize>( &self, ) -> Option<(Uint<LO_LIMBS>, Uint<HI_LIMBS>)>

Split this integer into low and high components. If LIMBS is not equal to the sum of LIMBS and HI_LIMBS, then None is returned.

Source

pub const fn split_resize<const LO_LIMBS: usize, const HI_LIMBS: usize>( &self, ) -> (Uint<LO_LIMBS>, Uint<HI_LIMBS>)

Split this integer into low and high components. The resulting values may be truncated or extended with zeros depending upon whether LIMBS is greater or less than the sum of LO_LIMBS and HI_LIMBS.

Source§

impl<const LIMBS: usize> Uint<LIMBS>

Source

pub const fn sqrt(&self) -> Self

👎Deprecated since 0.7.0:

please use floor_sqrt instead

Computes floor(√(self)) in constant time.

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

Source

pub const fn floor_sqrt(&self) -> Self

Computes floor(√(self)) in constant time.

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

Source

pub const fn sqrt_vartime(&self) -> Self

👎Deprecated since 0.7.0:

please use floor_sqrt_vartime instead

Computes floor(√(self)).

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

Variable time with respect to self.

Source

pub const fn floor_sqrt_vartime(&self) -> Self

Computes floor(√(self)).

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

Variable time with respect to self.

Source

pub const fn wrapping_sqrt(&self) -> Self

Wrapped sqrt is just floor(√(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 const fn wrapping_sqrt_vartime(&self) -> Self

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

Variable time with respect to self.

Source

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

Perform checked sqrt, returning a CtOption which is_some only if the square root is exact.

Source

pub fn checked_sqrt_vartime(&self) -> Option<Self>

Perform checked sqrt, returning an Option which is_some only if the square root is exact.

Variable time with respect to self.

Source§

impl<const LIMBS: usize> Uint<LIMBS>

Source

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

👎Deprecated since 0.7.0:

please use borrowing_sub instead

Computes self - (rhs + borrow), returning the result along with the new borrow.

Source

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

Computes self - (rhs + 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: &Self, p: &NonZero<Self>) -> Self

Computes self - rhs mod p.

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 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 MAX: Self

Maximum value this Uint can express.

Source

pub const BITS: u32

Total size of the represented integer in bits.

Source

pub const BYTES: usize

Total size of the represented integer in bytes.

Source

pub const LIMBS: usize = LIMBS

The number of limbs used on this platform.

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 const fn as_mut_words(&mut self) -> &mut [Word; LIMBS]

Borrow the inner limbs as a mutable array of Words.

Source

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

👎Deprecated since 0.7.0:

please use as_mut_words instead

Borrow the inner limbs as a mutable slice of Words.

Source

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

Borrow the limbs of this Uint.

Source

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

Borrow the limbs of this Uint mutably.

Source

pub const fn as_limbs_mut(&mut self) -> &mut [Limb]

👎Deprecated since 0.7.0:

please use as_mut_limbs instead

Borrow the limbs of this Uint mutably.

Source

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

Convert this Uint into its inner limbs.

Source

pub const fn as_uint_ref(&self) -> &UintRef

Borrow the limbs of this Uint as a UintRef.

Source

pub const fn as_mut_uint_ref(&mut self) -> &mut UintRef

Mutably borrow the limbs of this Uint as a UintRef.

Source

pub const fn to_nz(&self) -> CtOption<NonZero<Self>>

Convert to a NonZeroUint<LIMBS>.

Returns some if the original value is non-zero, and none otherwise.

Source

pub const fn to_nz_vartime(&self) -> Option<NonZero<Self>>

Convert to a NonZeroUint<LIMBS>.

Returns Some if the original value is non-zero, and none otherwise.

Source

pub const fn to_odd(&self) -> CtOption<Odd<Self>>

Convert to a OddUint<LIMBS>.

Returns some if the original value is odd, and false otherwise.

Source

pub const fn as_int(&self) -> &Int<LIMBS>

Interpret this object as an Int instead.

Note: this is a casting operation. See Self::try_into_int for the checked equivalent.

Source

pub const fn try_into_int(self) -> CtOption<Int<LIMBS>>

Convert this type into an Int; returns None if this value is greater than Int::MAX.

Note: this is the conversion operation. See Self::as_int for the unchecked equivalent.

Source

pub const fn is_zero(&self) -> Choice

Is this Uint equal to Uint::ZERO?

Trait Implementations§

Source§

impl<const LIMBS: usize> Add<&Uint<LIMBS>> for Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Self) -> Self

Performs the + operation. Read more
Source§

impl<const LIMBS: usize> Add for Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self

Performs the + operation. Read more
Source§

impl<const LIMBS: usize> AddAssign<&Uint<LIMBS>> for Uint<LIMBS>

Source§

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

Performs the += operation. Read more
Source§

impl<const LIMBS: usize> AddAssign for Uint<LIMBS>

Source§

fn add_assign(&mut self, other: Self)

Performs the += operation. Read more
Source§

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

Source§

type Output = Uint<LIMBS>

Output type.
Source§

fn add_mod(&self, rhs: &Self, p: &NonZero<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> AsMut<UintRef> for Uint<LIMBS>

Source§

fn as_mut(&mut self) -> &mut UintRef

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> AsRef<UintRef> for Uint<LIMBS>

Source§

fn as_ref(&self) -> &UintRef

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

impl<const LIMBS: usize> Binary 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> BitAnd<&Uint<LIMBS>> for &Uint<LIMBS>

Source§

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>

Source§

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>

Source§

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 for Uint<LIMBS>

Source§

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 for Uint<LIMBS>

Source§

fn bitand_assign(&mut self, other: Self)

Performs the &= operation. Read more
Source§

impl<const LIMBS: usize> BitOps for Uint<LIMBS>

Source§

fn bits_precision(&self) -> u32

Precision of this integer in bits.
Source§

fn bytes_precision(&self) -> usize

Precision of this integer in bytes.
Source§

fn leading_zeros(&self) -> u32

Calculate the number of leading zeros in the binary representation of this number.
Source§

fn bit(&self, index: u32) -> Choice

Get the value of the bit at position index, as a truthy or falsy Choice. Returns the falsy value for indices out of range.
Source§

fn set_bit(&mut self, index: u32, bit_value: Choice)

Sets the bit at index to 0 or 1 depending on the value of bit_value.
Source§

fn trailing_zeros(&self) -> u32

Calculate the number of trailing zeros in the binary representation of this number.
Source§

fn trailing_ones(&self) -> u32

Calculate the number of trailing ones in the binary representation of this number.
Source§

fn bit_vartime(&self, index: u32) -> bool

Returns true if the bit at position index is set, false otherwise. Read more
Source§

fn bits_vartime(&self) -> u32

Calculate the number of bits required to represent a given number in variable-time with respect to self.
Source§

fn set_bit_vartime(&mut self, index: u32, bit_value: bool)

Sets the bit at index to 0 or 1 depending on the value of bit_value, variable time in self.
Source§

fn trailing_zeros_vartime(&self) -> u32

Calculate the number of trailing zeros in the binary representation of this number in variable-time with respect to self.
Source§

fn trailing_ones_vartime(&self) -> u32

Calculate the number of trailing ones in the binary representation of this number, variable time in self.
Source§

fn log2_bits(&self) -> u32

floor(log2(self.bits_precision())).
Source§

fn bits(&self) -> u32

Calculate the number of bits required to represent a given number.
Source§

fn leading_zeros_vartime(&self) -> u32

Calculate the number of leading zeros in the binary representation of this number.
Source§

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

Source§

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>

Source§

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>

Source§

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 for Uint<LIMBS>

Source§

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 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>

Source§

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>

Source§

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>

Source§

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 for Uint<LIMBS>

Source§

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 for Uint<LIMBS>

Source§

fn bitxor_assign(&mut self, other: Self)

Performs the ^= operation. Read more
Source§

impl<const LIMBS: usize> Bounded for Uint<LIMBS>

Source§

const BITS: u32 = Self::BITS

Size of this integer in bits.
Source§

const BYTES: usize = Self::BYTES

Size of this integer in bytes.
Source§

impl<const LIMBS: usize> CheckedAdd for Uint<LIMBS>

Source§

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

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

impl<const LIMBS: usize, const RHS_LIMBS: usize> CheckedDiv<Uint<RHS_LIMBS>> for Uint<LIMBS>

Source§

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

Perform checked division, returning a CtOption which is_some only if the divisor is non-zero.
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> CheckedMul<Uint<RHS_LIMBS>> for Int<LIMBS>

Source§

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

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

impl<const LIMBS: usize, const RHS_LIMBS: usize> CheckedMul<Uint<RHS_LIMBS>> for Uint<LIMBS>

Source§

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

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

impl<const LIMBS: usize> CheckedSquareRoot for Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

Output of the square root operation.
Source§

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

Computes sqrt(self), returning none if no root exists.
Source§

fn checked_sqrt_vartime(&self) -> Option<Self>

Computes sqrt(self), returning none if no root exists. Read more
Source§

impl<const LIMBS: usize> CheckedSub for Uint<LIMBS>

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 duplicate 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<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Available on crate feature extra-sizes only.
Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>

Source§

type Output = Uint<{ nlimbs($bits) }>

Concatenated output: having the width of Self plus HI.
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize, const WIDE_LIMBS: usize> ConcatenatingMul<&Uint<RHS_LIMBS>> for Uint<LIMBS>
where Self: Concat<RHS_LIMBS, Output = Uint<WIDE_LIMBS>>,

Source§

type Output = Uint<WIDE_LIMBS>

Output of the widening multiplication.
Source§

fn concatenating_mul(&self, rhs: &Uint<RHS_LIMBS>) -> Self::Output

Perform widening multiplication.
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize, const WIDE_LIMBS: usize> ConcatenatingMul<Uint<RHS_LIMBS>> for Uint<LIMBS>
where Self: Concat<RHS_LIMBS, Output = Uint<WIDE_LIMBS>>,

Source§

type Output = Uint<WIDE_LIMBS>

Output of the widening multiplication.
Source§

fn concatenating_mul(&self, rhs: Uint<RHS_LIMBS>) -> Self::Output

Perform widening multiplication.
Source§

impl<const LIMBS: usize, const WIDE_LIMBS: usize> ConcatenatingSquare for Uint<LIMBS>
where Self: Concat<LIMBS, Output = Uint<WIDE_LIMBS>>,

Source§

type Output = Uint<WIDE_LIMBS>

Output of the widening multiplication.
Source§

fn concatenating_square(&self) -> Self::Output

Perform widening squaring.
Source§

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

Available on crate feature subtle only.
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> ConstOne for Uint<LIMBS>

Source§

const ONE: Self = Self::ONE

The multiplicative identity element of Self, 1.
Source§

impl<const LIMBS: usize> ConstZero for Uint<LIMBS>

Source§

const ZERO: Self = Self::ZERO

The additive identity element of Self, 0.
Source§

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

Available on crate feature subtle only.
Source§

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

Determine if two items are equal. Read more
Source§

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

Determine if two items are NOT equal. Read more
Source§

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

Available on crate feature subtle only.
Source§

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

Determine whether self > other. Read more
Source§

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

Available on crate feature subtle only.
Source§

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

Determine whether self < other. Read more
Source§

impl<const LIMBS: usize> Constants for Uint<LIMBS>

Source§

const MAX: Self = Self::MAX

Maximum value this integer can express.
Source§

impl<const LIMBS: usize> CtAssign for Uint<LIMBS>

Source§

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

Conditionally assign src to self if choice is Choice::TRUE.
Source§

impl<const LIMBS: usize> CtAssignSlice for Uint<LIMBS>

Source§

fn ct_assign_slice(dst: &mut [Self], src: &[Self], choice: Choice)

Conditionally assign src to dst if choice is Choice::TRUE, or leave it unchanged for Choice::FALSE.
Source§

impl<const LIMBS: usize, Rhs: AsRef<UintRef> + ?Sized> CtEq<Rhs> for Uint<LIMBS>

Source§

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

Determine if self is equal to other in constant-time.
Source§

fn ct_ne(&self, other: &Rhs) -> Choice

Determine if self is NOT equal to other in constant-time.
Source§

impl<const LIMBS: usize> CtEqSlice for Uint<LIMBS>

Source§

fn ct_eq_slice(a: &[Self], b: &[Self]) -> Choice

Determine if a is equal to b in constant-time.
Source§

fn ct_ne_slice(a: &[Self], b: &[Self]) -> Choice

Determine if a is NOT equal to b in constant-time.
Source§

impl<const LIMBS: usize> CtGt for Uint<LIMBS>

Source§

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

Compute whether self > other in constant time.
Source§

impl<const LIMBS: usize> CtLt for Uint<LIMBS>

Source§

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

Compute whether self < other in constant time.
Source§

impl<const LIMBS: usize> CtSelect for Uint<LIMBS>

Source§

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

Select between self and other based on choice, returning a copy of the value. Read more
Source§

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

Conditionally swap self and other if choice is Choice::TRUE.
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> Decodable for Uint<LIMBS>
where Self: Encoding, <Self as Encoding>::Repr: Default,

Available on crate feature rlp only.
Source§

fn decode(rlp: &Rlp<'_>) -> Result<Self, DecoderError>

Decode a value from RLP bytes
Source§

impl<'a, const LIMBS: usize> DecodeValue<'a> for Uint<LIMBS>
where Uint<LIMBS>: ArrayEncoding,

Available on crate features der and hybrid-array only.
Source§

type Error = Error

Type returned in the event of a decoding error.
Source§

fn decode_value<R: Reader<'a>>(reader: &mut R, header: Header) -> Result<Self>

Attempt to decode this value using the provided Reader. 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<'de, const LIMBS: usize> Deserialize<'de> for Uint<LIMBS>
where Uint<LIMBS>: Encoding,

Available on crate feature serde only.
Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. 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<Limb>> for &Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

The resulting type after applying the / operator.
Source§

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

Performs the / operation. Read more
Source§

impl<const LIMBS: usize> Div<&NonZero<Limb>> for Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

The resulting type after applying the / operator.
Source§

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

Performs the / operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<&NonZero<Uint<RHS_LIMBS>>> for &Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<&NonZero<Uint<RHS_LIMBS>>> for Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const LIMBS: usize> Div<NonZero<Limb>> for &Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

The resulting type after applying the / operator.
Source§

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

Performs the / operation. Read more
Source§

impl<const LIMBS: usize> Div<NonZero<Limb>> for Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

The resulting type after applying the / operator.
Source§

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

Performs the / operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<NonZero<Uint<RHS_LIMBS>>> for &Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<NonZero<Uint<RHS_LIMBS>>> for Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<Uint<RHS_LIMBS>> for &Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Uint<RHS_LIMBS>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<Uint<RHS_LIMBS>> for Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Uint<RHS_LIMBS>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const LIMBS: usize> DivAssign<&NonZero<Limb>> for Uint<LIMBS>

Source§

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

Performs the /= operation. Read more
Source§

impl<const LIMBS: usize> DivAssign<&NonZero<Uint<LIMBS>>> for Uint<LIMBS>

Source§

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

Performs the /= operation. Read more
Source§

impl<const LIMBS: usize> DivAssign<NonZero<Limb>> for Uint<LIMBS>

Source§

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

Performs the /= operation. Read more
Source§

impl<const LIMBS: usize> DivAssign<NonZero<Uint<LIMBS>>> for Uint<LIMBS>

Source§

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

Performs the /= operation. Read more
Source§

impl<const LIMBS: usize> DivRemLimb for Uint<LIMBS>

Source§

fn div_rem_limb_with_reciprocal(&self, reciprocal: &Reciprocal) -> (Self, Limb)

Computes self / rhs, returns the quotient (q) and remainder (r).
Source§

fn div_rem_limb(&self, rhs: NonZero<Limb>) -> (Self, Limb)

Computes self / rhs using a pre-made reciprocal, returns the quotient (q) and remainder (r).
Source§

impl<const LIMBS: usize> DivVartime for Uint<LIMBS>

Source§

fn div_vartime(&self, rhs: &NonZero<Uint<LIMBS>>) -> Self

Computes self / rhs in variable time.
Source§

impl<const LIMBS: usize> Encodable for Uint<LIMBS>
where Self: Encoding,

Available on crate feature rlp only.
Source§

fn rlp_append(&self, stream: &mut RlpStream)

Append a value to the stream
Source§

fn rlp_bytes(&self) -> BytesMut

Get rlp-encoded bytes for this instance
Source§

impl<const LIMBS: usize> EncodeValue for Uint<LIMBS>
where Uint<LIMBS>: ArrayEncoding,

Available on crate features der and hybrid-array only.
Source§

fn value_len(&self) -> Result<Length>

Compute the length of this value (sans [Tag]+Length header) when encoded as ASN.1 DER. Read more
Source§

fn encode_value(&self, encoder: &mut impl Writer) -> Result<()>

Encode value (sans [Tag]+Length header) as ASN.1 DER using the provided Writer. Read more
Source§

fn header(&self) -> Result<Header, Error>
where Self: Tagged,

Get the Header used to encode this value. Read more
Source§

impl<const LIMBS: usize> Encoding for Uint<LIMBS>

Source§

type Repr = EncodedUint<LIMBS>

Byte array representation.
Source§

fn from_be_bytes(bytes: Self::Repr) -> Self

Decode from big endian bytes.
Source§

fn from_le_bytes(bytes: Self::Repr) -> Self

Decode from little endian bytes.
Source§

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

Encode to big endian bytes.
Source§

fn to_le_bytes(&self) -> Self::Repr

Encode to little endian bytes.
Source§

impl<const LIMBS: usize> FixedInteger for Uint<LIMBS>

Source§

const LIMBS: usize = LIMBS

The number of limbs used on this platform.
Source§

impl<const LIMBS: usize> FixedTag for Uint<LIMBS>
where Uint<LIMBS>: ArrayEncoding,

Available on crate features der and hybrid-array only.
Source§

const TAG: Tag = Tag::Integer

ASN.1 tag
Source§

impl<const LIMBS: usize> FloorSquareRoot for Uint<LIMBS>

Source§

fn floor_sqrt(&self) -> Self

Computes floor(sqrt(self)).
Source§

fn floor_sqrt_vartime(&self) -> Self

Computes floor(sqrt(self)). Read more
Source§

impl<const LO_LIMBS: usize, const HI_LIMBS: usize, const WIDE_LIMBS: usize> From<&(Uint<LO_LIMBS>, Uint<HI_LIMBS>)> for Uint<WIDE_LIMBS>
where Uint<LO_LIMBS>: Concat<HI_LIMBS, Output = Uint<WIDE_LIMBS>>,

Source§

fn from(nums: &(Uint<LO_LIMBS>, Uint<HI_LIMBS>)) -> Uint<WIDE_LIMBS>

Converts to this type from the input type.
Source§

impl<const LIMBS: usize> From<&Uint<LIMBS>> for BoxedUint

Available on crate feature alloc only.
Source§

fn from(uint: &Uint<LIMBS>) -> BoxedUint

Converts to this type from the input type.
Source§

impl<const LIMBS: usize, const LIMBS2: usize> From<&Uint<LIMBS>> for Uint<LIMBS2>

Source§

fn from(num: &Uint<LIMBS>) -> Uint<LIMBS2>

Converts to this type from the input type.
Source§

impl<const LO_LIMBS: usize, const HI_LIMBS: usize, const WIDE_LIMBS: usize> From<&Uint<WIDE_LIMBS>> for (Uint<LO_LIMBS>, Uint<HI_LIMBS>)
where Uint<WIDE_LIMBS>: Split<LO_LIMBS, Output = Uint<HI_LIMBS>>,

Source§

fn from(num: &Uint<WIDE_LIMBS>) -> (Uint<LO_LIMBS>, Uint<HI_LIMBS>)

Converts to this type from the input type.
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<const LO_LIMBS: usize, const HI_LIMBS: usize, const WIDE_LIMBS: usize> From<(Uint<LO_LIMBS>, Uint<HI_LIMBS>)> for Uint<WIDE_LIMBS>
where Uint<LO_LIMBS>: Concat<HI_LIMBS, Output = Uint<WIDE_LIMBS>>,

Source§

fn from(nums: (Uint<LO_LIMBS>, Uint<HI_LIMBS>)) -> Uint<WIDE_LIMBS>

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 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<Uint<LIMBS>> for BoxedUint

Available on crate feature alloc only.
Source§

fn from(uint: Uint<LIMBS>) -> BoxedUint

Converts to this type from the input type.
Source§

impl<const LO_LIMBS: usize, const HI_LIMBS: usize, const WIDE_LIMBS: usize> From<Uint<WIDE_LIMBS>> for (Uint<LO_LIMBS>, Uint<HI_LIMBS>)
where Uint<WIDE_LIMBS>: Split<LO_LIMBS, Output = Uint<HI_LIMBS>>,

Source§

fn from(num: Uint<WIDE_LIMBS>) -> (Uint<LO_LIMBS>, Uint<HI_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> Gcd<Int<LIMBS>> for Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

Output type.
Source§

fn gcd(&self, rhs: &Int<LIMBS>) -> Self::Output

Compute the greatest common divisor of self and rhs.
Source§

fn gcd_vartime(&self, rhs: &Int<LIMBS>) -> Self::Output

Compute the greatest common divisor of self and rhs in variable time.
Source§

impl<const LIMBS: usize> Gcd<NonZero<Int<LIMBS>>> for Uint<LIMBS>

Source§

type Output = NonZero<Uint<LIMBS>>

Output type.
Source§

fn gcd(&self, rhs: &NonZeroInt<LIMBS>) -> Self::Output

Compute the greatest common divisor of self and rhs.
Source§

fn gcd_vartime(&self, rhs: &NonZeroInt<LIMBS>) -> Self::Output

Compute the greatest common divisor of self and rhs in variable time.
Source§

impl<const LIMBS: usize> Gcd<NonZero<Uint<LIMBS>>> for Uint<LIMBS>

Source§

type Output = NonZero<Uint<LIMBS>>

Output type.
Source§

fn gcd(&self, rhs: &NonZeroUint<LIMBS>) -> Self::Output

Compute the greatest common divisor of self and rhs.
Source§

fn gcd_vartime(&self, rhs: &NonZeroUint<LIMBS>) -> Self::Output

Compute the greatest common divisor of self and rhs in variable time.
Source§

impl<const LIMBS: usize> Gcd<Odd<Int<LIMBS>>> for Uint<LIMBS>

Source§

type Output = Odd<Uint<LIMBS>>

Output type.
Source§

fn gcd(&self, rhs: &OddInt<LIMBS>) -> Self::Output

Compute the greatest common divisor of self and rhs.
Source§

fn gcd_vartime(&self, rhs: &OddInt<LIMBS>) -> Self::Output

Compute the greatest common divisor of self and rhs in variable time.
Source§

impl<const LIMBS: usize> Gcd<Odd<Uint<LIMBS>>> for Uint<LIMBS>

Source§

type Output = Odd<Uint<LIMBS>>

Output type.
Source§

fn gcd(&self, rhs: &OddUint<LIMBS>) -> Self::Output

Compute the greatest common divisor of self and rhs.
Source§

fn gcd_vartime(&self, rhs: &OddUint<LIMBS>) -> Self::Output

Compute the greatest common divisor of self and rhs in variable time.
Source§

impl<const LIMBS: usize> Gcd<Uint<LIMBS>> for Int<LIMBS>

Source§

type Output = Uint<LIMBS>

Output type.
Source§

fn gcd(&self, rhs: &Uint<LIMBS>) -> Self::Output

Compute the greatest common divisor of self and rhs.
Source§

fn gcd_vartime(&self, rhs: &Uint<LIMBS>) -> Self::Output

Compute the greatest common divisor of self and rhs in variable time.
Source§

impl<const LIMBS: usize> Gcd<Uint<LIMBS>> for NonZeroInt<LIMBS>

Source§

type Output = NonZero<Uint<LIMBS>>

Output type.
Source§

fn gcd(&self, rhs: &Uint<LIMBS>) -> Self::Output

Compute the greatest common divisor of self and rhs.
Source§

fn gcd_vartime(&self, rhs: &Uint<LIMBS>) -> Self::Output

Compute the greatest common divisor of self and rhs in variable time.
Source§

impl<const LIMBS: usize> Gcd<Uint<LIMBS>> for NonZeroUint<LIMBS>

Source§

type Output = NonZero<Uint<LIMBS>>

Output type.
Source§

fn gcd(&self, rhs: &Uint<LIMBS>) -> Self::Output

Compute the greatest common divisor of self and rhs.
Source§

fn gcd_vartime(&self, rhs: &Uint<LIMBS>) -> Self::Output

Compute the greatest common divisor of self and rhs in variable time.
Source§

impl<const LIMBS: usize> Gcd<Uint<LIMBS>> for OddInt<LIMBS>

Source§

type Output = Odd<Uint<LIMBS>>

Output type.
Source§

fn gcd(&self, rhs: &Uint<LIMBS>) -> Self::Output

Compute the greatest common divisor of self and rhs.
Source§

fn gcd_vartime(&self, rhs: &Uint<LIMBS>) -> Self::Output

Compute the greatest common divisor of self and rhs in variable time.
Source§

impl<const LIMBS: usize> Gcd<Uint<LIMBS>> for OddUint<LIMBS>

Source§

type Output = Odd<Uint<LIMBS>>

Output type.
Source§

fn gcd(&self, rhs: &Uint<LIMBS>) -> Self::Output

Compute the greatest common divisor of self and rhs.
Source§

fn gcd_vartime(&self, rhs: &Uint<LIMBS>) -> Self::Output

Compute the greatest common divisor of self and rhs in variable time.
Source§

impl<const LIMBS: usize> Gcd for Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

Output type.
Source§

fn gcd(&self, rhs: &Uint<LIMBS>) -> Self::Output

Compute the greatest common divisor of self and rhs.
Source§

fn gcd_vartime(&self, rhs: &Uint<LIMBS>) -> Self::Output

Compute the greatest common divisor of self and rhs in variable time.
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§

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

Borrow the raw limbs used to represent this integer.
Source§

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

Mutably borrow the raw limbs used to represent this integer.
Source§

fn nlimbs(&self) -> usize

Number of limbs in this integer.
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> InvertMod for Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

Output type.
Source§

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

Compute 1 / self mod p.
Source§

impl<const LIMBS: usize> LowerHex 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, const RHS_LIMBS: usize> Mul<&Uint<RHS_LIMBS>> for &Int<LIMBS>

Source§

type Output = Int<LIMBS>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Uint<RHS_LIMBS>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Mul<&Uint<RHS_LIMBS>> for &Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Uint<RHS_LIMBS>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Mul<&Uint<RHS_LIMBS>> for Int<LIMBS>

Source§

type Output = Int<LIMBS>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Uint<RHS_LIMBS>) -> Self

Performs the * operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Mul<&Uint<RHS_LIMBS>> for Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Uint<RHS_LIMBS>) -> Self

Performs the * operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Mul<Uint<RHS_LIMBS>> for &Int<LIMBS>

Source§

type Output = Int<LIMBS>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Uint<RHS_LIMBS>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Mul<Uint<RHS_LIMBS>> for &Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Uint<RHS_LIMBS>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Mul<Uint<RHS_LIMBS>> for Int<LIMBS>

Source§

type Output = Int<LIMBS>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Uint<RHS_LIMBS>) -> Self

Performs the * operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Mul<Uint<RHS_LIMBS>> for Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Uint<RHS_LIMBS>) -> Self

Performs the * operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> MulAssign<&Uint<RHS_LIMBS>> for Uint<LIMBS>

Source§

fn mul_assign(&mut self, rhs: &Uint<RHS_LIMBS>)

Performs the *= operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> MulAssign<Uint<RHS_LIMBS>> for Uint<LIMBS>

Source§

fn mul_assign(&mut self, rhs: Uint<RHS_LIMBS>)

Performs the *= operation. Read more
Source§

impl<const LIMBS: usize> MulMod for Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

Output type.
Source§

fn mul_mod(&self, rhs: &Self, p: &NonZero<Self>) -> Self

Compute self * rhs mod p.
Source§

impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize, const RHS_LIMBS: usize> MultiExponentiateBoundedExp<Uint<RHS_LIMBS>, [(ConstMontyForm<MOD, LIMBS>, Uint<RHS_LIMBS>)]> for ConstMontyForm<MOD, LIMBS>

Available on crate feature alloc only.
Source§

fn multi_exponentiate_bounded_exp( bases_and_exponents: &[(Self, Uint<RHS_LIMBS>)], exponent_bits: u32, ) -> Self

Calculates x1 ^ k1 * ... * xn ^ kn.
Source§

impl<const N: usize, MOD: ConstMontyParams<LIMBS>, const LIMBS: usize, const RHS_LIMBS: usize> MultiExponentiateBoundedExp<Uint<RHS_LIMBS>, [(ConstMontyForm<MOD, LIMBS>, Uint<RHS_LIMBS>); N]> for ConstMontyForm<MOD, LIMBS>

Source§

fn multi_exponentiate_bounded_exp( bases_and_exponents: &[(Self, Uint<RHS_LIMBS>); N], exponent_bits: u32, ) -> Self

Calculates x1 ^ k1 * ... * xn ^ kn.
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> MultiExponentiateBoundedExp<Uint<RHS_LIMBS>, [(FixedMontyForm<LIMBS>, Uint<RHS_LIMBS>)]> for FixedMontyForm<LIMBS>

Available on crate feature alloc only.
Source§

fn multi_exponentiate_bounded_exp( bases_and_exponents: &[(Self, Uint<RHS_LIMBS>)], exponent_bits: u32, ) -> Self

Calculates x1 ^ k1 * ... * xn ^ kn.
Source§

impl<const N: usize, const LIMBS: usize, const RHS_LIMBS: usize> MultiExponentiateBoundedExp<Uint<RHS_LIMBS>, [(FixedMontyForm<LIMBS>, Uint<RHS_LIMBS>); N]> for FixedMontyForm<LIMBS>

Source§

fn multi_exponentiate_bounded_exp( bases_and_exponents: &[(Self, Uint<RHS_LIMBS>); N], exponent_bits: u32, ) -> Self

Calculates x1 ^ k1 * ... * xn ^ kn.
Source§

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

Source§

type Output = Uint<LIMBS>

Output type.
Source§

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

Compute -self mod p.
Source§

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

Source§

type Output = Uint<LIMBS>

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self

Performs the unary ! operation. Read more
Source§

impl<const LIMBS: usize> Num for Uint<LIMBS>

Source§

fn from_str_radix(str: &str, radix: u32) -> Result<Self, Self::FromStrRadixErr>

WARNING: variable-time!

from_str_radix impl operates in variable-time with respect to the input.

Source§

type FromStrRadixErr = DecodeError

Source§

impl<const LIMBS: usize> One for Uint<LIMBS>

Source§

fn one() -> Self

Returns the multiplicative identity element of Self, 1.
Source§

fn is_one(&self) -> Choice

Determine if this value is equal to 1. Read more
Source§

fn set_one(&mut self)

Set self to its multiplicative identity, i.e. Self::one.
Source§

fn one_like(_other: &Self) -> Self

Return the value 0 with the same precision as other.
Source§

impl<const LIMBS: usize> One for Uint<LIMBS>

Source§

fn one() -> Self

Returns the multiplicative identity element of Self, 1. Read more
Source§

fn is_one(&self) -> bool

Returns true if self is equal to the multiplicative identity. Read more
Source§

fn set_one(&mut self)

Sets self to the multiplicative identity element of Self, 1.
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) -> Self
where Self: Sized,

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

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

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

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

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

impl<const LIMBS: usize> PartialEq<Odd<Uint<LIMBS>>> for Uint<LIMBS>

Source§

fn eq(&self, other: &Odd<Uint<LIMBS>>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

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

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<const LIMBS: usize> PartialOrd<Odd<Uint<LIMBS>>> for Uint<LIMBS>

Source§

fn partial_cmp(&self, other: &Odd<Uint<LIMBS>>) -> 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

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

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

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<const LIMBS: usize> PartialOrd 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

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

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

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> PowBoundedExp<Uint<RHS_LIMBS>> for Checked<Uint<LIMBS>>

Source§

fn pow_bounded_exp( &self, exponent: &Uint<RHS_LIMBS>, exponent_bits: u32, ) -> Self

Raises to the exponent power, with exponent_bits representing the number of (least significant) bits to take into account for the exponent. Read more
Source§

impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize, const RHS_LIMBS: usize> PowBoundedExp<Uint<RHS_LIMBS>> for ConstMontyForm<MOD, LIMBS>

Source§

fn pow_bounded_exp( &self, exponent: &Uint<RHS_LIMBS>, exponent_bits: u32, ) -> Self

Raises to the exponent power, with exponent_bits representing the number of (least significant) bits to take into account for the exponent. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> PowBoundedExp<Uint<RHS_LIMBS>> for FixedMontyForm<LIMBS>

Source§

fn pow_bounded_exp( &self, exponent: &Uint<RHS_LIMBS>, exponent_bits: u32, ) -> Self

Raises to the exponent power, with exponent_bits representing the number of (least significant) bits to take into account for the exponent. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> PowBoundedExp<Uint<RHS_LIMBS>> for Wrapping<Uint<LIMBS>>

Source§

fn pow_bounded_exp( &self, exponent: &Uint<RHS_LIMBS>, exponent_bits: u32, ) -> Self

Raises to the exponent power, with exponent_bits representing the number of (least significant) bits to take into account for the exponent. Read more
Source§

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

Available on crate feature rand_core only.
Source§

fn try_random_from_rng<R: TryRng + ?Sized>( rng: &mut R, ) -> Result<Self, R::Error>

Generate a random value. Read more
Source§

fn random_from_rng<R: Rng + ?Sized>(rng: &mut R) -> Self

Generate a random value. Read more
Source§

fn try_random() -> Result<Self, Error>

Available on crate feature getrandom only.
Randomly generate a value of this type using the system’s ambient cryptographically secure random number generator. Read more
Source§

fn random() -> Self

Available on crate feature getrandom only.
Randomly generate a value of this type using the system’s ambient cryptographically secure random number generator. Read more
Source§

impl<const LIMBS: usize> RandomBits for Uint<LIMBS>

Available on crate feature rand_core only.
Source§

fn try_random_bits<R: TryRng + ?Sized>( rng: &mut R, bit_length: u32, ) -> Result<Self, RandomBitsError<R::Error>>

Generate a random value in range [0, 2^bit_length). Read more
Source§

fn try_random_bits_with_precision<R: TryRng + ?Sized>( rng: &mut R, bit_length: u32, bits_precision: u32, ) -> Result<Self, RandomBitsError<R::Error>>

Generate a random value in range [0, 2^bit_length), returning an integer with the closest available size to bits_precision (if the implementing type supports runtime sizing). Read more
Source§

fn random_bits<R: TryRng + ?Sized>(rng: &mut R, bit_length: u32) -> Self

Generate a random value in range [0, 2^bit_length). Read more
Source§

fn random_bits_with_precision<R: TryRng + ?Sized>( rng: &mut R, bit_length: u32, bits_precision: u32, ) -> Self

Generate a random value in range [0, 2^bit_length), returning an integer with the closest available size to bits_precision (if the implementing type supports runtime sizing). Read more
Source§

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

Available on crate feature rand_core only.
Source§

fn random_mod_vartime<R: Rng + ?Sized>( rng: &mut R, modulus: &NonZero<Self>, ) -> Self

Generate a random number which is less than a given modulus. Read more
Source§

fn try_random_mod_vartime<R: TryRng + ?Sized>( rng: &mut R, modulus: &NonZero<Self>, ) -> Result<Self, R::Error>

Generate a random number which is less than a given modulus. Read more
Source§

fn random_mod<R: Rng + ?Sized>(rng: &mut R, modulus: &NonZero<Self>) -> Self

👎Deprecated since 0.7.0:

please use random_mod_vartime instead

Generate a random number which is less than a given modulus. Read more
Source§

fn try_random_mod<R: TryRng + ?Sized>( rng: &mut R, modulus: &NonZero<Self>, ) -> Result<Self, R::Error>

👎Deprecated since 0.7.0:

please use try_random_mod_vartime instead

Generate a random number which is less than a given modulus. Read more
Source§

impl<const LIMBS: usize, MOD> Reduce<Uint<LIMBS>> for ConstMontyForm<MOD, LIMBS>
where MOD: ConstMontyParams<LIMBS>,

Source§

fn reduce(value: &Uint<LIMBS>) -> Self

Reduces self modulo Modulus.
Source§

impl<const LIMBS: usize> Rem<&NonZero<Limb>> for &Uint<LIMBS>

Source§

type Output = Limb

The resulting type after applying the % operator.
Source§

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

Performs the % operation. Read more
Source§

impl<const LIMBS: usize> Rem<&NonZero<Limb>> for Uint<LIMBS>

Source§

type Output = Limb

The resulting type after applying the % operator.
Source§

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

Performs the % operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<&NonZero<Uint<RHS_LIMBS>>> for &Uint<LIMBS>

Source§

type Output = Uint<RHS_LIMBS>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<&NonZero<Uint<RHS_LIMBS>>> for Uint<LIMBS>

Source§

type Output = Uint<RHS_LIMBS>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const LIMBS: usize> Rem<NonZero<Limb>> for &Uint<LIMBS>

Source§

type Output = Limb

The resulting type after applying the % operator.
Source§

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

Performs the % operation. Read more
Source§

impl<const LIMBS: usize> Rem<NonZero<Limb>> for Uint<LIMBS>

Source§

type Output = Limb

The resulting type after applying the % operator.
Source§

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

Performs the % operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<NonZero<Uint<RHS_LIMBS>>> for &Uint<LIMBS>

Source§

type Output = Uint<RHS_LIMBS>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<NonZero<Uint<RHS_LIMBS>>> for Uint<LIMBS>

Source§

type Output = Uint<RHS_LIMBS>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<Uint<RHS_LIMBS>> for &Uint<LIMBS>

Source§

type Output = Uint<RHS_LIMBS>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: Uint<RHS_LIMBS>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<Uint<RHS_LIMBS>> for Uint<LIMBS>

Source§

type Output = Uint<RHS_LIMBS>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: Uint<RHS_LIMBS>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const LIMBS: usize> RemAssign<&NonZero<Limb>> for Uint<LIMBS>

Source§

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

Performs the %= operation. Read more
Source§

impl<const LIMBS: usize> RemAssign<&NonZero<Uint<LIMBS>>> for Uint<LIMBS>

Source§

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

Performs the %= operation. Read more
Source§

impl<const LIMBS: usize> RemAssign<NonZero<Limb>> for Uint<LIMBS>

Source§

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

Performs the %= operation. Read more
Source§

impl<const LIMBS: usize> RemAssign<NonZero<Uint<LIMBS>>> for Uint<LIMBS>

Source§

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

Performs the %= operation. Read more
Source§

impl<const LIMBS: usize> RemLimb for Uint<LIMBS>

Source§

fn rem_limb_with_reciprocal(&self, reciprocal: &Reciprocal) -> Limb

Computes self % rhs.
Source§

fn rem_limb(&self, rhs: NonZero<Limb>) -> Limb

Computes self % rhs using a pre-made reciprocal.
Source§

impl<const LIMBS: usize, Rhs: Unsigned> RemMixed<Rhs> for Uint<LIMBS>

Source§

fn rem_mixed(&self, reductor: &NonZero<Rhs>) -> Rhs

Calculate the remainder of self by the reductor.
Source§

impl<const LIMBS: usize> Serialize for Uint<LIMBS>
where Uint<LIMBS>: Encoding,

Available on crate feature serde only.
Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<const LIMBS: usize> Shl<i32> for &Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

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

fn shl(self, shift: i32) -> Uint<LIMBS>

Performs the << operation. Read more
Source§

impl<const LIMBS: usize> Shl<i32> for Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

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

fn shl(self, shift: i32) -> Uint<LIMBS>

Performs the << operation. Read more
Source§

impl<const LIMBS: usize> Shl<u32> for &Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

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

fn shl(self, shift: u32) -> Uint<LIMBS>

Performs the << operation. Read more
Source§

impl<const LIMBS: usize> Shl<u32> for Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

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

fn shl(self, shift: u32) -> Uint<LIMBS>

Performs the << operation. Read more
Source§

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

Source§

type Output = Uint<LIMBS>

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

fn shl(self, shift: usize) -> Uint<LIMBS>

Performs the << operation. Read more
Source§

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

Source§

type Output = Uint<LIMBS>

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

fn shl(self, shift: usize) -> Uint<LIMBS>

Performs the << operation. Read more
Source§

impl<const LIMBS: usize> ShlAssign<i32> for Uint<LIMBS>

Source§

fn shl_assign(&mut self, shift: i32)

Performs the <<= operation. Read more
Source§

impl<const LIMBS: usize> ShlAssign<u32> for Uint<LIMBS>

Source§

fn shl_assign(&mut self, shift: u32)

Performs the <<= operation. Read more
Source§

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

Source§

fn shl_assign(&mut self, shift: usize)

Performs the <<= operation. Read more
Source§

impl<const LIMBS: usize> ShlVartime for Uint<LIMBS>

Source§

fn overflowing_shl_vartime(&self, shift: u32) -> Option<Self>

Computes self << shift. Read more
Source§

fn unbounded_shl_vartime(&self, shift: u32) -> Self

Computes self << shift. Read more
Source§

fn wrapping_shl_vartime(&self, shift: u32) -> Self

Computes self << shift in a panic-free manner, masking off bits of shift which would cause the shift to exceed the type’s width.
Source§

impl<const LIMBS: usize> Shr<i32> for &Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

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

fn shr(self, shift: i32) -> Uint<LIMBS>

Performs the >> operation. Read more
Source§

impl<const LIMBS: usize> Shr<i32> for Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

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

fn shr(self, shift: i32) -> Uint<LIMBS>

Performs the >> operation. Read more
Source§

impl<const LIMBS: usize> Shr<u32> for &Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

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

fn shr(self, shift: u32) -> Uint<LIMBS>

Performs the >> operation. Read more
Source§

impl<const LIMBS: usize> Shr<u32> for Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

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

fn shr(self, shift: u32) -> Uint<LIMBS>

Performs the >> operation. Read more
Source§

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

Source§

type Output = Uint<LIMBS>

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

fn shr(self, shift: usize) -> Uint<LIMBS>

Performs the >> operation. Read more
Source§

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

Source§

type Output = Uint<LIMBS>

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

fn shr(self, shift: usize) -> Uint<LIMBS>

Performs the >> operation. Read more
Source§

impl<const LIMBS: usize> ShrAssign<i32> for Uint<LIMBS>

Source§

fn shr_assign(&mut self, shift: i32)

Performs the >>= operation. Read more
Source§

impl<const LIMBS: usize> ShrAssign<u32> for Uint<LIMBS>

Source§

fn shr_assign(&mut self, shift: u32)

Performs the >>= operation. Read more
Source§

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

Source§

fn shr_assign(&mut self, shift: usize)

Performs the >>= operation. Read more
Source§

impl<const LIMBS: usize> ShrVartime for Uint<LIMBS>

Source§

fn overflowing_shr_vartime(&self, shift: u32) -> Option<Self>

Computes self >> shift. Read more
Source§

fn unbounded_shr_vartime(&self, shift: u32) -> Self

Computes self >> shift. Read more
Source§

fn wrapping_shr_vartime(&self, shift: u32) -> Self

Computes self >> shift in a panic-free manner, masking off bits of shift which would cause the shift to exceed the type’s width.
Source§

impl<const LIMBS: usize> SquareMod for Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

Output type.
Source§

fn square_mod(&self, p: &NonZero<Self>) -> Self

Compute self * self mod p.
Source§

impl<const LIMBS: usize> Sub<&Uint<LIMBS>> for Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Self) -> Self

Performs the - operation. Read more
Source§

impl<const LIMBS: usize> Sub for Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self

Performs the - operation. Read more
Source§

impl<const LIMBS: usize> SubAssign<&Uint<LIMBS>> for Uint<LIMBS>

Source§

fn sub_assign(&mut self, rhs: &Uint<LIMBS>)

Performs the -= operation. Read more
Source§

impl<const LIMBS: usize> SubAssign for Uint<LIMBS>

Source§

fn sub_assign(&mut self, rhs: Uint<LIMBS>)

Performs the -= operation. Read more
Source§

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

Source§

type Output = Uint<LIMBS>

Output type.
Source§

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

Compute self - rhs mod p. Read more
Source§

impl<'a, const LIMBS: usize> TryFrom<AnyRef<'a>> for Uint<LIMBS>
where Uint<LIMBS>: ArrayEncoding,

Available on crate features der and hybrid-array only.
Source§

type Error = Error

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

fn try_from(any: AnyRef<'a>) -> Result<Uint<LIMBS>>

Performs the conversion.
Source§

impl<'a, const LIMBS: usize> TryFrom<UintRef<'a>> for Uint<LIMBS>
where Uint<LIMBS>: ArrayEncoding,

Available on crate features der and hybrid-array only.
Source§

type Error = Error

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

fn try_from(bytes: Asn1UintRef<'a>) -> Result<Uint<LIMBS>>

Performs the conversion.
Source§

impl<const LIMBS: usize> Unsigned for Uint<LIMBS>

Source§

fn as_uint_ref(&self) -> &UintRef

Borrow the limbs of this unsigned integer as a UintRef.
Source§

fn as_mut_uint_ref(&mut self) -> &mut UintRef

Mutably borrow the limbs of this unsigned integer as a UintRef.
Source§

fn from_limb_like(limb: Limb, _other: &Self) -> Self

Returns an integer with the first limb set to limb, and the same precision as other.
Source§

impl<const LIMBS: usize> UnsignedWithMontyForm for Uint<LIMBS>

Source§

type MontyForm = FixedMontyForm<LIMBS>

The corresponding Montgomery representation, optimized for the performance of modular operations at the price of a conversion overhead.
Source§

impl<const LIMBS: usize> UpperHex 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> WrappingAdd for Uint<LIMBS>

Source§

fn wrapping_add(&self, v: &Self) -> Self

Wrapping (modular) addition. Computes self + other, wrapping around at the boundary of the type.
Source§

impl<const LIMBS: usize> WrappingMul for Uint<LIMBS>

Source§

fn wrapping_mul(&self, v: &Self) -> Self

Wrapping (modular) multiplication. Computes self * other, wrapping around at the boundary of the type.
Source§

impl<const LIMBS: usize> WrappingNeg for Uint<LIMBS>

Source§

fn wrapping_neg(&self) -> Self

Wrapping (modular) negation. Computes -self, wrapping around at the boundary of the type. Read more
Source§

impl<const LIMBS: usize> WrappingShl for Uint<LIMBS>

Source§

fn wrapping_shl(&self, shift: u32) -> Uint<LIMBS>

Panic-free bitwise shift-left; yields self << mask(rhs), where mask removes any high order bits of rhs that would cause the shift to exceed the bitwidth of the type. Read more
Source§

impl<const LIMBS: usize> WrappingShr for Uint<LIMBS>

Source§

fn wrapping_shr(&self, shift: u32) -> Uint<LIMBS>

Panic-free bitwise shift-right; yields self >> mask(rhs), where mask removes any high order bits of rhs that would cause the shift to exceed the bitwidth of the type. Read more
Source§

impl<const LIMBS: usize> WrappingSub for Uint<LIMBS>

Source§

fn wrapping_sub(&self, v: &Self) -> Self

Wrapping (modular) subtraction. Computes self - other, wrapping around at the boundary of the type.
Source§

impl<const LIMBS: usize> Xgcd for Uint<LIMBS>

Source§

type Output = XgcdOutput<LIMBS, Uint<LIMBS>>

Output type.
Source§

fn xgcd(&self, rhs: &Uint<LIMBS>) -> Self::Output

Compute the extended greatest common divisor of self and rhs.
Source§

fn xgcd_vartime(&self, rhs: &Uint<LIMBS>) -> Self::Output

Compute the extended greatest common divisor of self and rhs in variable time.
Source§

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

Source§

fn zero() -> Self

Returns the additive identity element of Self, 0.
Source§

fn is_zero(&self) -> Choice

Determine if this value is equal to 0. Read more
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.
Source§

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

Source§

fn zero() -> Self

Returns the additive identity element of Self, 0. Read more
Source§

fn is_zero(&self) -> bool

Returns true if self is equal to the additive identity.
Source§

fn set_zero(&mut self)

Sets self to the additive identity element of Self, 0.
Source§

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

Source§

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

Available on crate feature zeroize only.
Source§

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

Auto Trait Implementations§

§

impl<const LIMBS: usize> Freeze for Uint<LIMBS>

§

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> UnsafeUnpin for Uint<LIMBS>

§

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

Blanket Implementations§

Source§

impl<T, Rhs> InvMod<Rhs> for T
where T: InvertMod<Rhs>,

Source§

type Output = <T as InvertMod<Rhs>>::Output

👎Deprecated since 0.7.0:

please use InvertMod instead

Output type.
Source§

fn inv_mod(&self, p: &Rhs) -> CtOption<<T as InvMod<Rhs>>::Output>

👎Deprecated since 0.7.0:

please use InvertMod instead

Compute 1 / self mod p.
Source§

impl<T, Rhs> WideningMul<Rhs> for T
where T: ConcatenatingMul<Rhs>,

Source§

type Output = <T as ConcatenatingMul<Rhs>>::Output

👎Deprecated since 0.7.0:

please use ConcatenatingMul instead

Output of the widening multiplication.
Source§

fn widening_mul(&self, rhs: Rhs) -> <T as WideningMul<Rhs>>::Output

👎Deprecated since 0.7.0:

please use ConcatenatingMul instead

Perform widening multiplication.
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<'a, T> Choice<'a> for T
where T: Decode<'a> + FixedTag,

Source§

fn can_decode(tag: Tag) -> bool

Is the provided Tag decodable as a variant of this CHOICE?
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T, const N: usize> CtSelectArray<N> for T

Source§

fn ct_select_array(a: &[T; N], b: &[T; N], choice: Choice) -> [T; N]

Select between a and b in constant-time based on choice.
Source§

impl<'a, T> Decode<'a> for T
where T: DecodeValue<'a> + FixedTag + 'a,

Source§

type Error = <T as DecodeValue<'a>>::Error

Type returned in the event of a decoding error.
Source§

fn decode<R>(reader: &mut R) -> Result<T, <T as DecodeValue<'a>>::Error>
where R: Reader<'a>,

Attempt to decode this TLV message using the provided decoder. Read more
Source§

fn from_der(bytes: &'a [u8]) -> Result<Self, Self::Error>

Parse Self from the provided DER-encoded byte slice. Read more
Source§

fn from_der_partial(bytes: &'a [u8]) -> Result<(Self, &'a [u8]), Self::Error>

Parse Self from the provided DER-encoded byte slice. Read more
Source§

impl<T> Encode for T
where T: EncodeValue + Tagged + ?Sized,

Source§

fn encoded_len(&self) -> Result<Length, Error>

Compute the length of this TLV object in bytes when encoded as ASN.1 DER. Read more
Source§

fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>

Encode this TLV object as ASN.1 DER using the provided Writer. Read more
Source§

fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8], Error>

Encode this TLV object to the provided byte slice, returning a sub-slice containing the encoded message. 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> IsConstructed for T
where T: FixedTag + ?Sized,

Source§

const CONSTRUCTED: bool

ASN.1 constructed bit
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Tagged for T
where T: FixedTag + ?Sized,

Source§

fn tag(&self) -> Tag

Get the ASN.1 tag that this type is encoded with.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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 T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

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

impl<T> ToUnsigned for T
where T: Unsigned,

Source§

type Unsigned = T

The corresponding owned Unsigned type.
Source§

fn to_unsigned(&self) -> <T as ToUnsigned>::Unsigned

Convert from a reference into an owned instance.
Source§

fn to_unsigned_zero(&self) -> <T as ToUnsigned>::Unsigned

Convert from a reference into an owned instance representing zero.
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.
Source§

impl<Z> Zeroize for Z
where 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.
Source§

impl<T> DecodeOwned for T
where T: for<'a> Decode<'a>,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T, Rhs> NumAssignOps<Rhs> for T
where T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,

Source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for T
where T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,