Struct ark_ff::biginteger::BigInt
source · 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
Add another
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
Subtract another
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
Performs a leftwise bitshift of this number, effectively multiplying
it by 2. Overflow is ignored. Read more
source§fn muln(&mut self, n: u32)
fn muln(&mut self, n: u32)
Performs a leftwise bitshift of this number by n bits, effectively multiplying
it by 2^n. Overflow is ignored. Read more
source§fn div2(&mut self)
fn div2(&mut self)
Performs a rightwise bitshift of this number, effectively dividing
it by 2. Read more
source§fn divn(&mut self, n: u32)
fn divn(&mut self, n: u32)
Performs a rightwise bitshift of this number by some amount. Read more
source§fn num_bits(&self) -> u32
fn num_bits(&self) -> u32
Compute the minimum number of bits needed to encode this number. Read more
source§fn from_bits_be(bits: &[bool]) -> Self
fn from_bits_be(bits: &[bool]) -> Self
Returns the big integer representation of a given big endian boolean
array. Read more
source§fn from_bits_le(bits: &[bool]) -> Self
fn from_bits_le(bits: &[bool]) -> Self
Returns the big integer representation of a given little endian boolean
array. Read more
source§fn to_bytes_be(&self) -> Vec<u8>
fn to_bytes_be(&self) -> Vec<u8>
Returns the byte representation in a big endian byte array,
with leading zeros. Read more
source§fn to_bytes_le(&self) -> Vec<u8>
fn to_bytes_le(&self) -> Vec<u8>
Returns the byte representation in a little endian byte array,
with trailing zeros. Read more
source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
Returns the bit representation in a big endian boolean array,
with leading zeroes. Read more
source§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>
The general deserialize method that takes in customization flags.
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>
The general serialize method that takes in customization flags.
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§fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> BigInt<N>
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> BigInt<N>
Generate a random value of
T
, using rng
as the source of randomness.source§impl<const N: usize> Ord for BigInt<N>
impl<const N: usize> Ord for BigInt<N>
source§impl<const N: usize> PartialEq<BigInt<N>> for BigInt<N>
impl<const N: usize> PartialEq<BigInt<N>> for BigInt<N>
source§impl<const N: usize> PartialOrd<BigInt<N>> for BigInt<N>
impl<const N: usize> PartialOrd<BigInt<N>> for BigInt<N>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more