ec.c: Fix reported function name in `ec2osp'.
[catacomb-python] / ec.c
diff --git a/ec.c b/ec.c
index 3cd52bc..7fd369d 100644 (file)
--- 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));
 }
 
@@ -301,7 +302,7 @@ static PyObject *epmeth_ec2osp(PyObject *me, PyObject *arg, PyObject *kw)
   int len;
   char *kwlist[] = { "flags", 0 };
 
-  if (!PyArg_ParseTupleAndKeywords(arg, kw, "|i:ectosp", kwlist, &f))
+  if (!PyArg_ParseTupleAndKeywords(arg, kw, "|i:ec2osp", kwlist, &f))
     return (0);
   len = c->f->noctets * 2 + 1;
   rc = bytestring_pywrap(0, len);
@@ -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))