+static PyObject *wbmeth_ec2osp(PyObject *me, PyObject *arg, PyObject *kw)
+{
+ PyTypeObject *ptobj;
+ ec_curve *cc;
+ ec pt = EC_INIT;
+ unsigned f = EC_EXPLY;
+ static const char *const kwlist[] = { "point", "flags", 0 };
+ if (!PyArg_ParseTupleAndKeywords(arg, kw, "O!|O&:os2ecp", KWLIST,
+ ecptcurve_pytype, &ptobj, convuint, &f))
+ goto end;
+ cc = ECPT_C(ptobj);
+ EC_OUT(cc, &pt, ECPT_P(ptobj));
+ if (ensurebuf(me, 2*cc->f->noctets + 1)) return (0);
+ if (ec_ec2osp(cc, f, BUF_B(me), &pt)) VALERR("invalid flags");
+ RETURN_ME;
+end:
+ return (0);
+}
+