Cofactor canonicalisation of mpn_gcdext

Niels Möller nisse at
Thu May 5 22:33:13 CEST 2011

Torbjorn Granlund <tg at> writes:

> $ GMP_CHECK_RANDOMIZE=1498407732 tests/mpz/t-gcd
> Re-seeding with GMP_CHECK_RANDOMIZE=1498407732
> ERROR in test 142
> mpz_gcdext returned invalid result
> op1=0
> op2=0
> mpz_gcdext returns:
> 0
> s=1
> Abort trap: 6

Does that mean that gcdext with inputs u = v = 0 gave the result gcd =
0, s = 1? Or am I misreading the output?

I don't remember off the top of my head what gcdext is supposed to
return in this corner case. I'll try to look into it in the next few
days, if no one else feels like fixing it earlier.


Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26.
Internet email is subject to wholesale government surveillance.

More information about the gmp-devel mailing list