Cofactor canonicalisation of mpn_gcdext

Niels Möller nisse at
Tue May 3 21:22:14 CEST 2011

Torbjorn Granlund <tg at> writes:

> Should we perhaps keep a compatibility note in the documentation, since
> lean allocation in applications will introduce nasty buffer overrun bugs,
> if linked to GMP 4.3 or older?

Done, and some other minor fixes. Some comments and questions:

* I renamed xp -> up and yp -> vp, to get more consistent notation.

* As far as I understand, GMP 4.3 have the new (leaner) requirements,
  and the compatibility note says the extra limbs are required for
  releases *before* 4.3. Correct?

* The documentation said the needed size for gp and sp is given by the
  size of the larger input, un (or un+1 for the pre 4.3 versions). I
  think this was a typo, and that it's always been given by the smaller
  input vn (or vn+1 in pre 4.3 versions), so I changed this. Correct?

* I found no traces in older documentation of similar issues for
  mpn_gcd. It seems to have been a peculiarity of mpn_gcdext only. So I
  didn't touch the documentation for mpn_gcd.


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