X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/catacomb-python/blobdiff_plain/2c1ccbae1631ac8fc3c7332222c38a32e6ad2d17..dc19440f589af46fe314e28bf8c55d8f72d8f9b7:/ec.c diff --git a/ec.c b/ec.c index 3cd52bc..0dd04d2 100644 --- a/ec.c +++ b/ec.c @@ -188,6 +188,7 @@ static PyObject *ecpt_pymul(PyObject *x, PyObject *y) if (ECPT_PYCHECK(x)) { PyObject *t; t = x; x = y; y = t; } if (!ECPT_PYCHECK(y) || (xx = tomp(x)) == 0) RETURN_NOTIMPL; ec_imul(ECPT_C(y), &zz, ECPT_P(y), xx); + MP_DROP(xx); return (ecpt_pywrap(ECPT_COBJ(y), &zz)); } @@ -787,7 +788,11 @@ static PyTypeObject ecptcurve_pytype_skel = { static PyObject *eccurve_pyrichcompare(PyObject *x, PyObject *y, int op) { - int b = ec_samep(ECCURVE_C(x), ECCURVE_C(y)); + int b; + + assert(ECCURVE_PYCHECK(x)); + if (!ECCURVE_PYCHECK(y)) RETURN_NOTIMPL; + b = ec_samep(ECCURVE_C(x), ECCURVE_C(y)); switch (op) { case Py_EQ: break; case Py_NE: b = !b; break; @@ -863,7 +868,7 @@ static PyObject *meth__ECPtCurve_os2ecp(PyObject *me, ec_curve *cc; int f = EC_XONLY | EC_LSB | EC_SORT | EC_EXPLY; ec pp = EC_INIT; - char *kwlist[] = { "buf", "flags", 0 }; + char *kwlist[] = { "class", "buf", "flags", 0 }; if (!PyArg_ParseTupleAndKeywords(arg, kw, "Os#|f:os2ecp", kwlist, &me, &p, &len, &f))