static const char *const kwlist[] =
{ "class", "pbits", "qbits", "event", "rng", "nsteps", 0 };
PyObject *rc = 0;
static const char *const kwlist[] =
{ "class", "pbits", "qbits", "event", "rng", "nsteps", 0 };
PyObject *rc = 0;
if (!PyArg_ParseTupleAndKeywords(arg, kw, "OO&|O&O&O&O&:generate", KWLIST,
&me, convuint, &pl, convuint, &ql,
convpgev, &evt, convgrand, &r,
convuint, &steps))
goto end;
if (!PyArg_ParseTupleAndKeywords(arg, kw, "OO&|O&O&O&O&:generate", KWLIST,
&me, convuint, &pl, convuint, &ql,
convpgev, &evt, convgrand, &r,
convuint, &steps))
goto end;
- if (dh_gen(&dp, ql, pl, steps, r, evt.proc, evt.ctx))
- PGENERR;
+ if (dh_gen(&dp, ql, pl, steps, r, evt.ev.proc, evt.ev.ctx))
+ PGENERR(&exc);
if (!PyArg_ParseTupleAndKeywords(arg, kw,
"OO&O&|O&O&O&O&O&:genlimlee", KWLIST,
&me, convuint, &pl, convuint, &ql,
if (!PyArg_ParseTupleAndKeywords(arg, kw,
"OO&O&|O&O&O&O&O&:genlimlee", KWLIST,
&me, convuint, &pl, convuint, &ql,
goto end;
if (subgroupp) f |= DH_SUBGROUP;
if (dh_limlee(&dp, ql, pl, f, steps, r,
goto end;
if (subgroupp) f |= DH_SUBGROUP;
if (dh_limlee(&dp, ql, pl, f, steps, r,
- oe.proc, oe.ctx, ie.proc, ie.ctx, &nf, &v))
- PGENERR;
+ oe.ev.proc, oe.ev.ctx, ie.ev.proc, ie.ev.ctx, &nf, &v))
+ PGENERR(&exc);
static const char *const kwlist[] =
{ "class", "pbits", "qbits", "event", "rng", "nsteps", 0 };
mp *v = MP_NEW;
PyObject *rc = 0;
static const char *const kwlist[] =
{ "class", "pbits", "qbits", "event", "rng", "nsteps", 0 };
mp *v = MP_NEW;
PyObject *rc = 0;
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 (!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.proc, evt.ctx))
- PGENERR;
+ 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_div(&v, 0, dp.p, dp.q);
v = mp_lsr(v, v, 1);
rc = Py_BuildValue("(NN)", fginfo_pywrap(&dp, dhinfo_pytype),
static const char *const kwlist[] =
{ "class", "pbits", "qbits", "seed", "event", "nsteps", 0 };
PyObject *rc = 0;
static const char *const kwlist[] =
{ "class", "pbits", "qbits", "seed", "event", "nsteps", 0 };
PyObject *rc = 0;
if (!PyArg_ParseTupleAndKeywords(arg, kw, "OO&O&s#|O&O&:gendsa", KWLIST,
&me, convuint, &pl, convuint, &ql,
&k, &ksz, convpgev, &evt,
convuint, &steps))
goto end;
if (!PyArg_ParseTupleAndKeywords(arg, kw, "OO&O&s#|O&O&:gendsa", KWLIST,
&me, convuint, &pl, convuint, &ql,
&k, &ksz, convpgev, &evt,
convuint, &steps))
goto end;
- if (dsa_gen(&dp, ql, pl, steps, k, ksz, &ds, evt.proc, evt.ctx))
- PGENERR;
+ if (dsa_gen(&dp, ql, pl, steps, k, ksz, &ds, evt.ev.proc, evt.ev.ctx))
+ PGENERR(&exc);
rc = Py_BuildValue("(NNl)", fginfo_pywrap(&dp, dhinfo_pytype),
bytestring_pywrap(ds.p, ds.sz), (long)ds.count);
xfree(ds.p);
rc = Py_BuildValue("(NNl)", fginfo_pywrap(&dp, dhinfo_pytype),
bytestring_pywrap(ds.p, ds.sz), (long)ds.count);
xfree(ds.p);
METH (check, "X.check() -> check X really belongs to its group")
METH (toint, "X.toint() -> X converted to an integer")
KWMETH(toec, "\
METH (check, "X.check() -> check X really belongs to its group")
METH (toint, "X.toint() -> X converted to an integer")
KWMETH(toec, "\
METH (tobuf, "X.tobuf() -> X in buffer representation")
METH (toraw, "X.toraw() -> X in raw representation")
#undef METHNAME
METH (tobuf, "X.tobuf() -> X in buffer representation")
METH (toraw, "X.toraw() -> X in raw representation")
#undef METHNAME
#define METHNAME(name) gmeth_##name
METH (mexp, "\
G.mexp([(X0, N0), (X1, N1), ...]) -> X0^N0 X1^N1 ...")
#define METHNAME(name) gmeth_##name
METH (mexp, "\
G.mexp([(X0, N0), (X1, N1), ...]) -> X0^N0 X1^N1 ...")
METH (_DHInfo__groupn, 0)
METH (_BinDHInfo__groupn, 0)
KWMETH(_DHInfo_generate, "\
METH (_DHInfo__groupn, 0)
METH (_BinDHInfo__groupn, 0)
KWMETH(_DHInfo_generate, "\
-generate(PBITS, [qbits = 0, event = pgen_nullev,\n\
- rng = rand, nsteps = 0]) -> D")
+generate(PBITS, [qbits = 0], [event = pgen_nullev],\n\
+ [rng = rand], [nsteps = 0]) -> D")
-genlimlee(PBITS, QBITS, [event = pgen_nullev, ievent = pgen_nullev,\n\
- rng = rand, nsteps = 0, subgroupp = True]) -> (D, [Q, ...])")
+genlimlee(PBITS, QBITS, [event = pgen_nullev], [ievent = pgen_nullev],\n\
+ [rng = rand], [nsteps = 0], [subgroupp = True]) -> (D, [Q, ...])")
-gendsa(PBITS, QBITS, SEED, [event = pgen_nullev, nsteps = 0])\n\
+gendsa(PBITS, QBITS, SEED, [event = pgen_nullev], [nsteps = 0])\n\
-gendsa(PBITS, QBITS, [event = pgen_nullev, rng = rand, nsteps = 0])\n\
+gendsa(PBITS, QBITS, [event = pgen_nullev], [rng = rand], [nsteps = 0])\n\