mpn_gcdext bug in v4.3.0?
shoup at cims.nyu.edu
shoup at cims.nyu.edu
Tue Apr 28 19:48:30 CEST 2009
I have been running a number of tests with mpn_gcdext,
and came across what seems to be a bug.
I'm calling it as:
sd = mpn_gcdext(ddata, xadata, &sxa, adata, sa, bdata, sb);
The problem is that the cofactor (xadata, sxa) is not
normalized, where "normalized" means xadata[sxa-1] != 0.
I have found an input where xadata[sxa-1] == 0.
I'm not sure if this is really a bug or not.
I was assuming this was computed so that (xadata, sxa)
was properly "normalized", as usual.
Attached are a small program and input file
that illustrates the bug (compiled on a 64-bit
Mac OSX platform).
I can work around this bug for now by adding
normalization code in my calls to mpn_gcdext.
I will also assume (for now) that (ddata, sd) may also
not be normalized.
If this is not considered a bug, then at least the
documentation should make it clear that the
results may not be normalized.
-- Victor Shoup
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gmp-bug.c
Type: application/octet-stream
Size: 547 bytes
Desc: not available
URL: <http://gmplib.org/list-archives/gmp-bugs/attachments/20090428/824c174c/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: JJJ
Type: application/octet-stream
Size: 435 bytes
Desc: not available
URL: <http://gmplib.org/list-archives/gmp-bugs/attachments/20090428/824c174c/attachment-0001.obj>
More information about the gmp-bugs
mailing list