pub struct BigInt<const N: usize>(pub [u64; N]);
Tuple Fields§
§0: [u64; N]
Implementations§
Trait Implementations§
Source§impl<const N: usize> BigInteger for BigInt<N>
impl<const N: usize> BigInteger for BigInt<N>
Source§fn add_with_carry(&mut self, other: &Self) -> bool
fn add_with_carry(&mut self, other: &Self) -> bool
BigInteger
to self
. This method stores the result in self
,
and returns a carry bit. Read moreSource§fn sub_with_borrow(&mut self, other: &Self) -> bool
fn sub_with_borrow(&mut self, other: &Self) -> bool
BigInteger
from this one. This method stores the result in
self
, and returns a borrow. Read moreSource§fn mul2(&mut self) -> bool
fn mul2(&mut self) -> bool
Source§fn muln(&mut self, n: u32)
fn muln(&mut self, n: u32)
<<
insteadSource§fn mul(&self, other: &Self) -> (Self, Self)
fn mul(&self, other: &Self) -> (Self, Self)
BigInteger
by another BigInteger
, returning both low and high bits of the result. Read moreSource§fn mul_low(&self, other: &Self) -> Self
fn mul_low(&self, other: &Self) -> Self
BigInteger
by another BigInteger
, storing the result in self
.
Overflow is ignored. Read moreSource§fn div2(&mut self)
fn div2(&mut self)
Source§fn divn(&mut self, n: u32)
fn divn(&mut self, n: u32)
>>
insteadSource§fn num_bits(&self) -> u32
fn num_bits(&self) -> u32
Source§fn from_bits_be(bits: &[bool]) -> Self
fn from_bits_be(bits: &[bool]) -> Self
Source§fn from_bits_le(bits: &[bool]) -> Self
fn from_bits_le(bits: &[bool]) -> Self
Source§fn to_bytes_be(&self) -> Vec<u8>
fn to_bytes_be(&self) -> Vec<u8>
Source§fn to_bytes_le(&self) -> Vec<u8>
fn to_bytes_le(&self) -> Vec<u8>
Source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
Source§impl<B: Borrow<Self>, const N: usize> BitAndAssign<B> for BigInt<N>
impl<B: Borrow<Self>, const N: usize> BitAndAssign<B> for BigInt<N>
Source§fn bitand_assign(&mut self, rhs: B)
fn bitand_assign(&mut self, rhs: B)
&=
operation. Read moreSource§impl<B: Borrow<Self>, const N: usize> BitOrAssign<B> for BigInt<N>
impl<B: Borrow<Self>, const N: usize> BitOrAssign<B> for BigInt<N>
Source§fn bitor_assign(&mut self, rhs: B)
fn bitor_assign(&mut self, rhs: B)
|=
operation. Read moreSource§impl<B: Borrow<Self>, const N: usize> BitXorAssign<B> for BigInt<N>
impl<B: Borrow<Self>, const N: usize> BitXorAssign<B> for BigInt<N>
Source§fn bitxor_assign(&mut self, rhs: B)
fn bitxor_assign(&mut self, rhs: B)
^=
operation. Read moreSource§impl<const N: usize> CanonicalDeserialize for BigInt<N>
impl<const N: usize> CanonicalDeserialize for BigInt<N>
Source§fn deserialize_with_mode<R: Read>(
reader: R,
compress: Compress,
validate: Validate,
) -> Result<Self, SerializationError>
fn deserialize_with_mode<R: Read>( reader: R, compress: Compress, validate: Validate, ) -> Result<Self, SerializationError>
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,
Source§impl<const N: usize> CanonicalSerialize for BigInt<N>
impl<const N: usize> CanonicalSerialize for BigInt<N>
Source§fn serialize_with_mode<W: Write>(
&self,
writer: W,
compress: Compress,
) -> Result<(), SerializationError>
fn serialize_with_mode<W: Write>( &self, writer: W, compress: Compress, ) -> Result<(), SerializationError>
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
Source§impl<const N: usize> Distribution<BigInt<N>> for Standard
impl<const N: usize> Distribution<BigInt<N>> for Standard
Source§impl<const N: usize> Ord for BigInt<N>
impl<const N: usize> Ord for BigInt<N>
Source§impl<const N: usize> PartialOrd for BigInt<N>
impl<const N: usize> PartialOrd for BigInt<N>
Source§impl<const N: usize> Shl<u32> for BigInt<N>
impl<const N: usize> Shl<u32> for BigInt<N>
Source§fn shl(self, rhs: u32) -> Self::Output
fn shl(self, rhs: u32) -> Self::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.
Source§impl<const N: usize> ShlAssign<u32> for BigInt<N>
impl<const N: usize> ShlAssign<u32> for BigInt<N>
Source§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.
Source§impl<const N: usize> Shr<u32> for BigInt<N>
impl<const N: usize> Shr<u32> for BigInt<N>
Source§impl<const N: usize> ShrAssign<u32> for BigInt<N>
impl<const N: usize> ShrAssign<u32> for BigInt<N>
Source§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.
Source§impl<const N: usize> Valid for BigInt<N>
impl<const N: usize> Valid for BigInt<N>
fn check(&self) -> Result<(), SerializationError>
fn batch_check<'a>(
batch: impl Iterator<Item = &'a Self> + Send,
) -> Result<(), SerializationError>where
Self: 'a,
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
Source§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,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)