add a gcd fallback if gmp extension is not loaded