Trait snarkvm_utilities::biginteger::biginteger::BigInteger [−][src]
pub trait BigInteger: ToBits + FromBits + ToBytes + FromBytes + Copy + Clone + Debug + Default + Display + Eq + Ord + Send + Sized + Sync + 'static + UniformRand + AsMut<[u64]> + AsRef<[u64]> + From<u64> { const NUM_LIMBS: usize; 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 find_wnaf(&self) -> Vec<i64>ⓘ; }
Expand description
TODO (howardwu): Update to use ToBits.
This defines a BigInteger
, a smart wrapper around a
sequence of u64
limbs, least-significant digit first.
Associated Constants
Required methods
fn add_nocarry(&mut self, other: &Self) -> bool
fn add_nocarry(&mut self, other: &Self) -> bool
Add another representation to this one, returning the carry bit.
fn sub_noborrow(&mut self, other: &Self) -> bool
fn sub_noborrow(&mut self, other: &Self) -> bool
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.
Compute the number of bits needed to encode this number. Always a multiple of 64.