Trait ark_ff::biginteger::BigInteger[][src]

pub trait BigInteger: ToBytes + FromBytes + CanonicalSerialize + CanonicalDeserialize + Copy + Clone + Debug + Default + Display + Eq + Ord + Send + Sized + Sync + 'static + UniformRand + Zeroize + AsMut<[u64]> + AsRef<[u64]> + From<u64> + TryFrom<BigUint> + Into<BigUint> {
    const NUM_LIMBS: usize;
Show methods fn add_nocarry(&mut self, other: &Self) -> bool;
fn sub_noborrow(&mut self, other: &Self) -> bool;
fn mul2(&mut self);
fn muln(&mut self, amt: u32);
fn div2(&mut self);
fn divn(&mut self, amt: u32);
fn is_odd(&self) -> bool;
fn is_even(&self) -> bool;
fn is_zero(&self) -> bool;
fn num_bits(&self) -> u32;
fn get_bit(&self, i: usize) -> bool;
fn from_bits_be(bits: &[bool]) -> Self;
fn from_bits_le(bits: &[bool]) -> Self;
fn to_bytes_be(&self) -> Vec<u8>;
fn to_bytes_le(&self) -> Vec<u8>; fn to_bits_be(&self) -> Vec<bool> { ... }
fn to_bits_le(&self) -> Vec<bool> { ... }
fn find_wnaf(&self, w: usize) -> Option<Vec<i64>> { ... }
fn write_le<W: Write>(&self, writer: &mut W) -> IoResult<()> { ... }
fn read_le<R: Read>(&mut self, reader: &mut R) -> IoResult<()> { ... }
}
Expand description

This defines a BigInteger, a smart wrapper around a sequence of u64 limbs, least-significant limb first.

Associated Constants

Number of limbs.

Required methods

Add another representation to this one, returning the carry bit.

Subtract another representation from this one, returning the borrow bit.

Performs a leftwise bitshift of this number, effectively multiplying it by 2. Overflow is ignored.

Performs a leftwise bitshift of this number by some amount.

Performs a rightwise bitshift of this number, effectively dividing it by 2.

Performs a rightwise bitshift of this number by some amount.

Returns true iff this number is odd.

Returns true iff this number is even.

Returns true iff this number is zero.

Compute the number of bits needed to encode this number. Always a multiple of 64.

Compute the i-th bit of self.

Returns the big integer representation of a given big endian boolean array.

Returns the big integer representation of a given little endian boolean array.

Returns the byte representation in a big endian byte array, with leading zeros.

Returns the byte representation in a little endian byte array, with trailing zeros.

Provided methods

Returns the bit representation in a big endian boolean array, with leading zeroes.

Returns the bit representation in a little endian boolean array, with trailing zeroes.

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

Writes this BigInteger as a big endian integer. Always writes (num_bits / 8) bytes.

Reads a big endian integer occupying (num_bits / 8) bytes into this representation.

Implementors