ec.c: Fix three-argument point construction.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 18 Oct 2019 20:16:24 +0000 (21:16 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 17 Nov 2019 02:50:40 +0000 (02:50 +0000)
This has been wrong literally forever.

ec.c

diff --git a/ec.c b/ec.c
index c603489..64ac276 100644 (file)
--- a/ec.c
+++ b/ec.c
@@ -419,9 +419,9 @@ static int ecptxl_3(ec_curve *c, ec *p,
 
   if (!x || !y || !z) TYERR("missing argument");
   if (!c) VALERR("internal form with no curve!");
-  if ((p->x == coord_in(c->f, x)) == 0 ||
-      (p->y == coord_in(c->f, y)) == 0 ||
-      (z != Py_None && (p->z = coord_in(c->f, z))) == 0)
+  if ((p->x = coord_in(c->f, x)) == 0 ||
+      (p->y = coord_in(c->f, y)) == 0 ||
+      (z != Py_None && (p->z = coord_in(c->f, z)) == 0))
     goto end;
   if (!p->z) p->z = MP_COPY(c->f->one); /* just in case */
   rc = 0;