Struct BigInt
pub struct BigInt<const N: usize>(pub [u64; N]);Tuple Fields§
§0: [u64; N]Implementations§
Trait Implementations§
§impl<const N: usize> BigInteger for BigInt<N>
impl<const N: usize> BigInteger for BigInt<N>
§fn add_with_carry(&mut self, other: &BigInt<N>) -> bool
fn add_with_carry(&mut self, other: &BigInt<N>) -> bool
BigInteger to self. This method stores the result in self,
and returns a carry bit. Read more§fn sub_with_borrow(&mut self, other: &BigInt<N>) -> bool
fn sub_with_borrow(&mut self, other: &BigInt<N>) -> bool
BigInteger from this one. This method stores the result in
self, and returns a borrow. Read more§fn mul2(&mut self) -> bool
fn mul2(&mut self) -> bool
§fn muln(&mut self, n: u32)
fn muln(&mut self, n: u32)
<< instead§fn mul(&self, other: &BigInt<N>) -> (BigInt<N>, BigInt<N>)
fn mul(&self, other: &BigInt<N>) -> (BigInt<N>, BigInt<N>)
BigInteger by another BigInteger, returning both low and high bits of the result. Read more§fn mul_low(&self, other: &BigInt<N>) -> BigInt<N>
fn mul_low(&self, other: &BigInt<N>) -> BigInt<N>
BigInteger by another BigInteger, storing the result in self.
Overflow is ignored. Read more§fn div2(&mut self)
fn div2(&mut self)
§fn divn(&mut self, n: u32)
fn divn(&mut self, n: u32)
>> instead§fn num_bits(&self) -> u32
fn num_bits(&self) -> u32
§fn from_bits_be(bits: &[bool]) -> BigInt<N>
fn from_bits_be(bits: &[bool]) -> BigInt<N>
§fn from_bits_le(bits: &[bool]) -> BigInt<N>
fn from_bits_le(bits: &[bool]) -> BigInt<N>
§fn to_bytes_be(&self) -> Vec<u8> ⓘ
fn to_bytes_be(&self) -> Vec<u8> ⓘ
§fn to_bytes_le(&self) -> Vec<u8> ⓘ
fn to_bytes_le(&self) -> Vec<u8> ⓘ
§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
§impl<B, const N: usize> BitAndAssign<B> for BigInt<N>
impl<B, const N: usize> BitAndAssign<B> for BigInt<N>
§fn bitand_assign(&mut self, rhs: B)
fn bitand_assign(&mut self, rhs: B)
&= operation. Read more§impl<B, const N: usize> BitOrAssign<B> for BigInt<N>
impl<B, const N: usize> BitOrAssign<B> for BigInt<N>
§fn bitor_assign(&mut self, rhs: B)
fn bitor_assign(&mut self, rhs: B)
|= operation. Read more§impl<B, const N: usize> BitXorAssign<B> for BigInt<N>
impl<B, const N: usize> BitXorAssign<B> for BigInt<N>
§fn bitxor_assign(&mut self, rhs: B)
fn bitxor_assign(&mut self, rhs: B)
^= operation. Read more§impl<const N: usize> CanonicalDeserialize for BigInt<N>
impl<const N: usize> CanonicalDeserialize for BigInt<N>
§fn deserialize_with_mode<R>(
reader: R,
compress: Compress,
validate: Validate,
) -> Result<BigInt<N>, SerializationError>where
R: Read,
fn deserialize_with_mode<R>(
reader: R,
compress: Compress,
validate: Validate,
) -> Result<BigInt<N>, SerializationError>where
R: Read,
fn deserialize_compressed<R>(reader: R) -> Result<Self, SerializationError>where
R: Read,
fn deserialize_compressed_unchecked<R>(
reader: R,
) -> Result<Self, SerializationError>where
R: Read,
fn deserialize_uncompressed<R>(reader: R) -> Result<Self, SerializationError>where
R: Read,
fn deserialize_uncompressed_unchecked<R>(
reader: R,
) -> Result<Self, SerializationError>where
R: Read,
§impl<const N: usize> CanonicalSerialize for BigInt<N>
impl<const N: usize> CanonicalSerialize for BigInt<N>
§fn serialize_with_mode<W>(
&self,
writer: W,
compress: Compress,
) -> Result<(), SerializationError>where
W: Write,
fn serialize_with_mode<W>(
&self,
writer: W,
compress: Compress,
) -> Result<(), SerializationError>where
W: Write,
fn serialized_size(&self, compress: Compress) -> usize
fn serialize_compressed<W>(&self, writer: W) -> Result<(), SerializationError>where
W: Write,
fn compressed_size(&self) -> usize
fn serialize_uncompressed<W>(&self, writer: W) -> Result<(), SerializationError>where
W: Write,
fn uncompressed_size(&self) -> usize
§impl<const N: usize> Ord for BigInt<N>
impl<const N: usize> Ord for BigInt<N>
§impl<const N: usize> PartialOrd for BigInt<N>
impl<const N: usize> PartialOrd for BigInt<N>
§impl<const N: usize> Shl<u32> for BigInt<N>
impl<const N: usize> Shl<u32> for BigInt<N>
§fn shl(self, rhs: u32) -> <BigInt<N> as Shl<u32>>::Output
fn shl(self, rhs: u32) -> <BigInt<N> as Shl<u32>>::Output
Computes the bitwise shift left operation in place.
Differently from the built-in numeric types (u8, u32, u64, etc.) this operation does not return an overflow error if the number of bits shifted is larger than N * 64. Instead, the overflow will be chopped off.
§impl<const N: usize> ShlAssign<u32> for BigInt<N>
impl<const N: usize> ShlAssign<u32> for BigInt<N>
§fn shl_assign(&mut self, rhs: u32)
fn shl_assign(&mut self, rhs: u32)
Computes the bitwise shift left operation in place.
Differently from the built-in numeric types (u8, u32, u64, etc.) this operation does not return an overflow error if the number of bits shifted is larger than N * 64. Instead, the overflow will be chopped off.
§impl<const N: usize> Shr<u32> for BigInt<N>
impl<const N: usize> Shr<u32> for BigInt<N>
§fn shr(self, rhs: u32) -> <BigInt<N> as Shr<u32>>::Output
fn shr(self, rhs: u32) -> <BigInt<N> as Shr<u32>>::Output
Computes bitwise shift right operation.
Differently from the built-in numeric types (u8, u32, u64, etc.) this operation does not return an underflow error if the number of bits shifted is larger than N * 64. Instead the result will be saturated to zero.
§impl<const N: usize> ShrAssign<u32> for BigInt<N>
impl<const N: usize> ShrAssign<u32> for BigInt<N>
§fn shr_assign(&mut self, rhs: u32)
fn shr_assign(&mut self, rhs: u32)
Computes the bitwise shift right operation in place.
Differently from the built-in numeric types (u8, u32, u64, etc.) this operation does not return an underflow error if the number of bits shifted is larger than N * 64. Instead the result will be saturated to zero.
impl<const N: usize> Copy for BigInt<N>
impl<const N: usize> Eq for BigInt<N>
impl<const N: usize> StructuralPartialEq for BigInt<N>
Auto Trait Implementations§
impl<const N: usize> Freeze for BigInt<N>
impl<const N: usize> RefUnwindSafe for BigInt<N>
impl<const N: usize> Send for BigInt<N>
impl<const N: usize> Sync for BigInt<N>
impl<const N: usize> Unpin for BigInt<N>
impl<const N: usize> UnwindSafe for BigInt<N>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CanonicalSerializeHashExt for Twhere
T: CanonicalSerialize,
impl<T> CanonicalSerializeHashExt for Twhere
T: CanonicalSerialize,
fn hash<H>(&self) -> GenericArray<u8, <H as OutputSizeUser>::OutputSize>where
H: Digest,
fn hash_uncompressed<H>(
&self,
) -> GenericArray<u8, <H as OutputSizeUser>::OutputSize>where
H: Digest,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more