Struct ark_ff::biginteger::BigInt

source ·
pub struct BigInt<const N: usize>(pub [u64; N]);

Tuple Fields§

§0: [u64; N]

Implementations§

source§

impl<const N: usize> BigInt<N>

source

pub const fn new(value: [u64; N]) -> Self

source

pub const fn zero() -> Self

source

pub const fn one() -> Self

Trait Implementations§

source§

impl<const N: usize> AsMut<[u64]> for BigInt<N>

source§

fn as_mut(&mut self) -> &mut [u64]

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<const N: usize> AsRef<[u64]> for BigInt<N>

source§

fn as_ref(&self) -> &[u64]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<const N: usize> BigInteger for BigInt<N>

source§

const NUM_LIMBS: usize = N

Number of 64-bit limbs representing Self.
source§

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 more
source§

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 more
source§

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)

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)

Performs a rightwise bitshift of this number, effectively dividing it by 2. Read more
source§

fn divn(&mut self, n: u32)

Performs a rightwise bitshift of this number by some amount. Read more
source§

fn is_odd(&self) -> bool

Returns true iff this number is odd. Read more
source§

fn is_even(&self) -> bool

Returns true iff this number is even. Read more
source§

fn is_zero(&self) -> bool

Returns true iff this number is zero. Read more
source§

fn num_bits(&self) -> u32

Compute the minimum number of bits needed to encode this number. Read more
source§

fn get_bit(&self, i: usize) -> bool

Compute the i-th bit of self. Read more
source§

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

Returns the big integer representation of a given little endian boolean array. Read more
source§

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>

Returns the byte representation in a little endian byte array, with trailing zeros. Read more
source§

fn to_bits_be(&self) -> Vec<bool>

Returns the bit representation in a big endian boolean array, with leading zeroes. Read more
source§

fn to_bits_le(&self) -> Vec<bool>

Returns the bit representation in a little endian boolean array, with trailing zeroes. Read more
source§

fn find_wnaf(&self, w: usize) -> Option<Vec<i64>>

Returns the windowed non-adjacent form of self, for a window of size w.
source§

impl<const N: usize> CanonicalDeserialize for BigInt<N>

source§

fn deserialize_with_mode<R: Read>( reader: R, compress: Compress, validate: Validate ) -> Result<Self, SerializationError>

The general deserialize method that takes in customization flags.
source§

fn deserialize_compressed<R>(reader: R) -> Result<Self, SerializationError>
where R: Read,

source§

fn deserialize_compressed_unchecked<R>( reader: R ) -> Result<Self, SerializationError>
where R: Read,

source§

fn deserialize_uncompressed<R>(reader: R) -> Result<Self, SerializationError>
where R: Read,

source§

fn deserialize_uncompressed_unchecked<R>( reader: R ) -> Result<Self, SerializationError>
where R: Read,

source§

impl<const N: usize> CanonicalSerialize for BigInt<N>

source§

fn serialize_with_mode<W: Write>( &self, writer: W, compress: Compress ) -> Result<(), SerializationError>

The general serialize method that takes in customization flags.
source§

fn serialized_size(&self, compress: Compress) -> usize

source§

fn serialize_compressed<W>(&self, writer: W) -> Result<(), SerializationError>
where W: Write,

source§

fn compressed_size(&self) -> usize

source§

fn serialize_uncompressed<W>(&self, writer: W) -> Result<(), SerializationError>
where W: Write,

source§

fn uncompressed_size(&self) -> usize

source§

impl<const N: usize> Clone for BigInt<N>

source§

fn clone(&self) -> BigInt<N>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<const N: usize> Debug for BigInt<N>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<const N: usize> Default for BigInt<N>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<const N: usize> Display for BigInt<N>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<const N: usize> Distribution<BigInt<N>> for Standard

source§

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§

fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>
where R: Rng, Self: Sized,

Create an iterator that generates random values of T, using rng as the source of randomness. Read more
source§

fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S>
where F: Fn(T) -> S, Self: Sized,

Create a distribution of values of ‘S’ by mapping the output of Self through the closure F Read more
source§

impl<const N: usize> From<BigInt<N>> for BigUint

source§

fn from(val: BigInt<N>) -> BigUint

Converts to this type from the input type.
source§

impl<P: FpConfig<N>, const N: usize> From<BigInt<N>> for Fp<P, N>

source§

fn from(int: BigInt<N>) -> Self

Converts Self::BigInteger into Self

source§

impl<P: FpConfig<N>, const N: usize> From<Fp<P, N>> for BigInt<N>

source§

fn from(fp: Fp<P, N>) -> Self

Converts to this type from the input type.
source§

impl<const N: usize> From<u16> for BigInt<N>

source§

fn from(val: u16) -> BigInt<N>

Converts to this type from the input type.
source§

impl<const N: usize> From<u32> for BigInt<N>

source§

fn from(val: u32) -> BigInt<N>

Converts to this type from the input type.
source§

impl<const N: usize> From<u64> for BigInt<N>

source§

fn from(val: u64) -> BigInt<N>

Converts to this type from the input type.
source§

impl<const N: usize> From<u8> for BigInt<N>

source§

fn from(val: u8) -> BigInt<N>

Converts to this type from the input type.
source§

impl<const N: usize> Hash for BigInt<N>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<const N: usize> Ord for BigInt<N>

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl<const N: usize> PartialEq for BigInt<N>

source§

fn eq(&self, other: &BigInt<N>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<const N: usize> PartialOrd for BigInt<N>

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<const N: usize> TryFrom<BigUint> for BigInt<N>

source§

fn try_from(val: BigUint) -> Result<BigInt<N>, Self::Error>

Returns Err(()) if the bit size of val is more than N * 64.

§

type Error = ()

The type returned in the event of a conversion error.
source§

impl<const N: usize> UpperHex for BigInt<N>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl<const N: usize> Valid for BigInt<N>

source§

fn check(&self) -> Result<(), SerializationError>

source§

fn batch_check<'a>( batch: impl Iterator<Item = &'a Self> + Send ) -> Result<(), SerializationError>
where Self: 'a,

source§

impl<const N: usize> Zeroize for BigInt<N>

source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler.
source§

impl<const N: usize> Copy for BigInt<N>

source§

impl<const N: usize> Eq for BigInt<N>

source§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CanonicalSerializeHashExt for T

source§

fn hash<H>(&self) -> GenericArray<u8, <H as OutputSizeUser>::OutputSize>
where H: Digest,

source§

fn hash_uncompressed<H>( &self ) -> GenericArray<u8, <H as OutputSizeUser>::OutputSize>
where H: Digest,

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> UniformRand for T

§

fn rand<R>(rng: &mut R) -> T
where R: Rng + ?Sized,

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V