try and avoid depending on mpz_gcdext internals