Trait ark_ff::biginteger::BigInteger [−][src]
This defines a BigInteger
, a smart wrapper around a
sequence of u64
limbs, least-significant limb first.
Associated Constants
Loading content...Required methods
fn add_nocarry(&mut self, other: &Self) -> bool
[src]
Add another representation to this one, returning the carry bit.
fn sub_noborrow(&mut self, other: &Self) -> bool
[src]
Subtract another representation from this one, returning the borrow bit.
fn mul2(&mut self)
[src]
Performs a leftwise bitshift of this number, effectively multiplying it by 2. Overflow is ignored.
fn muln(&mut self, amt: u32)
[src]
Performs a leftwise bitshift of this number by some amount.
fn div2(&mut self)
[src]
Performs a rightwise bitshift of this number, effectively dividing it by 2.
fn divn(&mut self, amt: u32)
[src]
Performs a rightwise bitshift of this number by some amount.
fn is_odd(&self) -> bool
[src]
Returns true iff this number is odd.
fn is_even(&self) -> bool
[src]
Returns true iff this number is even.
fn is_zero(&self) -> bool
[src]
Returns true iff this number is zero.
fn num_bits(&self) -> u32
[src]
Compute the number of bits needed to encode this number. Always a multiple of 64.
fn get_bit(&self, i: usize) -> bool
[src]
Compute the i
-th bit of self
.
fn from_bits_be(bits: &[bool]) -> Self
[src]
Returns the big integer representation of a given big endian boolean array.
fn from_bits_le(bits: &[bool]) -> Self
[src]
Returns the big integer representation of a given little endian boolean array.
fn to_bytes_be(&self) -> Vec<u8>
[src]
Returns the byte representation in a big endian byte array, with leading zeros.
fn to_bytes_le(&self) -> Vec<u8>
[src]
Returns the byte representation in a little endian byte array, with trailing zeros.
fn find_wnaf(&self) -> Vec<i64>
[src]
Returns a vector for wnaf.
Provided methods
fn to_bits_be(&self) -> Vec<bool>
[src]
Returns the bit representation in a big endian boolean array, with leading zeroes.
fn to_bits_le(&self) -> Vec<bool>
[src]
Returns the bit representation in a little endian boolean array, with trailing zeroes.
fn write_le<W: Write>(&self, writer: &mut W) -> IoResult<()>
[src]
Writes this BigInteger
as a big endian integer. Always writes
(num_bits
/ 8) bytes.
fn read_le<R: Read>(&mut self, reader: &mut R) -> IoResult<()>
[src]
Reads a big endian integer occupying (num_bits
/ 8) bytes into this
representation.