X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/catacomb-python/blobdiff_plain/b2687a0a4b3c5e45cad7c5815a6d3805bfc8d4f1..ab5212e53b51e516f086e20b66c121d966967a9a:/ec.c?ds=sidebyside diff --git a/ec.c b/ec.c index 67bbeef..21aa352 100644 --- a/ec.c +++ b/ec.c @@ -1,6 +1,4 @@ /* -*-c-*- - * - * $Id$ * * Elliptic curves * @@ -233,7 +231,8 @@ end: static PyObject *epmeth_oncurvep(PyObject *me, PyObject *arg) { if (!PyArg_ParseTuple(arg, ":oncurvep")) return (0); - return (getbool(!ec_check(ECPT_C(me), ECPT_P(me)))); + return (getbool(EC_ATINF(ECPT_P(me)) || + !EC_CHECK(ECPT_C(me), ECPT_P(me)))); } static PyObject *epmeth_dbl(PyObject *me, PyObject *arg) @@ -773,10 +772,10 @@ static int ecmmul_fill(void *pp, PyObject *me, PyObject *x, PyObject *m) { ec_mulfactor *f = pp; + EC_CREATE(&f->base); if (getecpt(ECCURVE_C(me), &f->base, x) || (f->exp = getmp(m)) == 0) return (-1); - f->base = *ECPT_P(x); return (0); } @@ -1528,7 +1527,7 @@ static PyObject *namedcurves(void) } c = PyInt_FromLong(i); found: - PyDict_SetItemString(d, (/*unconst*/ char *)ectab[i].name, c); + PyDict_SetItemString(d, (/*unconst*/ char *)p, c); Py_DECREF(c); } ncurves = i;