use gmp::mpz::Mpz;
#[cfg_attr(docsrs, doc(cfg(feature = "gmp")))]
impl crate::BigInt for Mpz {
fn from_i64(v: i64) -> Self {
return v.into()
}
fn from_bytes_be(bytes: &[u8]) -> Self {
bytes.into()
}
fn to_bytes_be(&self) -> Vec<u8> {
self.into()
}
fn gcdext(&self, y: &Self) -> (Self, Self, Self) {
let (g, a, b) = Mpz::gcdext(self, y);
(g.into(), a.into(), b.into())
}
fn powm(&self, e: &Self, m: &Self) -> Self {
Mpz::powm(self, e, m)
}
fn size_in_bits(&self) -> usize {
Mpz::size_in_base(self, 2)
}
}