http://benji3up2kxewkqfcq7buxk2xd6zwy3zggnurkrm3l4cvwy2iipvyyad.onion/mirrors/gmpdoc/Number-Theoretic-Functions.html
Function: void mpz_gcdext (mpz_t g , mpz_t s , mpz_t t , const mpz_t a , const mpz_t b ) ¶ Set g to the greatest common divisor of a and b , and in
addition set s and t to coefficients satisfying a * s + b * t = g .
The value in g is always positive, even if one or both of a and b are negative (or zero if both inputs are zero).