pub struct NonZero<T: ?Sized>(/* private fields */);Expand description
Wrapper type for non-zero integers.
Implementations§
Source§impl<const LIMBS: usize> NonZero<Int<LIMBS>>
impl<const LIMBS: usize> NonZero<Int<LIMBS>>
Sourcepub const fn gcd_unsigned(&self, rhs: &Uint<LIMBS>) -> NonZero<Uint<LIMBS>>
pub const fn gcd_unsigned(&self, rhs: &Uint<LIMBS>) -> NonZero<Uint<LIMBS>>
Compute the greatest common divisor of self and rhs.
Sourcepub const fn gcd_unsigned_vartime(
&self,
rhs: &Uint<LIMBS>,
) -> NonZeroUint<LIMBS>
pub const fn gcd_unsigned_vartime( &self, rhs: &Uint<LIMBS>, ) -> NonZeroUint<LIMBS>
Compute the greatest common divisor of self and rhs.
Executes in variable time w.r.t. all input parameters.
Sourcepub const fn xgcd(&self, rhs: &Self) -> XgcdOutput<LIMBS, NonZeroUint<LIMBS>>
pub const fn xgcd(&self, rhs: &Self) -> XgcdOutput<LIMBS, NonZeroUint<LIMBS>>
Execute the Extended GCD algorithm.
Given (self, rhs), computes (g, x, y) s.t. self * x + rhs * y = g = gcd(self, rhs).
Source§impl<T> NonZero<T>
impl<T> NonZero<T>
Sourcepub fn from_be_bytes(bytes: T::Repr) -> CtOption<Self>
pub fn from_be_bytes(bytes: T::Repr) -> CtOption<Self>
Decode from big endian bytes.
Sourcepub fn from_le_bytes(bytes: T::Repr) -> CtOption<Self>
pub fn from_le_bytes(bytes: T::Repr) -> CtOption<Self>
Decode from little endian bytes.
Source§impl NonZero<Limb>
impl NonZero<Limb>
Sourcepub const fn new_unwrap(n: Limb) -> Self
pub const fn new_unwrap(n: Limb) -> Self
Sourcepub const fn from_u8(n: NonZeroU8) -> Self
pub const fn from_u8(n: NonZeroU8) -> Self
Create a NonZero<Limb> from a NonZeroU8 (const-friendly)
Sourcepub const fn from_u16(n: NonZeroU16) -> Self
pub const fn from_u16(n: NonZeroU16) -> Self
Create a NonZero<Limb> from a NonZeroU16 (const-friendly)
Sourcepub const fn from_u32(n: NonZeroU32) -> Self
pub const fn from_u32(n: NonZeroU32) -> Self
Create a NonZero<Limb> from a NonZeroU32 (const-friendly)
Sourcepub const fn from_u64(n: NonZeroU64) -> Self
pub const fn from_u64(n: NonZeroU64) -> Self
Create a NonZero<Limb> from a NonZeroU64 (const-friendly)
Source§impl<const LIMBS: usize> NonZero<Uint<LIMBS>>
impl<const LIMBS: usize> NonZero<Uint<LIMBS>>
Sourcepub const fn new_unwrap(n: Uint<LIMBS>) -> Self
pub const fn new_unwrap(n: Uint<LIMBS>) -> Self
Creates a new non-zero integer in a const context.
In future versions of Rust it should be possible to replace this with
NonZero::new(…).unwrap()
§Panics
- if the value is zero.
Sourcepub const fn from_be_hex(hex: &str) -> Self
pub const fn from_be_hex(hex: &str) -> Self
Create a new NonZero<Uint> from the provided big endian hex string.
§Panics
- if the hex is zero, malformed, or not zero-padded accordingly for the size.
Sourcepub const fn from_le_hex(hex: &str) -> Self
pub const fn from_le_hex(hex: &str) -> Self
Create a new NonZero<Uint> from the provided little endian hex string.
§Panics
- if the hex is zero, malformed, or not zero-padded accordingly for the size.
Sourcepub const fn from_u8(n: NonZeroU8) -> Self
pub const fn from_u8(n: NonZeroU8) -> Self
Create a NonZeroUint from a NonZeroU8 (const-friendly)
Sourcepub const fn from_u16(n: NonZeroU16) -> Self
pub const fn from_u16(n: NonZeroU16) -> Self
Create a NonZeroUint from a NonZeroU16 (const-friendly)
Sourcepub const fn from_u32(n: NonZeroU32) -> Self
pub const fn from_u32(n: NonZeroU32) -> Self
Create a NonZeroUint from a NonZeroU32 (const-friendly)
Sourcepub const fn from_u64(n: NonZeroU64) -> Self
pub const fn from_u64(n: NonZeroU64) -> Self
Create a NonZeroUint from a NonZeroU64 (const-friendly)
Sourcepub const fn from_u128(n: NonZeroU128) -> Self
pub const fn from_u128(n: NonZeroU128) -> Self
Create a NonZeroUint from a NonZeroU128 (const-friendly)
Sourcepub const fn as_uint_ref(&self) -> &NonZeroUintRef
pub const fn as_uint_ref(&self) -> &NonZeroUintRef
Borrow this NonZero<Uint> as a &NonZeroUintRef.
Source§impl<const LIMBS: usize> NonZero<Int<LIMBS>>
impl<const LIMBS: usize> NonZero<Int<LIMBS>>
Sourcepub const fn new_unwrap(n: Int<LIMBS>) -> Self
pub const fn new_unwrap(n: Int<LIMBS>) -> Self
Sourcepub const fn abs_sign(&self) -> (NonZero<Uint<LIMBS>>, Choice)
pub const fn abs_sign(&self) -> (NonZero<Uint<LIMBS>>, Choice)
The sign and magnitude of this NonZeroInt.
Sourcepub const fn abs(&self) -> NonZero<Uint<LIMBS>>
pub const fn abs(&self) -> NonZero<Uint<LIMBS>>
The magnitude of this NonZeroInt.
Source§impl NonZero<BoxedUint>
impl NonZero<BoxedUint>
Sourcepub fn as_uint_ref(&self) -> &NonZeroUintRef
Available on crate feature alloc only.
pub fn as_uint_ref(&self) -> &NonZeroUintRef
alloc only.Borrow this NonZeroBoxedUint as a &NonZeroUintRef.
Source§impl<T: ToUnsigned + ?Sized> NonZero<T>
impl<T: ToUnsigned + ?Sized> NonZero<T>
Sourcepub fn to_unsigned(&self) -> NonZero<T::Unsigned>
pub fn to_unsigned(&self) -> NonZero<T::Unsigned>
Convert from a reference into an owned NonZero<T: Unsigned>.
Source§impl<T> NonZero<T>
impl<T> NonZero<T>
Sourcepub fn from_be_byte_array(bytes: ByteArray<T>) -> CtOption<Self>
Available on crate feature hybrid-array only.
pub fn from_be_byte_array(bytes: ByteArray<T>) -> CtOption<Self>
hybrid-array only.Decode a non-zero integer from big endian bytes.
Sourcepub fn from_le_byte_array(bytes: ByteArray<T>) -> CtOption<Self>
Available on crate feature hybrid-array only.
pub fn from_le_byte_array(bytes: ByteArray<T>) -> CtOption<Self>
hybrid-array only.Decode a non-zero integer from little endian bytes.
Source§impl<const LIMBS: usize> NonZero<Uint<LIMBS>>
impl<const LIMBS: usize> NonZero<Uint<LIMBS>>
Sourcepub const fn gcd_unsigned(&self, rhs: &Uint<LIMBS>) -> Self
pub const fn gcd_unsigned(&self, rhs: &Uint<LIMBS>) -> Self
Compute the greatest common divisor of self and rhs.
Sourcepub const fn gcd_unsigned_vartime(&self, rhs: &Uint<LIMBS>) -> Self
pub const fn gcd_unsigned_vartime(&self, rhs: &Uint<LIMBS>) -> Self
Compute the greatest common divisor of self and rhs.
Executes in variable time w.r.t. all input parameters.
Sourcepub const fn xgcd(&self, rhs: &Self) -> XgcdOutput<LIMBS, NonZeroUint<LIMBS>>
pub const fn xgcd(&self, rhs: &Self) -> XgcdOutput<LIMBS, NonZeroUint<LIMBS>>
Execute 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> NonZero<Uint<LIMBS>>
impl<const LIMBS: usize> NonZero<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> NonZero<Uint<LIMBS>>
impl<const LIMBS: usize> NonZero<Uint<LIMBS>>
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 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 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.
Trait Implementations§
Source§impl AsRef<NonZero<UintRef>> for NonZeroBoxedUint
Available on crate feature alloc only.
impl AsRef<NonZero<UintRef>> for NonZeroBoxedUint
alloc only.Source§fn as_ref(&self) -> &NonZeroUintRef
fn as_ref(&self) -> &NonZeroUintRef
Source§impl<const LIMBS: usize> AsRef<NonZero<UintRef>> for NonZeroUint<LIMBS>
impl<const LIMBS: usize> AsRef<NonZero<UintRef>> for NonZeroUint<LIMBS>
Source§fn as_ref(&self) -> &NonZeroUintRef
fn as_ref(&self) -> &NonZeroUintRef
Source§impl<T> ConditionallySelectable for NonZero<T>
Available on crate feature subtle only.
impl<T> ConditionallySelectable for NonZero<T>
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<T> ConstantTimeEq for NonZero<T>
Available on crate feature subtle only.
impl<T> ConstantTimeEq for NonZero<T>
subtle only.Source§impl<T> CtAssign for NonZero<T>where
T: CtAssign,
impl<T> CtAssign for NonZero<T>where
T: CtAssign,
Source§impl<T> CtAssignSlice for NonZero<T>where
T: CtAssign,
impl<T> CtAssignSlice for NonZero<T>where
T: CtAssign,
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<T> CtEqSlice for NonZero<T>where
T: CtEq,
impl<T> CtEqSlice for NonZero<T>where
T: CtEq,
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<'de, T: Deserialize<'de> + Zero> Deserialize<'de> for NonZero<T>
Available on crate feature serde only.
impl<'de, T: Deserialize<'de> + Zero> Deserialize<'de> for NonZero<T>
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<Int<RHS_LIMBS>>> for &Int<LIMBS>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<&NonZero<Int<RHS_LIMBS>>> for &Int<LIMBS>
Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<&NonZero<Int<RHS_LIMBS>>> for &Wrapping<Int<LIMBS>>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<&NonZero<Int<RHS_LIMBS>>> for &Wrapping<Int<LIMBS>>
Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<&NonZero<Int<RHS_LIMBS>>> for Int<LIMBS>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<&NonZero<Int<RHS_LIMBS>>> for Int<LIMBS>
Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<&NonZero<Int<RHS_LIMBS>>> for Wrapping<Int<LIMBS>>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<&NonZero<Int<RHS_LIMBS>>> for Wrapping<Int<LIMBS>>
Source§impl<Rhs: ToUnsigned + ?Sized> Div<&NonZero<Rhs>> for &BoxedUint
Available on crate feature alloc only.
impl<Rhs: ToUnsigned + ?Sized> Div<&NonZero<Rhs>> for &BoxedUint
alloc only.Source§impl<Rhs: ToUnsigned + ?Sized> Div<&NonZero<Rhs>> for &Wrapping<BoxedUint>
Available on crate feature alloc only.
impl<Rhs: ToUnsigned + ?Sized> Div<&NonZero<Rhs>> for &Wrapping<BoxedUint>
alloc only.Source§impl<Rhs: ToUnsigned + ?Sized> Div<&NonZero<Rhs>> for BoxedUint
Available on crate feature alloc only.
impl<Rhs: ToUnsigned + ?Sized> Div<&NonZero<Rhs>> for BoxedUint
alloc only.Source§impl<Rhs: ToUnsigned + ?Sized> Div<&NonZero<Rhs>> for Wrapping<BoxedUint>
Available on crate feature alloc only.
impl<Rhs: ToUnsigned + ?Sized> Div<&NonZero<Rhs>> for Wrapping<BoxedUint>
alloc only.Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<&NonZero<Uint<RHS_LIMBS>>> for &Int<LIMBS>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<&NonZero<Uint<RHS_LIMBS>>> for &Int<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 &Wrapping<Int<LIMBS>>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<&NonZero<Uint<RHS_LIMBS>>> for &Wrapping<Int<LIMBS>>
Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<&NonZero<Uint<RHS_LIMBS>>> for &Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<&NonZero<Uint<RHS_LIMBS>>> for &Wrapping<Uint<LIMBS>>
Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<&NonZero<Uint<RHS_LIMBS>>> for Int<LIMBS>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<&NonZero<Uint<RHS_LIMBS>>> for Int<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 Wrapping<Int<LIMBS>>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<&NonZero<Uint<RHS_LIMBS>>> for Wrapping<Int<LIMBS>>
Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<&NonZero<Uint<RHS_LIMBS>>> for Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<&NonZero<Uint<RHS_LIMBS>>> for Wrapping<Uint<LIMBS>>
Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<NonZero<Int<RHS_LIMBS>>> for &Int<LIMBS>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<NonZero<Int<RHS_LIMBS>>> for &Int<LIMBS>
Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<NonZero<Int<RHS_LIMBS>>> for &Wrapping<Int<LIMBS>>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<NonZero<Int<RHS_LIMBS>>> for &Wrapping<Int<LIMBS>>
Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<NonZero<Int<RHS_LIMBS>>> for Wrapping<Int<LIMBS>>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<NonZero<Int<RHS_LIMBS>>> for Wrapping<Int<LIMBS>>
Source§impl<Rhs: AsMut<UintRef>> Div<NonZero<Rhs>> for &BoxedUint
Available on crate feature alloc only.
impl<Rhs: AsMut<UintRef>> Div<NonZero<Rhs>> for &BoxedUint
alloc only.Source§impl<Rhs: AsMut<UintRef>> Div<NonZero<Rhs>> for &Wrapping<BoxedUint>
Available on crate feature alloc only.
impl<Rhs: AsMut<UintRef>> Div<NonZero<Rhs>> for &Wrapping<BoxedUint>
alloc only.Source§impl<Rhs: AsMut<UintRef>> Div<NonZero<Rhs>> for BoxedUint
Available on crate feature alloc only.
impl<Rhs: AsMut<UintRef>> Div<NonZero<Rhs>> for BoxedUint
alloc only.Source§impl<Rhs: AsMut<UintRef>> Div<NonZero<Rhs>> for Wrapping<BoxedUint>
Available on crate feature alloc only.
impl<Rhs: AsMut<UintRef>> Div<NonZero<Rhs>> for Wrapping<BoxedUint>
alloc only.Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<NonZero<Uint<RHS_LIMBS>>> for &Int<LIMBS>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<NonZero<Uint<RHS_LIMBS>>> for &Int<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 &Wrapping<Int<LIMBS>>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<NonZero<Uint<RHS_LIMBS>>> for &Wrapping<Int<LIMBS>>
Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<NonZero<Uint<RHS_LIMBS>>> for &Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<NonZero<Uint<RHS_LIMBS>>> for &Wrapping<Uint<LIMBS>>
Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<NonZero<Uint<RHS_LIMBS>>> for Int<LIMBS>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<NonZero<Uint<RHS_LIMBS>>> for Int<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 Wrapping<Int<LIMBS>>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<NonZero<Uint<RHS_LIMBS>>> for Wrapping<Int<LIMBS>>
Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<NonZero<Uint<RHS_LIMBS>>> for Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<NonZero<Uint<RHS_LIMBS>>> for Wrapping<Uint<LIMBS>>
Source§impl<Rhs: ToUnsigned + ?Sized> DivAssign<&NonZero<Rhs>> for BoxedUint
Available on crate feature alloc only.
impl<Rhs: ToUnsigned + ?Sized> DivAssign<&NonZero<Rhs>> for BoxedUint
alloc only.Source§fn div_assign(&mut self, rhs: &NonZero<Rhs>)
fn div_assign(&mut self, rhs: &NonZero<Rhs>)
/= operation. Read moreSource§impl<Rhs: ToUnsigned + ?Sized> DivAssign<&NonZero<Rhs>> for Wrapping<BoxedUint>
Available on crate feature alloc only.
impl<Rhs: ToUnsigned + ?Sized> DivAssign<&NonZero<Rhs>> for Wrapping<BoxedUint>
alloc only.Source§fn div_assign(&mut self, rhs: &NonZero<Rhs>)
fn div_assign(&mut self, rhs: &NonZero<Rhs>)
/= operation. Read moreSource§impl<const LIMBS: usize, const RHS_LIMBS: usize> DivAssign<&NonZero<Uint<RHS_LIMBS>>> for Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize, const RHS_LIMBS: usize> DivAssign<&NonZero<Uint<RHS_LIMBS>>> for Wrapping<Uint<LIMBS>>
Source§impl<Rhs: AsMut<UintRef>> DivAssign<NonZero<Rhs>> for BoxedUint
Available on crate feature alloc only.
impl<Rhs: AsMut<UintRef>> DivAssign<NonZero<Rhs>> for BoxedUint
alloc only.Source§fn div_assign(&mut self, rhs: NonZero<Rhs>)
fn div_assign(&mut self, rhs: NonZero<Rhs>)
/= operation. Read moreSource§impl<Rhs: AsMut<UintRef>> DivAssign<NonZero<Rhs>> for Wrapping<BoxedUint>
Available on crate feature alloc only.
impl<Rhs: AsMut<UintRef>> DivAssign<NonZero<Rhs>> for Wrapping<BoxedUint>
alloc only.Source§fn div_assign(&mut self, rhs: NonZero<Rhs>)
fn div_assign(&mut self, rhs: NonZero<Rhs>)
/= operation. Read moreSource§impl<const LIMBS: usize, const RHS_LIMBS: usize> DivAssign<NonZero<Uint<RHS_LIMBS>>> for Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize, const RHS_LIMBS: usize> DivAssign<NonZero<Uint<RHS_LIMBS>>> for Wrapping<Uint<LIMBS>>
Source§impl<const LIMBS: usize> FloorSquareRoot for NonZero<Uint<LIMBS>>
impl<const LIMBS: usize> FloorSquareRoot for NonZero<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 LIMBS: usize> From<NonZero<u128>> for NonZero<Uint<LIMBS>>
impl<const LIMBS: usize> From<NonZero<u128>> for NonZero<Uint<LIMBS>>
Source§fn from(integer: NonZeroU128) -> Self
fn from(integer: NonZeroU128) -> Self
Source§impl From<NonZero<u16>> for NonZero<Limb>
impl From<NonZero<u16>> for NonZero<Limb>
Source§fn from(integer: NonZeroU16) -> Self
fn from(integer: NonZeroU16) -> Self
Source§impl<const LIMBS: usize> From<NonZero<u16>> for NonZero<Uint<LIMBS>>
impl<const LIMBS: usize> From<NonZero<u16>> for NonZero<Uint<LIMBS>>
Source§fn from(integer: NonZeroU16) -> Self
fn from(integer: NonZeroU16) -> Self
Source§impl From<NonZero<u32>> for NonZero<Limb>
impl From<NonZero<u32>> for NonZero<Limb>
Source§fn from(integer: NonZeroU32) -> Self
fn from(integer: NonZeroU32) -> Self
Source§impl<const LIMBS: usize> From<NonZero<u32>> for NonZero<Uint<LIMBS>>
impl<const LIMBS: usize> From<NonZero<u32>> for NonZero<Uint<LIMBS>>
Source§fn from(integer: NonZeroU32) -> Self
fn from(integer: NonZeroU32) -> Self
Source§impl From<NonZero<u64>> for NonZero<Limb>
impl From<NonZero<u64>> for NonZero<Limb>
Source§fn from(integer: NonZeroU64) -> Self
fn from(integer: NonZeroU64) -> Self
Source§impl<const LIMBS: usize> From<NonZero<u64>> for NonZero<Uint<LIMBS>>
impl<const LIMBS: usize> From<NonZero<u64>> for NonZero<Uint<LIMBS>>
Source§fn from(integer: NonZeroU64) -> Self
fn from(integer: NonZeroU64) -> Self
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 Int<LIMBS>
impl<const LIMBS: usize> Gcd<NonZero<Uint<LIMBS>>> for Int<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> Gcd<NonZero<Uint<LIMBS>>> for OddUint<LIMBS>
impl<const LIMBS: usize> Gcd<NonZero<Uint<LIMBS>>> for OddUint<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> 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<T> Mul for NonZero<T>where
T: Mul<T, Output = T>,
Any non-zero integer multiplied by another non-zero integer is definitionally non-zero.
impl<T> Mul for NonZero<T>where
T: Mul<T, Output = T>,
Any non-zero integer multiplied by another non-zero integer is definitionally non-zero.
Source§impl<T: Ord + ?Sized> Ord for NonZero<T>
impl<T: Ord + ?Sized> Ord for NonZero<T>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl<T: PartialOrd + ?Sized> PartialOrd for NonZero<T>
impl<T: PartialOrd + ?Sized> PartialOrd for NonZero<T>
Source§impl<T> Random for NonZero<T>
Available on crate feature rand_core only.
impl<T> Random for NonZero<T>
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>
This uses rejection sampling to avoid zero.
As a result, it runs in variable time. If the generator rng is
cryptographically secure (for example, it implements CryptoRng),
then this is guaranteed not to leak anything about the output value.
Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<&NonZero<Int<RHS_LIMBS>>> for &Int<LIMBS>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<&NonZero<Int<RHS_LIMBS>>> for &Int<LIMBS>
Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<&NonZero<Int<RHS_LIMBS>>> for &Wrapping<Int<LIMBS>>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<&NonZero<Int<RHS_LIMBS>>> for &Wrapping<Int<LIMBS>>
Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<&NonZero<Int<RHS_LIMBS>>> for Int<LIMBS>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<&NonZero<Int<RHS_LIMBS>>> for Int<LIMBS>
Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<&NonZero<Int<RHS_LIMBS>>> for Wrapping<Int<LIMBS>>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<&NonZero<Int<RHS_LIMBS>>> for Wrapping<Int<LIMBS>>
Source§impl<Rhs: ToUnsigned + ?Sized> Rem<&NonZero<Rhs>> for &BoxedUint
Available on crate feature alloc only.
impl<Rhs: ToUnsigned + ?Sized> Rem<&NonZero<Rhs>> for &BoxedUint
alloc only.Source§impl<Rhs: ToUnsigned + ?Sized> Rem<&NonZero<Rhs>> for BoxedUint
Available on crate feature alloc only.
impl<Rhs: ToUnsigned + ?Sized> Rem<&NonZero<Rhs>> for BoxedUint
alloc only.Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<&NonZero<Uint<RHS_LIMBS>>> for &Int<LIMBS>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<&NonZero<Uint<RHS_LIMBS>>> for &Int<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 &Wrapping<Int<LIMBS>>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<&NonZero<Uint<RHS_LIMBS>>> for &Wrapping<Int<LIMBS>>
Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<&NonZero<Uint<RHS_LIMBS>>> for &Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<&NonZero<Uint<RHS_LIMBS>>> for &Wrapping<Uint<LIMBS>>
Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<&NonZero<Uint<RHS_LIMBS>>> for Int<LIMBS>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<&NonZero<Uint<RHS_LIMBS>>> for Int<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 Wrapping<Int<LIMBS>>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<&NonZero<Uint<RHS_LIMBS>>> for Wrapping<Int<LIMBS>>
Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<&NonZero<Uint<RHS_LIMBS>>> for Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<&NonZero<Uint<RHS_LIMBS>>> for Wrapping<Uint<LIMBS>>
Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<NonZero<Int<RHS_LIMBS>>> for &Int<LIMBS>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<NonZero<Int<RHS_LIMBS>>> for &Int<LIMBS>
Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<NonZero<Int<RHS_LIMBS>>> for &Wrapping<Int<LIMBS>>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<NonZero<Int<RHS_LIMBS>>> for &Wrapping<Int<LIMBS>>
Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<NonZero<Int<RHS_LIMBS>>> for Wrapping<Int<LIMBS>>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<NonZero<Int<RHS_LIMBS>>> for Wrapping<Int<LIMBS>>
Source§impl<Rhs: AsMut<UintRef>> Rem<NonZero<Rhs>> for &BoxedUint
Available on crate feature alloc only.
impl<Rhs: AsMut<UintRef>> Rem<NonZero<Rhs>> for &BoxedUint
alloc only.Source§impl<Rhs: AsMut<UintRef>> Rem<NonZero<Rhs>> for BoxedUint
Available on crate feature alloc only.
impl<Rhs: AsMut<UintRef>> Rem<NonZero<Rhs>> for BoxedUint
alloc only.Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<NonZero<Uint<RHS_LIMBS>>> for &Int<LIMBS>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<NonZero<Uint<RHS_LIMBS>>> for &Int<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 &Wrapping<Int<LIMBS>>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<NonZero<Uint<RHS_LIMBS>>> for &Wrapping<Int<LIMBS>>
Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<NonZero<Uint<RHS_LIMBS>>> for &Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<NonZero<Uint<RHS_LIMBS>>> for &Wrapping<Uint<LIMBS>>
Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<NonZero<Uint<RHS_LIMBS>>> for Int<LIMBS>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<NonZero<Uint<RHS_LIMBS>>> for Int<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 Wrapping<Int<LIMBS>>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<NonZero<Uint<RHS_LIMBS>>> for Wrapping<Int<LIMBS>>
Source§impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<NonZero<Uint<RHS_LIMBS>>> for Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<NonZero<Uint<RHS_LIMBS>>> for Wrapping<Uint<LIMBS>>
Source§impl<Rhs: AsRef<UintRef> + ?Sized> RemAssign<&NonZero<Rhs>> for BoxedUint
Available on crate feature alloc only.
impl<Rhs: AsRef<UintRef> + ?Sized> RemAssign<&NonZero<Rhs>> for BoxedUint
alloc only.Source§fn rem_assign(&mut self, rhs: &NonZero<Rhs>)
fn rem_assign(&mut self, rhs: &NonZero<Rhs>)
%= operation. Read moreSource§impl<Rhs: AsRef<UintRef>> RemAssign<NonZero<Rhs>> for BoxedUint
Available on crate feature alloc only.
impl<Rhs: AsRef<UintRef>> RemAssign<NonZero<Rhs>> for BoxedUint
alloc only.Source§fn rem_assign(&mut self, rhs: NonZero<Rhs>)
fn rem_assign(&mut self, rhs: NonZero<Rhs>)
%= operation. Read moreSource§impl Resize for &NonZero<BoxedUint>
Available on crate feature alloc only.
impl Resize for &NonZero<BoxedUint>
alloc only.Source§fn resize_unchecked(self, at_least_bits_precision: u32) -> Self::Output
fn resize_unchecked(self, at_least_bits_precision: u32) -> Self::Output
at_least_bits_precision
without checking if the bit size of self is larger than at_least_bits_precision. Read moreSource§impl Resize for NonZero<BoxedUint>
Available on crate feature alloc only.
impl Resize for NonZero<BoxedUint>
alloc only.Source§fn resize_unchecked(self, at_least_bits_precision: u32) -> Self::Output
fn resize_unchecked(self, at_least_bits_precision: u32) -> Self::Output
at_least_bits_precision
without checking if the bit size of self is larger than at_least_bits_precision. Read more