pub fn extended_euclid(a: BigInt, b: BigInt) -> (BigInt, BigInt, BigInt) {
        match a == BigInt::zero() {
            true => (b, BigInt::zero(), BigInt::one()),
            false => {
                let (g, x, y) = Self::extended_euclid(&b % &a, a.clone());

                (g, y - (&b / &a) * &x, x)
            }
        }
    }
/*
    Using Extended Euclidean algorithms to find modular multiplicative inverse.
    a * x + b * y = gcd(a, b);
    FYI: https://brilliant.org/wiki/extended-euclidean-algorithm/

    ex. 1914a+899b = gcd(1914,899).
     */
Using Extended Euclidean algorithms to find modular multiplicative inverse.

ex.
Using Extended Euclidean algorithms to find modular multiplicative inverse . ex .
pub fn extended_euclid(a: BigInt, b: BigInt) -> (BigInt, BigInt, BigInt) {
        match a == BigInt::zero() {
            true => (b, BigInt::zero(), BigInt::one()),
            false => {
                let (g, x, y) = Self::extended_euclid(&b % &a, a.clone());
                (g, y - (&b / &a) * &x, x)
            }
        }
    }
pub fn extended_euclid ( a : BigInt , b : BigInt ) -> ( BigInt , BigInt , BigInt ) { match a == BigInt :: zero ( ) { true => ( b , BigInt :: zero ( ) , BigInt :: one ( ) ) , false => { let ( g , x , y ) = Self :: extended_euclid ( & b % & a , a . clone ( ) ) ; ( g , y - ( & b / & a ) * & x , x ) } } }
Using Extended Euclidean algorithms to find modular multiplicative inverse.
Using Extended Euclidean algorithms to find modular multiplicative inverse .
a
BigInt
b
BigInt