+static PyObject *meth__DHInfo_genkcdsa(PyObject *me,
+ PyObject *arg, PyObject *kw)
+{
+ dh_param dp;
+ unsigned ql, pl;
+ unsigned steps = 0;
+ grand *r = &rand_global;
+ struct excinfo exc = EXCINFO_INIT;
+ pypgev evt = { { 0 } };
+ static const char *const kwlist[] =
+ { "class", "pbits", "qbits", "event", "rng", "nsteps", 0 };
+ mp *v = MP_NEW;
+ PyObject *rc = 0;
+
+ evt.exc = &exc;
+ if (!PyArg_ParseTupleAndKeywords(arg, kw, "OO&O&|O&O&O&:genkcdsa", KWLIST,
+ &me, convuint, &pl, convuint, &ql,
+ convpgev, &evt, convgrand, &r,
+ convuint, &steps))
+ goto end;
+ if (dh_kcdsagen(&dp, ql, pl, 0, steps, r, evt.ev.proc, evt.ev.ctx))
+ PGENERR(&exc);
+ mp_div(&v, 0, dp.p, dp.q);
+ v = mp_lsr(v, v, 1);
+ rc = Py_BuildValue("(NN)", fginfo_pywrap(&dp, dhinfo_pytype),
+ mp_pywrap(v));
+end:
+ droppgev(&evt);
+ return (rc);
+}
+