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):
hybrid-array: enablesArrayEncodingtrait which can be used toUintasArray<u8, N>and aArrayDecodingtrait which can be used toArray<u8, N>asUint.rlp: support for Recursive Length Prefix (RLP) encoding.
Implementations§
Source§impl<const LIMBS: usize> Uint<LIMBS>
impl<const LIMBS: usize> Uint<LIMBS>
Sourcepub const fn adc(&self, rhs: &Self, carry: Limb) -> (Self, Limb)
👎Deprecated since 0.7.0: please use carrying_add instead
pub const fn adc(&self, rhs: &Self, carry: Limb) -> (Self, Limb)
please use carrying_add instead
Computes self + rhs + carry, returning the result along with the new carry.
Sourcepub const fn carrying_add(&self, rhs: &Self, carry: Limb) -> (Self, Limb)
pub const fn carrying_add(&self, rhs: &Self, carry: Limb) -> (Self, Limb)
Computes self + rhs + carry, returning the result along with the new carry.
Sourcepub const fn saturating_add(&self, rhs: &Self) -> Self
pub const fn saturating_add(&self, rhs: &Self) -> Self
Perform saturating addition, returning MAX on overflow.
Sourcepub const fn wrapping_add(&self, rhs: &Self) -> Self
pub const fn wrapping_add(&self, rhs: &Self) -> Self
Perform wrapping addition, discarding overflow.
Source§impl<const LIMBS: usize> Uint<LIMBS>
impl<const LIMBS: usize> Uint<LIMBS>
Sourcepub const fn add_mod(&self, rhs: &Self, p: &NonZero<Self>) -> Self
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.
Sourcepub const fn add_mod_special(&self, rhs: &Self, c: Limb) -> Self
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.
Sourcepub const fn double_mod(&self, p: &NonZero<Self>) -> Self
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>
impl<const LIMBS: usize> Uint<LIMBS>
Sourcepub const fn bitand_limb(&self, rhs: Limb) -> Self
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.
Sourcepub const fn wrapping_and(&self, rhs: &Self) -> Self
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
Sourcepub const fn checked_and(&self, rhs: &Self) -> CtOption<Self>
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>
impl<const LIMBS: usize> Uint<LIMBS>
Sourcepub const fn wrapping_or(&self, rhs: &Self) -> Self
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
Sourcepub const fn checked_or(&self, rhs: &Self) -> CtOption<Self>
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>
impl<const LIMBS: usize> Uint<LIMBS>
Sourcepub const fn wrapping_xor(&self, rhs: &Self) -> Self
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
Sourcepub const fn checked_xor(&self, rhs: &Self) -> CtOption<Self>
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>
impl<const LIMBS: usize> Uint<LIMBS>
Sourcepub const fn bit(&self, index: u32) -> Choice
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.
Sourcepub const fn bit_vartime(&self, index: u32) -> bool
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.
Sourcepub const fn bits_vartime(&self) -> u32
pub const fn bits_vartime(&self) -> u32
Calculate the number of bits needed to represent this number in variable-time with respect
to self.
Sourcepub const fn leading_zeros(&self) -> u32
pub const fn leading_zeros(&self) -> u32
Calculate the number of leading zeros in the binary representation of this number.
Sourcepub const fn leading_zeros_vartime(&self) -> u32
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.
Sourcepub const fn trailing_zeros(&self) -> u32
pub const fn trailing_zeros(&self) -> u32
Calculate the number of trailing zeros in the binary representation of this number.
Sourcepub const fn trailing_zeros_vartime(&self) -> u32
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.
Sourcepub const fn trailing_ones(&self) -> u32
pub const fn trailing_ones(&self) -> u32
Calculate the number of trailing ones in the binary representation of this number.
Sourcepub const fn trailing_ones_vartime(&self) -> u32
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>
impl<const LIMBS: usize> Uint<LIMBS>
Sourcepub const fn is_nonzero(&self) -> Choice
pub const fn is_nonzero(&self) -> Choice
Returns Choice::TRUE if self != 0 or Choice::FALSE otherwise.
Sourcepub const fn is_zero_vartime(&self) -> bool
pub const fn is_zero_vartime(&self) -> bool
Determine in variable time whether the self is zero.
Sourcepub const fn is_odd(&self) -> Choice
pub const fn is_odd(&self) -> Choice
Returns the truthy value if self is odd or the falsy value otherwise.
Sourcepub const fn cmp_vartime(&self, rhs: &Self) -> Ordering
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>
impl<const LIMBS: usize> Uint<LIMBS>
Sourcepub const fn concat<const WIDE_LIMBS: usize>(
&self,
hi: &Self,
) -> Uint<WIDE_LIMBS>
pub const fn concat<const WIDE_LIMBS: usize>( &self, hi: &Self, ) -> 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.
Sourcepub const fn concat_mixed<const HI_LIMBS: usize, const WIDE_LIMBS: usize>(
&self,
hi: &Uint<HI_LIMBS>,
) -> Uint<WIDE_LIMBS>
pub const fn concat_mixed<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.
Sourcepub const fn concat_checked<const HI_LIMBS: usize, const WIDE_LIMBS: usize>(
&self,
hi: &Uint<HI_LIMBS>,
) -> Option<Uint<WIDE_LIMBS>>
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.
Sourcepub const fn concat_resize<const HI_LIMBS: usize, const WIDE_LIMBS: usize>(
&self,
hi: &Uint<HI_LIMBS>,
) -> Uint<WIDE_LIMBS>
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>
impl<const LIMBS: usize> Uint<LIMBS>
Sourcepub const fn div_rem_limb_with_reciprocal(
&self,
reciprocal: &Reciprocal,
) -> (Self, Limb)
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.
Sourcepub const fn div_rem_limb(&self, rhs: NonZero<Limb>) -> (Self, Limb)
pub const fn div_rem_limb(&self, rhs: NonZero<Limb>) -> (Self, Limb)
Computes self / rhs, returning the quotient and remainder.
Sourcepub const fn rem_limb_with_reciprocal(&self, reciprocal: &Reciprocal) -> Limb
pub const fn rem_limb_with_reciprocal(&self, reciprocal: &Reciprocal) -> Limb
Computes self % rhs using a pre-made reciprocal.
Sourcepub const fn rem_limb(&self, rhs: NonZero<Limb>) -> Limb
pub const fn rem_limb(&self, rhs: NonZero<Limb>) -> Limb
Computes self % rhs for a Limb-sized divisor.
Sourcepub const fn div_rem<const RHS_LIMBS: usize>(
&self,
rhs: &NonZero<Uint<RHS_LIMBS>>,
) -> (Self, Uint<RHS_LIMBS>)
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.
Sourcepub const fn div_rem_vartime<const RHS_LIMBS: usize>(
&self,
rhs: &NonZero<Uint<RHS_LIMBS>>,
) -> (Self, Uint<RHS_LIMBS>)
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.
Sourcepub const fn rem<const RHS_LIMBS: usize>(
&self,
rhs: &NonZero<Uint<RHS_LIMBS>>,
) -> Uint<RHS_LIMBS>
pub const fn rem<const RHS_LIMBS: usize>( &self, rhs: &NonZero<Uint<RHS_LIMBS>>, ) -> Uint<RHS_LIMBS>
Computes self % rhs.
Sourcepub const fn rem_vartime<const RHS_LIMBS: usize>(
&self,
rhs: &NonZero<Uint<RHS_LIMBS>>,
) -> Uint<RHS_LIMBS>
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.
Sourcepub const fn rem_wide(lower_upper: (Self, Self), rhs: &NonZero<Self>) -> Self
pub const fn rem_wide(lower_upper: (Self, Self), rhs: &NonZero<Self>) -> Self
Computes self % rhs for a double-width Uint.
Sourcepub const fn rem_wide_vartime(
lower_upper: (Self, Self),
rhs: &NonZero<Self>,
) -> Self
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.
Sourcepub const fn rem2k_vartime(&self, k: u32) -> Self
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));Sourcepub const fn wrapping_div(&self, rhs: &NonZero<Self>) -> Self
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.
Sourcepub const fn wrapping_div_vartime<const RHS: usize>(
&self,
rhs: &NonZero<Uint<RHS>>,
) -> Self
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.
Sourcepub fn checked_div<const RHS_LIMBS: usize>(
&self,
rhs: &Uint<RHS_LIMBS>,
) -> CtOption<Self>
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");Sourcepub const fn wrapping_rem_vartime(&self, rhs: &Self) -> Self
pub const fn wrapping_rem_vartime(&self, rhs: &Self) -> Self
Sourcepub fn checked_rem<const RHS_LIMBS: usize>(
&self,
rhs: &Uint<RHS_LIMBS>,
) -> CtOption<Uint<RHS_LIMBS>>
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>
impl<const LIMBS: usize> Uint<LIMBS>
Sourcepub const fn from_be_slice(bytes: &[u8]) -> Self
pub const fn from_be_slice(bytes: &[u8]) -> Self
Sourcepub const fn from_be_hex(hex: &str) -> Self
pub const fn from_be_hex(hex: &str) -> Self
Sourcepub const fn from_le_slice(bytes: &[u8]) -> Self
pub const fn from_le_slice(bytes: &[u8]) -> Self
Sourcepub const fn from_le_hex(hex: &str) -> Self
pub const fn from_le_hex(hex: &str) -> Self
Sourcepub fn from_str_radix_vartime(
src: &str,
radix: u32,
) -> Result<Self, DecodeError>
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
- Returns
DecodeError::InputSizeif the size of the decoded integer is larger than this type can represent - Returns
DecodeError::InvalidDigitif the input value contains non-digit characters or digits outside of the range0..radix.
§Panics
- if
radixis not in the range from 2 to 36.
Sourcepub fn to_string_radix_vartime(&self, radix: u32) -> String
Available on crate feature alloc only.
pub fn to_string_radix_vartime(&self, radix: u32) -> String
alloc only.Sourcepub const fn to_be_bytes(&self) -> EncodedUint<LIMBS>
pub const fn to_be_bytes(&self) -> EncodedUint<LIMBS>
Serialize as big endian bytes.
Sourcepub const fn to_le_bytes(&self) -> EncodedUint<LIMBS>
pub const fn to_le_bytes(&self) -> EncodedUint<LIMBS>
Serialize as little endian bytes.
Source§impl<const LIMBS: usize> Uint<LIMBS>
impl<const LIMBS: usize> Uint<LIMBS>
Sourcepub const fn from_wide_word(n: WideWord) -> Self
pub const fn from_wide_word(n: WideWord) -> Self
Create a Uint from a WideWord (const-friendly)
Source§impl<const LIMBS: usize> Uint<LIMBS>
impl<const LIMBS: usize> Uint<LIMBS>
Sourcepub const fn gcd(&self, rhs: &Self) -> Self
pub const fn gcd(&self, rhs: &Self) -> Self
Compute the greatest common divisor of self and rhs.
Sourcepub const fn gcd_vartime(&self, rhs: &Self) -> Self
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§impl<const LIMBS: usize> Uint<LIMBS>
impl<const LIMBS: usize> Uint<LIMBS>
Sourcepub const fn inv_mod2k_vartime(&self, k: u32) -> CtOption<Self>
👎Deprecated since 0.7.0: please use invert_mod2k_vartime instead
pub const fn inv_mod2k_vartime(&self, k: u32) -> CtOption<Self>
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.
Sourcepub const fn invert_mod2k_vartime(&self, k: u32) -> CtOption<Self>
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.
Sourcepub const fn inv_mod2k(&self, k: u32) -> CtOption<Self>
👎Deprecated since 0.7.0: please use invert_mod2k instead
pub const fn inv_mod2k(&self, k: u32) -> CtOption<Self>
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.
Sourcepub const fn invert_mod2k(&self, k: u32) -> CtOption<Self>
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.
Sourcepub const fn inv_odd_mod(&self, modulus: &Odd<Self>) -> CtOption<Self>
👎Deprecated since 0.7.0: please use invert_odd_mod instead
pub const fn inv_odd_mod(&self, modulus: &Odd<Self>) -> CtOption<Self>
please use invert_odd_mod instead
Computes the multiplicative inverse of self mod modulus, where modulus is odd.
Sourcepub const fn invert_odd_mod(&self, modulus: &Odd<Self>) -> CtOption<Self>
pub const fn invert_odd_mod(&self, modulus: &Odd<Self>) -> CtOption<Self>
Computes the multiplicative inverse of self mod modulus, where modulus is odd.
Sourcepub const fn invert_odd_mod_vartime(
&self,
modulus: &Odd<Self>,
) -> CtOption<Self>
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.
Sourcepub const fn inv_mod(&self, modulus: &Self) -> CtOption<Self>
👎Deprecated since 0.7.0: please use invert_mod instead
pub const fn inv_mod(&self, modulus: &Self) -> CtOption<Self>
please use invert_mod instead
Computes the multiplicative inverse of self mod modulus.
Returns some if an inverse exists, otherwise none.
Sourcepub const fn invert_mod(&self, modulus: &NonZero<Self>) -> CtOption<Self>
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>
impl<const LIMBS: usize> Uint<LIMBS>
Sourcepub const fn jacobi_symbol<const RHS_LIMBS: usize>(
&self,
rhs: &Odd<Uint<RHS_LIMBS>>,
) -> JacobiSymbol
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.
Sourcepub const fn jacobi_symbol_vartime<const RHS_LIMBS: usize>(
&self,
rhs: &Odd<Uint<RHS_LIMBS>>,
) -> JacobiSymbol
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>
impl<const LIMBS: usize> Uint<LIMBS>
Sourcepub const fn concatenating_mul<const RHS_LIMBS: usize, const WIDE_LIMBS: usize>(
&self,
rhs: &Uint<RHS_LIMBS>,
) -> Uint<WIDE_LIMBS>
pub const fn concatenating_mul<const RHS_LIMBS: usize, const WIDE_LIMBS: usize>( &self, rhs: &Uint<RHS_LIMBS>, ) -> Uint<WIDE_LIMBS>
Multiply self by rhs, returning a concatenated “wide” result.
Sourcepub 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
pub const fn split_mul<const RHS_LIMBS: usize>( &self, rhs: &Uint<RHS_LIMBS>, ) -> (Self, Uint<RHS_LIMBS>)
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.
Sourcepub const fn widening_mul<const RHS_LIMBS: usize>(
&self,
rhs: &Uint<RHS_LIMBS>,
) -> (Self, Uint<RHS_LIMBS>)
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.
Sourcepub const fn wrapping_mul<const RHS_LIMBS: usize>(
&self,
rhs: &Uint<RHS_LIMBS>,
) -> Self
pub const fn wrapping_mul<const RHS_LIMBS: usize>( &self, rhs: &Uint<RHS_LIMBS>, ) -> Self
Perform wrapping multiplication, discarding overflow.
Sourcepub const fn saturating_mul<const RHS_LIMBS: usize>(
&self,
rhs: &Uint<RHS_LIMBS>,
) -> Self
pub const fn saturating_mul<const RHS_LIMBS: usize>( &self, rhs: &Uint<RHS_LIMBS>, ) -> Self
Perform saturating multiplication, returning MAX on overflow.
Source§impl<const LIMBS: usize> Uint<LIMBS>
Squaring operations
impl<const LIMBS: usize> Uint<LIMBS>
Squaring operations
Sourcepub const fn square_wide(&self) -> (Self, Self)
👎Deprecated since 0.7.0: please use widening_square instead
pub const fn square_wide(&self) -> (Self, Self)
please use widening_square instead
Square self, returning a “wide” result in two parts as (lo, hi).
Sourcepub const fn widening_square(&self) -> (Self, Self)
pub const fn widening_square(&self) -> (Self, Self)
Square self, returning a “wide” result in two parts as (lo, hi).
Sourcepub const fn concatenating_square<const WIDE_LIMBS: usize>(
&self,
) -> Uint<WIDE_LIMBS>
pub const fn concatenating_square<const WIDE_LIMBS: usize>( &self, ) -> Uint<WIDE_LIMBS>
Square self, returning a concatenated “wide” result.
Sourcepub const fn checked_square(&self) -> CtOption<Uint<LIMBS>>
pub const fn checked_square(&self) -> CtOption<Uint<LIMBS>>
Square self, checking that the result fits in the original Uint size.
Sourcepub const fn wrapping_square(&self) -> Uint<LIMBS>
pub const fn wrapping_square(&self) -> Uint<LIMBS>
Perform wrapping square, discarding overflow.
Sourcepub const fn saturating_square(&self) -> Self
pub const fn saturating_square(&self) -> Self
Perform saturating squaring, returning MAX on overflow.
Source§impl<const LIMBS: usize> Uint<LIMBS>
impl<const LIMBS: usize> Uint<LIMBS>
Sourcepub fn mul_mod(
&self,
rhs: &Uint<LIMBS>,
p: &NonZero<Uint<LIMBS>>,
) -> Uint<LIMBS>
pub fn mul_mod( &self, rhs: &Uint<LIMBS>, p: &NonZero<Uint<LIMBS>>, ) -> Uint<LIMBS>
Computes self * rhs mod p.
Sourcepub fn mul_mod_vartime(
&self,
rhs: &Uint<LIMBS>,
p: &NonZero<Uint<LIMBS>>,
) -> Uint<LIMBS>
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.
Sourcepub const fn mul_mod_special(&self, rhs: &Self, c: Limb) -> Self
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.
Sourcepub const fn square_mod(&self, p: &NonZero<Uint<LIMBS>>) -> Self
pub const fn square_mod(&self, p: &NonZero<Uint<LIMBS>>) -> Self
Computes self * self mod p.
Sourcepub const fn square_mod_vartime(&self, p: &NonZero<Uint<LIMBS>>) -> Self
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>
impl<const LIMBS: usize> Uint<LIMBS>
Sourcepub const fn widening_mul_signed<const RHS_LIMBS: usize>(
&self,
rhs: &Int<RHS_LIMBS>,
) -> (Uint<LIMBS>, Uint<RHS_LIMBS>, Choice)
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§impl<const LIMBS: usize> Uint<LIMBS>
impl<const LIMBS: usize> Uint<LIMBS>
Sourcepub const fn wrapping_neg(&self) -> Self
pub const fn wrapping_neg(&self) -> Self
Perform wrapping negation.
Sourcepub const fn carrying_neg(&self) -> (Self, Choice)
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.
Sourcepub const fn wrapping_neg_if(&self, negate: Choice) -> Self
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>
impl<const LIMBS: usize> Uint<LIMBS>
Sourcepub const fn checked_pow<const RHS_LIMBS: usize>(
&self,
exp: &Uint<RHS_LIMBS>,
) -> CtOption<Self>
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.
Sourcepub const fn checked_pow_bounded_exp<const RHS_LIMBS: usize>(
&self,
exp: &Uint<RHS_LIMBS>,
exp_bits: u32,
) -> CtOption<Self>
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_bitsexceeds the capacity ofrhs
Sourcepub const fn checked_pow_vartime<const RHS_LIMBS: usize>(
&self,
exp: &Uint<RHS_LIMBS>,
) -> CtOption<Self>
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.
Sourcepub const fn saturating_pow<const RHS_LIMBS: usize>(
&self,
exp: &Uint<RHS_LIMBS>,
) -> Self
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.
Sourcepub const fn saturating_pow_bounded_exp<const RHS_LIMBS: usize>(
&self,
exp: &Uint<RHS_LIMBS>,
exp_bits: u32,
) -> Self
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_bitsexceeds the capacity ofrhs
Sourcepub const fn saturating_pow_vartime<const RHS_LIMBS: usize>(
&self,
exp: &Uint<RHS_LIMBS>,
) -> Self
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.
Sourcepub const fn wrapping_pow<const RHS_LIMBS: usize>(
&self,
exp: &Uint<RHS_LIMBS>,
) -> Self
pub const fn wrapping_pow<const RHS_LIMBS: usize>( &self, exp: &Uint<RHS_LIMBS>, ) -> Self
Computes self^exp, discarding overflow.
Sourcepub const fn wrapping_pow_bounded_exp<const RHS_LIMBS: usize>(
&self,
exp: &Uint<RHS_LIMBS>,
exp_bits: u32,
) -> Self
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_bitsexceeds the capacity ofrhs
Sourcepub const fn wrapping_pow_vartime<const RHS_LIMBS: usize>(
&self,
exp: &Uint<RHS_LIMBS>,
) -> Self
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>
impl<const LIMBS: usize> Uint<LIMBS>
Source§impl<const LIMBS: usize> Uint<LIMBS>
impl<const LIMBS: usize> Uint<LIMBS>
Sourcepub const fn floor_root_vartime(&self, exp: NonZeroU32) -> Self
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.
Sourcepub fn checked_root_vartime(&self, exp: NonZeroU32) -> Option<Self>
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>
impl<const LIMBS: usize> Uint<LIMBS>
Sourcepub const fn shl_vartime(&self, shift: u32) -> Self
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.
Sourcepub const fn overflowing_shl(&self, shift: u32) -> CtOption<Self>
pub const fn overflowing_shl(&self, shift: u32) -> CtOption<Self>
Computes self << shift.
Returns None if shift >= Self::BITS.
Sourcepub const fn overflowing_shl_vartime(&self, shift: u32) -> Option<Self>
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.
Sourcepub const fn overflowing_shl_vartime_wide(
lower_upper: (Self, Self),
shift: u32,
) -> Option<(Self, Self)>
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.
Sourcepub const fn unbounded_shl(&self, shift: u32) -> Self
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.
Sourcepub const fn unbounded_shl_vartime(&self, shift: u32) -> Self
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.
Sourcepub const fn bounded_shl(&self, shift: u32, shift_upper_bound: u32) -> Self
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.
Sourcepub const fn wrapping_shl(&self, shift: u32) -> Self
pub const fn wrapping_shl(&self, shift: u32) -> Self
Computes self << shift in a panic-free manner, reducing shift modulo the type’s width.
Sourcepub const fn wrapping_shl_vartime(&self, shift: u32) -> Self
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>
impl<const LIMBS: usize> Uint<LIMBS>
Sourcepub const fn shr_vartime(&self, shift: u32) -> Self
pub const fn shr_vartime(&self, shift: u32) -> Self
Sourcepub const fn overflowing_shr(&self, shift: u32) -> CtOption<Self>
pub const fn overflowing_shr(&self, shift: u32) -> CtOption<Self>
Computes self >> shift.
Returns None if shift >= Self::BITS.
Sourcepub const fn overflowing_shr_vartime(&self, shift: u32) -> Option<Self>
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.
Sourcepub const fn overflowing_shr_vartime_wide(
lower_upper: (Self, Self),
shift: u32,
) -> Option<(Self, Self)>
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.
Sourcepub const fn bounded_shr(&self, shift: u32, shift_upper_bound: u32) -> Self
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.
Sourcepub const fn unbounded_shr(&self, shift: u32) -> Self
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.
Sourcepub const fn unbounded_shr_vartime(&self, shift: u32) -> Self
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.
Sourcepub const fn wrapping_shr(&self, shift: u32) -> Self
pub const fn wrapping_shr(&self, shift: u32) -> Self
Computes self >> shift in a panic-free manner, reducing shift modulo the type’s width.
Sourcepub const fn wrapping_shr_vartime(&self, shift: u32) -> Self
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>
impl<const LIMBS: usize> Uint<LIMBS>
Sourcepub const fn split<const HALF_LIMBS: usize>(
&self,
) -> (Uint<HALF_LIMBS>, Uint<HALF_LIMBS>)
pub const fn split<const HALF_LIMBS: usize>( &self, ) -> (Uint<HALF_LIMBS>, Uint<HALF_LIMBS>)
Split this number in half into low and high components.
Sourcepub const fn split_mixed<const LO_LIMBS: usize, const HI_LIMBS: usize>(
&self,
) -> (Uint<LO_LIMBS>, Uint<HI_LIMBS>)
pub const fn split_mixed<const LO_LIMBS: usize, const HI_LIMBS: usize>( &self, ) -> (Uint<LO_LIMBS>, Uint<HI_LIMBS>)
Split this number into low and high components respectively.
Sourcepub const fn split_checked<const LO_LIMBS: usize, const HI_LIMBS: usize>(
&self,
) -> Option<(Uint<LO_LIMBS>, Uint<HI_LIMBS>)>
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.
Sourcepub const fn split_resize<const LO_LIMBS: usize, const HI_LIMBS: usize>(
&self,
) -> (Uint<LO_LIMBS>, Uint<HI_LIMBS>)
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>
impl<const LIMBS: usize> Uint<LIMBS>
Sourcepub const fn sqrt(&self) -> Self
👎Deprecated since 0.7.0: please use floor_sqrt instead
pub const fn sqrt(&self) -> Self
please use floor_sqrt instead
Computes floor(√(self)) in constant time.
Callers can check if self is a square by squaring the result.
Sourcepub const fn floor_sqrt(&self) -> Self
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.
Sourcepub const fn sqrt_vartime(&self) -> Self
👎Deprecated since 0.7.0: please use floor_sqrt_vartime instead
pub const fn sqrt_vartime(&self) -> Self
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.
Sourcepub const fn floor_sqrt_vartime(&self) -> Self
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.
Sourcepub const fn wrapping_sqrt(&self) -> Self
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.
Sourcepub const fn wrapping_sqrt_vartime(&self) -> Self
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.
Sourcepub fn checked_sqrt(&self) -> CtOption<Self>
pub fn checked_sqrt(&self) -> CtOption<Self>
Perform checked sqrt, returning a CtOption which is_some
only if the square root is exact.
Sourcepub fn checked_sqrt_vartime(&self) -> Option<Self>
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>
impl<const LIMBS: usize> Uint<LIMBS>
Sourcepub const fn sbb(&self, rhs: &Self, borrow: Limb) -> (Self, Limb)
👎Deprecated since 0.7.0: please use borrowing_sub instead
pub const fn sbb(&self, rhs: &Self, borrow: Limb) -> (Self, Limb)
please use borrowing_sub instead
Computes self - (rhs + borrow), returning the result along with the new borrow.
Sourcepub const fn borrowing_sub(&self, rhs: &Self, borrow: Limb) -> (Self, Limb)
pub const fn borrowing_sub(&self, rhs: &Self, borrow: Limb) -> (Self, Limb)
Computes self - (rhs + borrow), returning the result along with the new borrow.
Sourcepub const fn saturating_sub(&self, rhs: &Self) -> Self
pub const fn saturating_sub(&self, rhs: &Self) -> Self
Perform saturating subtraction, returning ZERO on underflow.
Sourcepub const fn wrapping_sub(&self, rhs: &Self) -> Self
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>
impl<const LIMBS: usize> Uint<LIMBS>
Sourcepub const fn sub_mod(&self, rhs: &Self, p: &NonZero<Self>) -> Self
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).
Sourcepub const fn sub_mod_special(&self, rhs: &Self, c: Limb) -> Self
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>
impl<const LIMBS: usize> Uint<LIMBS>
Sourcepub const fn from_words(arr: [Word; LIMBS]) -> Self
pub const fn from_words(arr: [Word; LIMBS]) -> Self
Sourcepub const fn as_mut_words(&mut self) -> &mut [Word; LIMBS]
pub const fn as_mut_words(&mut self) -> &mut [Word; LIMBS]
Borrow the inner limbs as a mutable array of Words.
Sourcepub const fn as_words_mut(&mut self) -> &mut [Word]
👎Deprecated since 0.7.0: please use as_mut_words instead
pub const fn as_words_mut(&mut self) -> &mut [Word]
please use as_mut_words instead
Borrow the inner limbs as a mutable slice of Words.
Sourcepub const fn as_mut_limbs(&mut self) -> &mut [Limb; LIMBS]
pub const fn as_mut_limbs(&mut self) -> &mut [Limb; LIMBS]
Borrow the limbs of this Uint mutably.
Sourcepub const fn as_limbs_mut(&mut self) -> &mut [Limb]
👎Deprecated since 0.7.0: please use as_mut_limbs instead
pub const fn as_limbs_mut(&mut self) -> &mut [Limb]
please use as_mut_limbs instead
Borrow the limbs of this Uint mutably.
Sourcepub const fn as_uint_ref(&self) -> &UintRef
pub const fn as_uint_ref(&self) -> &UintRef
Sourcepub const fn as_mut_uint_ref(&mut self) -> &mut UintRef
pub const fn as_mut_uint_ref(&mut self) -> &mut UintRef
Sourcepub const fn to_nz(&self) -> CtOption<NonZero<Self>>
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.
Sourcepub const fn to_nz_vartime(&self) -> Option<NonZero<Self>>
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.
Sourcepub const fn to_odd(&self) -> CtOption<Odd<Self>>
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.
Sourcepub const fn as_int(&self) -> &Int<LIMBS>
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.
Sourcepub const fn try_into_int(self) -> CtOption<Int<LIMBS>>
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.
Sourcepub const fn is_zero(&self) -> Choice
pub const fn is_zero(&self) -> Choice
Is this Uint equal to Uint::ZERO?
Trait Implementations§
Source§impl<const LIMBS: usize> AddAssign<&Uint<LIMBS>> for Uint<LIMBS>
impl<const LIMBS: usize> AddAssign<&Uint<LIMBS>> for Uint<LIMBS>
Source§fn add_assign(&mut self, other: &Self)
fn add_assign(&mut self, other: &Self)
+= operation. Read moreSource§impl<const LIMBS: usize> AddAssign for Uint<LIMBS>
impl<const LIMBS: usize> AddAssign for Uint<LIMBS>
Source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
+= operation. Read moreSource§impl<const LIMBS: usize> BitAndAssign<&Uint<LIMBS>> for Uint<LIMBS>
impl<const LIMBS: usize> BitAndAssign<&Uint<LIMBS>> for Uint<LIMBS>
Source§fn bitand_assign(&mut self, other: &Self)
fn bitand_assign(&mut self, other: &Self)
&= operation. Read moreSource§impl<const LIMBS: usize> BitAndAssign for Uint<LIMBS>
impl<const LIMBS: usize> BitAndAssign for Uint<LIMBS>
Source§fn bitand_assign(&mut self, other: Self)
fn bitand_assign(&mut self, other: Self)
&= operation. Read moreSource§impl<const LIMBS: usize> BitOps for Uint<LIMBS>
impl<const LIMBS: usize> BitOps for Uint<LIMBS>
Source§fn bits_precision(&self) -> u32
fn bits_precision(&self) -> u32
Source§fn bytes_precision(&self) -> usize
fn bytes_precision(&self) -> usize
Source§fn leading_zeros(&self) -> u32
fn leading_zeros(&self) -> u32
Source§fn bit(&self, index: u32) -> Choice
fn bit(&self, index: u32) -> Choice
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)
fn set_bit(&mut self, index: u32, bit_value: Choice)
index to 0 or 1 depending on the value of bit_value.Source§fn trailing_zeros(&self) -> u32
fn trailing_zeros(&self) -> u32
Source§fn trailing_ones(&self) -> u32
fn trailing_ones(&self) -> u32
Source§fn bit_vartime(&self, index: u32) -> bool
fn bit_vartime(&self, index: u32) -> bool
Source§fn bits_vartime(&self) -> u32
fn bits_vartime(&self) -> u32
self.Source§fn set_bit_vartime(&mut self, index: u32, bit_value: bool)
fn set_bit_vartime(&mut self, index: u32, bit_value: bool)
index to 0 or 1 depending on the value of bit_value,
variable time in self.Source§fn trailing_zeros_vartime(&self) -> u32
fn trailing_zeros_vartime(&self) -> u32
self.Source§fn trailing_ones_vartime(&self) -> u32
fn trailing_ones_vartime(&self) -> u32
self.Source§fn leading_zeros_vartime(&self) -> u32
fn leading_zeros_vartime(&self) -> u32
Source§impl<const LIMBS: usize> BitOrAssign<&Uint<LIMBS>> for Uint<LIMBS>
impl<const LIMBS: usize> BitOrAssign<&Uint<LIMBS>> for Uint<LIMBS>
Source§fn bitor_assign(&mut self, other: &Self)
fn bitor_assign(&mut self, other: &Self)
|= operation. Read moreSource§impl<const LIMBS: usize> BitOrAssign for Uint<LIMBS>
impl<const LIMBS: usize> BitOrAssign for Uint<LIMBS>
Source§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
|= operation. Read moreSource§impl<const LIMBS: usize> BitXorAssign<&Uint<LIMBS>> for Uint<LIMBS>
impl<const LIMBS: usize> BitXorAssign<&Uint<LIMBS>> for Uint<LIMBS>
Source§fn bitxor_assign(&mut self, other: &Self)
fn bitxor_assign(&mut self, other: &Self)
^= operation. Read moreSource§impl<const LIMBS: usize> BitXorAssign for Uint<LIMBS>
impl<const LIMBS: usize> BitXorAssign for Uint<LIMBS>
Source§fn bitxor_assign(&mut self, other: Self)
fn bitxor_assign(&mut self, other: Self)
^= operation. Read moreSource§impl<const LIMBS: usize> CheckedAdd for Uint<LIMBS>
impl<const LIMBS: usize> CheckedAdd for Uint<LIMBS>
Source§fn checked_add(&self, rhs: &Self) -> CtOption<Self>
fn checked_add(&self, rhs: &Self) -> CtOption<Self>
CtOption which is_some only if the operation
did not overflow.Source§impl<const LIMBS: usize> CheckedSquareRoot for Uint<LIMBS>
impl<const LIMBS: usize> CheckedSquareRoot for Uint<LIMBS>
Source§impl<const LIMBS: usize> CheckedSub for Uint<LIMBS>
impl<const LIMBS: usize> CheckedSub for Uint<LIMBS>
Source§fn checked_sub(&self, rhs: &Self) -> CtOption<Self>
fn checked_sub(&self, rhs: &Self) -> CtOption<Self>
CtOption which is_some
only if the operation did not underflow.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ <$name>::LIMBS / 2 }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>
extra-sizes only.Source§impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>
Available on crate feature extra-sizes only.
impl Concat<{ U64::LIMBS * $size }> for Uint<{ _ }>
extra-sizes only.Source§impl<const LIMBS: usize, const RHS_LIMBS: usize, const WIDE_LIMBS: usize> ConcatenatingMul<&Uint<RHS_LIMBS>> for Uint<LIMBS>
impl<const LIMBS: usize, const RHS_LIMBS: usize, const WIDE_LIMBS: usize> ConcatenatingMul<&Uint<RHS_LIMBS>> for Uint<LIMBS>
Source§impl<const LIMBS: usize, const RHS_LIMBS: usize, const WIDE_LIMBS: usize> ConcatenatingMul<Uint<RHS_LIMBS>> for Uint<LIMBS>
impl<const LIMBS: usize, const RHS_LIMBS: usize, const WIDE_LIMBS: usize> ConcatenatingMul<Uint<RHS_LIMBS>> for Uint<LIMBS>
Source§impl<const LIMBS: usize> ConditionallySelectable for Uint<LIMBS>
Available on crate feature subtle only.
impl<const LIMBS: usize> ConditionallySelectable for Uint<LIMBS>
subtle only.Source§fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
Source§fn conditional_assign(&mut self, other: &Self, choice: Choice)
fn conditional_assign(&mut self, other: &Self, choice: Choice)
Source§fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)
fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)
self and other if choice == 1; otherwise,
reassign both unto themselves. Read moreSource§impl<const LIMBS: usize> ConstantTimeEq for Uint<LIMBS>
Available on crate feature subtle only.
impl<const LIMBS: usize> ConstantTimeEq for Uint<LIMBS>
subtle only.Source§impl<const LIMBS: usize> ConstantTimeGreater for Uint<LIMBS>
Available on crate feature subtle only.
impl<const LIMBS: usize> ConstantTimeGreater for Uint<LIMBS>
subtle only.Source§impl<const LIMBS: usize> ConstantTimeLess for Uint<LIMBS>
Available on crate feature subtle only.
impl<const LIMBS: usize> ConstantTimeLess for Uint<LIMBS>
subtle only.Source§impl<const LIMBS: usize> CtAssign for Uint<LIMBS>
impl<const LIMBS: usize> CtAssign for Uint<LIMBS>
Source§impl<const LIMBS: usize> CtAssignSlice for Uint<LIMBS>
impl<const LIMBS: usize> CtAssignSlice for Uint<LIMBS>
Source§fn ct_assign_slice(dst: &mut [Self], src: &[Self], choice: Choice)
fn ct_assign_slice(dst: &mut [Self], src: &[Self], choice: Choice)
Source§impl<const LIMBS: usize> CtEqSlice for Uint<LIMBS>
impl<const LIMBS: usize> CtEqSlice for Uint<LIMBS>
Source§fn ct_eq_slice(a: &[Self], b: &[Self]) -> Choice
fn ct_eq_slice(a: &[Self], b: &[Self]) -> Choice
a is equal to b in constant-time.Source§fn ct_ne_slice(a: &[Self], b: &[Self]) -> Choice
fn ct_ne_slice(a: &[Self], b: &[Self]) -> Choice
a is NOT equal to b in constant-time.Source§impl<'a, const LIMBS: usize> DecodeValue<'a> for Uint<LIMBS>where
Uint<LIMBS>: ArrayEncoding,
Available on crate features der and hybrid-array only.
impl<'a, const LIMBS: usize> DecodeValue<'a> for Uint<LIMBS>where
Uint<LIMBS>: ArrayEncoding,
der and hybrid-array only.Source§impl<'de, const LIMBS: usize> Deserialize<'de> for Uint<LIMBS>
Available on crate feature serde only.
impl<'de, const LIMBS: usize> Deserialize<'de> for Uint<LIMBS>
serde only.Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<&NonZero<Uint<RHS_LIMBS>>> for &Uint<LIMBS>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<&NonZero<Uint<RHS_LIMBS>>> for &Uint<LIMBS>
Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<&NonZero<Uint<RHS_LIMBS>>> for Uint<LIMBS>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<&NonZero<Uint<RHS_LIMBS>>> for Uint<LIMBS>
Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<NonZero<Uint<RHS_LIMBS>>> for &Uint<LIMBS>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<NonZero<Uint<RHS_LIMBS>>> for &Uint<LIMBS>
Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<NonZero<Uint<RHS_LIMBS>>> for Uint<LIMBS>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<NonZero<Uint<RHS_LIMBS>>> for Uint<LIMBS>
Source§impl<const LIMBS: usize> DivRemLimb for Uint<LIMBS>
impl<const LIMBS: usize> DivRemLimb for Uint<LIMBS>
Source§fn div_rem_limb_with_reciprocal(&self, reciprocal: &Reciprocal) -> (Self, Limb)
fn div_rem_limb_with_reciprocal(&self, reciprocal: &Reciprocal) -> (Self, Limb)
self / rhs, returns the quotient (q) and remainder (r).Source§impl<const LIMBS: usize> DivVartime for Uint<LIMBS>
impl<const LIMBS: usize> DivVartime for Uint<LIMBS>
Source§fn div_vartime(&self, rhs: &NonZero<Uint<LIMBS>>) -> Self
fn div_vartime(&self, rhs: &NonZero<Uint<LIMBS>>) -> Self
self / rhs in variable time.Source§impl<const LIMBS: usize> Encodable for Uint<LIMBS>where
Self: Encoding,
Available on crate feature rlp only.
impl<const LIMBS: usize> Encodable for Uint<LIMBS>where
Self: Encoding,
rlp only.Source§impl<const LIMBS: usize> EncodeValue for Uint<LIMBS>where
Uint<LIMBS>: ArrayEncoding,
Available on crate features der and hybrid-array only.
impl<const LIMBS: usize> EncodeValue for Uint<LIMBS>where
Uint<LIMBS>: ArrayEncoding,
der and hybrid-array only.Source§impl<const LIMBS: usize> Encoding for Uint<LIMBS>
impl<const LIMBS: usize> Encoding for Uint<LIMBS>
Source§type Repr = EncodedUint<LIMBS>
type Repr = EncodedUint<LIMBS>
Source§fn from_be_bytes(bytes: Self::Repr) -> Self
fn from_be_bytes(bytes: Self::Repr) -> Self
Source§fn from_le_bytes(bytes: Self::Repr) -> Self
fn from_le_bytes(bytes: Self::Repr) -> Self
Source§fn to_be_bytes(&self) -> Self::Repr
fn to_be_bytes(&self) -> Self::Repr
Source§fn to_le_bytes(&self) -> Self::Repr
fn to_le_bytes(&self) -> Self::Repr
Source§impl<const LIMBS: usize> FixedInteger for Uint<LIMBS>
impl<const LIMBS: usize> FixedInteger for Uint<LIMBS>
Source§impl<const LIMBS: usize> FixedTag for Uint<LIMBS>where
Uint<LIMBS>: ArrayEncoding,
Available on crate features der and hybrid-array only.
impl<const LIMBS: usize> FixedTag for Uint<LIMBS>where
Uint<LIMBS>: ArrayEncoding,
der and hybrid-array only.Source§impl<const LIMBS: usize> FloorSquareRoot for Uint<LIMBS>
impl<const LIMBS: usize> FloorSquareRoot for Uint<LIMBS>
Source§fn floor_sqrt(&self) -> Self
fn floor_sqrt(&self) -> Self
floor(sqrt(self)).Source§fn floor_sqrt_vartime(&self) -> Self
fn floor_sqrt_vartime(&self) -> Self
floor(sqrt(self)). Read moreSource§impl<const LO_LIMBS: usize, const HI_LIMBS: usize, const WIDE_LIMBS: usize> From<&(Uint<LO_LIMBS>, Uint<HI_LIMBS>)> for Uint<WIDE_LIMBS>
impl<const LO_LIMBS: usize, const HI_LIMBS: usize, const WIDE_LIMBS: usize> From<&(Uint<LO_LIMBS>, Uint<HI_LIMBS>)> for Uint<WIDE_LIMBS>
Source§impl<const LIMBS: usize> From<&Uint<LIMBS>> for BoxedUint
Available on crate feature alloc only.
impl<const LIMBS: usize> From<&Uint<LIMBS>> for BoxedUint
alloc only.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>)
impl<const LO_LIMBS: usize, const HI_LIMBS: usize, const WIDE_LIMBS: usize> From<&Uint<WIDE_LIMBS>> for (Uint<LO_LIMBS>, Uint<HI_LIMBS>)
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>
impl<const LO_LIMBS: usize, const HI_LIMBS: usize, const WIDE_LIMBS: usize> From<(Uint<LO_LIMBS>, Uint<HI_LIMBS>)> for Uint<WIDE_LIMBS>
Source§impl<const LIMBS: usize> From<Uint<LIMBS>> for BoxedUint
Available on crate feature alloc only.
impl<const LIMBS: usize> From<Uint<LIMBS>> for BoxedUint
alloc only.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>)
impl<const LO_LIMBS: usize, const HI_LIMBS: usize, const WIDE_LIMBS: usize> From<Uint<WIDE_LIMBS>> for (Uint<LO_LIMBS>, Uint<HI_LIMBS>)
Source§impl<const LIMBS: usize> Gcd<NonZero<Int<LIMBS>>> for Uint<LIMBS>
impl<const LIMBS: usize> Gcd<NonZero<Int<LIMBS>>> for Uint<LIMBS>
Source§fn gcd(&self, rhs: &NonZeroInt<LIMBS>) -> Self::Output
fn gcd(&self, rhs: &NonZeroInt<LIMBS>) -> Self::Output
self and rhs.Source§fn gcd_vartime(&self, rhs: &NonZeroInt<LIMBS>) -> Self::Output
fn gcd_vartime(&self, rhs: &NonZeroInt<LIMBS>) -> Self::Output
self and rhs in variable time.Source§impl<const LIMBS: usize> Gcd<NonZero<Uint<LIMBS>>> for Uint<LIMBS>
impl<const LIMBS: usize> Gcd<NonZero<Uint<LIMBS>>> for Uint<LIMBS>
Source§fn gcd(&self, rhs: &NonZeroUint<LIMBS>) -> Self::Output
fn gcd(&self, rhs: &NonZeroUint<LIMBS>) -> Self::Output
self and rhs.Source§fn gcd_vartime(&self, rhs: &NonZeroUint<LIMBS>) -> Self::Output
fn gcd_vartime(&self, rhs: &NonZeroUint<LIMBS>) -> Self::Output
self and rhs in variable time.Source§impl<const LIMBS: usize> Integer for Uint<LIMBS>
impl<const LIMBS: usize> Integer for Uint<LIMBS>
Source§fn as_mut_limbs(&mut self) -> &mut [Limb]
fn as_mut_limbs(&mut self) -> &mut [Limb]
Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> MulAssign<&Uint<RHS_LIMBS>> for Uint<LIMBS>
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>)
fn mul_assign(&mut self, rhs: &Uint<RHS_LIMBS>)
*= operation. Read moreSource§impl<const LIMBS: usize, const RHS_LIMBS: usize> MulAssign<Uint<RHS_LIMBS>> for Uint<LIMBS>
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>)
fn mul_assign(&mut self, rhs: Uint<RHS_LIMBS>)
*= operation. Read moreSource§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.
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>
alloc only.Source§fn multi_exponentiate_bounded_exp(
bases_and_exponents: &[(Self, Uint<RHS_LIMBS>)],
exponent_bits: u32,
) -> Self
fn multi_exponentiate_bounded_exp( bases_and_exponents: &[(Self, Uint<RHS_LIMBS>)], exponent_bits: u32, ) -> Self
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>
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§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.
impl<const LIMBS: usize, const RHS_LIMBS: usize> MultiExponentiateBoundedExp<Uint<RHS_LIMBS>, [(FixedMontyForm<LIMBS>, Uint<RHS_LIMBS>)]> for FixedMontyForm<LIMBS>
alloc only.Source§fn multi_exponentiate_bounded_exp(
bases_and_exponents: &[(Self, Uint<RHS_LIMBS>)],
exponent_bits: u32,
) -> Self
fn multi_exponentiate_bounded_exp( bases_and_exponents: &[(Self, Uint<RHS_LIMBS>)], exponent_bits: u32, ) -> Self
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>
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§impl<const LIMBS: usize> Num for Uint<LIMBS>
impl<const LIMBS: usize> Num for Uint<LIMBS>
Source§fn from_str_radix(str: &str, radix: u32) -> Result<Self, Self::FromStrRadixErr>
fn from_str_radix(str: &str, radix: u32) -> Result<Self, Self::FromStrRadixErr>
from_str_radix impl operates in variable-time with respect to the input.
type FromStrRadixErr = DecodeError
Source§impl<const LIMBS: usize> Ord for Uint<LIMBS>
impl<const LIMBS: usize> Ord for Uint<LIMBS>
Source§impl<const LIMBS: usize> PartialOrd<Odd<Uint<LIMBS>>> for Uint<LIMBS>
impl<const LIMBS: usize> PartialOrd<Odd<Uint<LIMBS>>> for Uint<LIMBS>
Source§impl<const LIMBS: usize> PartialOrd for Uint<LIMBS>
impl<const LIMBS: usize> PartialOrd for Uint<LIMBS>
Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> PowBoundedExp<Uint<RHS_LIMBS>> for Checked<Uint<LIMBS>>
impl<const LIMBS: usize, const RHS_LIMBS: usize> PowBoundedExp<Uint<RHS_LIMBS>> for Checked<Uint<LIMBS>>
Source§impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize, const RHS_LIMBS: usize> PowBoundedExp<Uint<RHS_LIMBS>> for ConstMontyForm<MOD, LIMBS>
impl<MOD: ConstMontyParams<LIMBS>, const LIMBS: usize, const RHS_LIMBS: usize> PowBoundedExp<Uint<RHS_LIMBS>> for ConstMontyForm<MOD, LIMBS>
Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> PowBoundedExp<Uint<RHS_LIMBS>> for FixedMontyForm<LIMBS>
impl<const LIMBS: usize, const RHS_LIMBS: usize> PowBoundedExp<Uint<RHS_LIMBS>> for FixedMontyForm<LIMBS>
Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> PowBoundedExp<Uint<RHS_LIMBS>> for Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize, const RHS_LIMBS: usize> PowBoundedExp<Uint<RHS_LIMBS>> for Wrapping<Uint<LIMBS>>
Source§impl<const LIMBS: usize> Random for Uint<LIMBS>
Available on crate feature rand_core only.
impl<const LIMBS: usize> Random for Uint<LIMBS>
rand_core only.Source§fn try_random_from_rng<R: TryRng + ?Sized>(
rng: &mut R,
) -> Result<Self, R::Error>
fn try_random_from_rng<R: TryRng + ?Sized>( rng: &mut R, ) -> Result<Self, R::Error>
Source§impl<const LIMBS: usize> RandomBits for Uint<LIMBS>
Available on crate feature rand_core only.
impl<const LIMBS: usize> RandomBits for Uint<LIMBS>
rand_core only.Source§fn try_random_bits<R: TryRng + ?Sized>(
rng: &mut R,
bit_length: u32,
) -> Result<Self, RandomBitsError<R::Error>>
fn try_random_bits<R: TryRng + ?Sized>( rng: &mut R, bit_length: u32, ) -> Result<Self, RandomBitsError<R::Error>>
[0, 2^bit_length). Read moreSource§fn try_random_bits_with_precision<R: TryRng + ?Sized>(
rng: &mut R,
bit_length: u32,
bits_precision: u32,
) -> Result<Self, RandomBitsError<R::Error>>
fn try_random_bits_with_precision<R: TryRng + ?Sized>( rng: &mut R, bit_length: u32, bits_precision: u32, ) -> Result<Self, RandomBitsError<R::Error>>
[0, 2^bit_length),
returning an integer with the closest available size to bits_precision
(if the implementing type supports runtime sizing). Read moreSource§fn random_bits<R: TryRng + ?Sized>(rng: &mut R, bit_length: u32) -> Self
fn random_bits<R: TryRng + ?Sized>(rng: &mut R, bit_length: u32) -> Self
[0, 2^bit_length). Read moreSource§fn random_bits_with_precision<R: TryRng + ?Sized>(
rng: &mut R,
bit_length: u32,
bits_precision: u32,
) -> Self
fn random_bits_with_precision<R: TryRng + ?Sized>( rng: &mut R, bit_length: u32, bits_precision: u32, ) -> Self
[0, 2^bit_length),
returning an integer with the closest available size to bits_precision
(if the implementing type supports runtime sizing). Read moreSource§impl<const LIMBS: usize> RandomMod for Uint<LIMBS>
Available on crate feature rand_core only.
impl<const LIMBS: usize> RandomMod for Uint<LIMBS>
rand_core only.Source§fn random_mod_vartime<R: Rng + ?Sized>(
rng: &mut R,
modulus: &NonZero<Self>,
) -> Self
fn random_mod_vartime<R: Rng + ?Sized>( rng: &mut R, modulus: &NonZero<Self>, ) -> Self
modulus. Read moreSource§fn try_random_mod_vartime<R: TryRng + ?Sized>(
rng: &mut R,
modulus: &NonZero<Self>,
) -> Result<Self, R::Error>
fn try_random_mod_vartime<R: TryRng + ?Sized>( rng: &mut R, modulus: &NonZero<Self>, ) -> Result<Self, R::Error>
modulus. Read moreSource§impl<const LIMBS: usize, MOD> Reduce<Uint<LIMBS>> for ConstMontyForm<MOD, LIMBS>where
MOD: ConstMontyParams<LIMBS>,
impl<const LIMBS: usize, MOD> Reduce<Uint<LIMBS>> for ConstMontyForm<MOD, LIMBS>where
MOD: ConstMontyParams<LIMBS>,
Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<&NonZero<Uint<RHS_LIMBS>>> for &Uint<LIMBS>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<&NonZero<Uint<RHS_LIMBS>>> for &Uint<LIMBS>
Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<&NonZero<Uint<RHS_LIMBS>>> for Uint<LIMBS>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<&NonZero<Uint<RHS_LIMBS>>> for Uint<LIMBS>
Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<NonZero<Uint<RHS_LIMBS>>> for &Uint<LIMBS>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<NonZero<Uint<RHS_LIMBS>>> for &Uint<LIMBS>
Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<NonZero<Uint<RHS_LIMBS>>> for Uint<LIMBS>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<NonZero<Uint<RHS_LIMBS>>> for Uint<LIMBS>
Source§impl<const LIMBS: usize> ShlAssign<i32> for Uint<LIMBS>
impl<const LIMBS: usize> ShlAssign<i32> for Uint<LIMBS>
Source§fn shl_assign(&mut self, shift: i32)
fn shl_assign(&mut self, shift: i32)
<<= operation. Read moreSource§impl<const LIMBS: usize> ShlAssign<u32> for Uint<LIMBS>
impl<const LIMBS: usize> ShlAssign<u32> for Uint<LIMBS>
Source§fn shl_assign(&mut self, shift: u32)
fn shl_assign(&mut self, shift: u32)
<<= operation. Read moreSource§impl<const LIMBS: usize> ShlAssign<usize> for Uint<LIMBS>
impl<const LIMBS: usize> ShlAssign<usize> for Uint<LIMBS>
Source§fn shl_assign(&mut self, shift: usize)
fn shl_assign(&mut self, shift: usize)
<<= operation. Read moreSource§impl<const LIMBS: usize> ShlVartime for Uint<LIMBS>
impl<const LIMBS: usize> ShlVartime for Uint<LIMBS>
Source§fn overflowing_shl_vartime(&self, shift: u32) -> Option<Self>
fn overflowing_shl_vartime(&self, shift: u32) -> Option<Self>
self << shift. Read moreSource§fn unbounded_shl_vartime(&self, shift: u32) -> Self
fn unbounded_shl_vartime(&self, shift: u32) -> Self
self << shift. Read moreSource§fn wrapping_shl_vartime(&self, shift: u32) -> Self
fn wrapping_shl_vartime(&self, shift: u32) -> Self
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> ShrAssign<i32> for Uint<LIMBS>
impl<const LIMBS: usize> ShrAssign<i32> for Uint<LIMBS>
Source§fn shr_assign(&mut self, shift: i32)
fn shr_assign(&mut self, shift: i32)
>>= operation. Read moreSource§impl<const LIMBS: usize> ShrAssign<u32> for Uint<LIMBS>
impl<const LIMBS: usize> ShrAssign<u32> for Uint<LIMBS>
Source§fn shr_assign(&mut self, shift: u32)
fn shr_assign(&mut self, shift: u32)
>>= operation. Read moreSource§impl<const LIMBS: usize> ShrAssign<usize> for Uint<LIMBS>
impl<const LIMBS: usize> ShrAssign<usize> for Uint<LIMBS>
Source§fn shr_assign(&mut self, shift: usize)
fn shr_assign(&mut self, shift: usize)
>>= operation. Read moreSource§impl<const LIMBS: usize> ShrVartime for Uint<LIMBS>
impl<const LIMBS: usize> ShrVartime for Uint<LIMBS>
Source§fn overflowing_shr_vartime(&self, shift: u32) -> Option<Self>
fn overflowing_shr_vartime(&self, shift: u32) -> Option<Self>
self >> shift. Read moreSource§fn unbounded_shr_vartime(&self, shift: u32) -> Self
fn unbounded_shr_vartime(&self, shift: u32) -> Self
self >> shift. Read moreSource§fn wrapping_shr_vartime(&self, shift: u32) -> Self
fn wrapping_shr_vartime(&self, shift: u32) -> Self
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> SubAssign<&Uint<LIMBS>> for Uint<LIMBS>
impl<const LIMBS: usize> SubAssign<&Uint<LIMBS>> for Uint<LIMBS>
Source§fn sub_assign(&mut self, rhs: &Uint<LIMBS>)
fn sub_assign(&mut self, rhs: &Uint<LIMBS>)
-= operation. Read moreSource§impl<const LIMBS: usize> SubAssign for Uint<LIMBS>
impl<const LIMBS: usize> SubAssign for Uint<LIMBS>
Source§fn sub_assign(&mut self, rhs: Uint<LIMBS>)
fn sub_assign(&mut self, rhs: Uint<LIMBS>)
-= operation. Read moreSource§impl<'a, const LIMBS: usize> TryFrom<AnyRef<'a>> for Uint<LIMBS>where
Uint<LIMBS>: ArrayEncoding,
Available on crate features der and hybrid-array only.
impl<'a, const LIMBS: usize> TryFrom<AnyRef<'a>> for Uint<LIMBS>where
Uint<LIMBS>: ArrayEncoding,
der and hybrid-array only.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.
impl<'a, const LIMBS: usize> TryFrom<UintRef<'a>> for Uint<LIMBS>where
Uint<LIMBS>: ArrayEncoding,
der and hybrid-array only.Source§impl<const LIMBS: usize> Unsigned for Uint<LIMBS>
impl<const LIMBS: usize> Unsigned for Uint<LIMBS>
Source§fn as_uint_ref(&self) -> &UintRef
fn as_uint_ref(&self) -> &UintRef
UintRef.Source§fn as_mut_uint_ref(&mut self) -> &mut UintRef
fn as_mut_uint_ref(&mut self) -> &mut UintRef
UintRef.Source§fn from_limb_like(limb: Limb, _other: &Self) -> Self
fn from_limb_like(limb: Limb, _other: &Self) -> Self
limb, and the same precision as other.Source§impl<const LIMBS: usize> UnsignedWithMontyForm for Uint<LIMBS>
impl<const LIMBS: usize> UnsignedWithMontyForm for Uint<LIMBS>
Source§type MontyForm = FixedMontyForm<LIMBS>
type MontyForm = FixedMontyForm<LIMBS>
Source§impl<const LIMBS: usize> WrappingAdd for Uint<LIMBS>
impl<const LIMBS: usize> WrappingAdd for Uint<LIMBS>
Source§fn wrapping_add(&self, v: &Self) -> Self
fn wrapping_add(&self, v: &Self) -> Self
self + other, wrapping around at the boundary of
the type.Source§impl<const LIMBS: usize> WrappingMul for Uint<LIMBS>
impl<const LIMBS: usize> WrappingMul for Uint<LIMBS>
Source§fn wrapping_mul(&self, v: &Self) -> Self
fn wrapping_mul(&self, v: &Self) -> Self
self * other, wrapping around at the boundary
of the type.Source§impl<const LIMBS: usize> WrappingNeg for Uint<LIMBS>
impl<const LIMBS: usize> WrappingNeg for Uint<LIMBS>
Source§fn wrapping_neg(&self) -> Self
fn wrapping_neg(&self) -> Self
-self,
wrapping around at the boundary of the type. Read moreSource§impl<const LIMBS: usize> WrappingShl for Uint<LIMBS>
impl<const LIMBS: usize> WrappingShl for Uint<LIMBS>
Source§impl<const LIMBS: usize> WrappingShr for Uint<LIMBS>
impl<const LIMBS: usize> WrappingShr for Uint<LIMBS>
Source§impl<const LIMBS: usize> WrappingSub for Uint<LIMBS>
impl<const LIMBS: usize> WrappingSub for Uint<LIMBS>
Source§fn wrapping_sub(&self, v: &Self) -> Self
fn wrapping_sub(&self, v: &Self) -> Self
self - other, wrapping around at the boundary
of the type.Source§impl<const LIMBS: usize> Xgcd for Uint<LIMBS>
impl<const LIMBS: usize> Xgcd for Uint<LIMBS>
impl<const LIMBS: usize> Copy for Uint<LIMBS>
impl<const LIMBS: usize> DefaultIsZeroes for Uint<LIMBS>
zeroize only.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> WideningMul<Rhs> for Twhere
T: ConcatenatingMul<Rhs>,
impl<T, Rhs> WideningMul<Rhs> for Twhere
T: ConcatenatingMul<Rhs>,
Source§type Output = <T as ConcatenatingMul<Rhs>>::Output
type Output = <T as ConcatenatingMul<Rhs>>::Output
please use ConcatenatingMul instead
Source§fn widening_mul(&self, rhs: Rhs) -> <T as WideningMul<Rhs>>::Output
fn widening_mul(&self, rhs: Rhs) -> <T as WideningMul<Rhs>>::Output
please use ConcatenatingMul instead