pub trait BigInt: 'static + Default + From<i64> + for<'a> From<&'a [u8]> + Clone + Sized + Send + Sync + Eq + PartialOrd + Serialize + for<'de> Deserialize<'de> + Debug + Display + LowerHex + UpperHex {
fn add<'a>(&self, other: &'a Self) -> Self;
fn sub<'a>(&self, other: &'a Self) -> Self;
fn mul<'a>(&self, other: &'a Self) -> Self;
fn div<'a>(&self, other: &'a Self) -> Self;
fn gcdext<'a>(&self, y: &'a Self) -> (Self, Self, Self);
fn modulus<'a>(&self, m: &'a Self) -> Self;
fn powm<'a>(&self, e: &'a Self, m: &Self) -> Self;
fn invert<'a>(&self, m: &'a Self) -> Option<Self>;
fn next_prime(&self) -> Self;
fn size_in_bits(&self) -> usize;
fn to_vec(&self) -> Vec<u8>;
}Expand description
A trait describing an arbitrary precision integer.
Required Methods§
sourcefn gcdext<'a>(&self, y: &'a Self) -> (Self, Self, Self)
fn gcdext<'a>(&self, y: &'a Self) -> (Self, Self, Self)
Returns the greatest common divisor of self and the coefficients a
and b satisfying a*x + b*y = g.
sourcefn next_prime(&self) -> Self
fn next_prime(&self) -> Self
Returns the next prime greater than self.
sourcefn size_in_bits(&self) -> usize
fn size_in_bits(&self) -> usize
Returns the size of the number in bits.