unsigned ql = 0, pl;
unsigned steps = 0;
grand *r = &rand_global;
- pgev evt = { 0 };
+ struct excinfo exc = EXCINFO_INIT;
+ pypgev evt = { { 0 } };
char *kwlist[] =
{ "class", "pbits", "qbits", "event", "rng", "nsteps", 0 };
PyObject *rc = 0;
+ evt.exc = &exc;
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);
rc = fginfo_pywrap(&dp, dhinfo_pytype);
end:
droppgev(&evt);
unsigned ql, pl;
unsigned steps = 0;
grand *r = &rand_global;
- pgev oe = { 0 }, ie = { 0 };
+ struct excinfo exc = EXCINFO_INIT;
+ pypgev oe = { { 0 } }, ie = { { 0 } };
int subgroupp = 1;
unsigned f = 0;
char *kwlist[] = { "class", "pbits", "qbits", "event", "ievent",
mp **v = 0;
PyObject *rc = 0, *vec = 0;
+ oe.exc = ie.exc = &exc;
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,
- 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);
vec = PyList_New(nf);
for (i = 0; i < nf; i++)
PyList_SetItem(vec, i, mp_pywrap(v[i]));
unsigned ql, pl;
unsigned steps = 0;
grand *r = &rand_global;
- pgev evt = { 0 };
+ struct excinfo exc = EXCINFO_INIT;
+ pypgev evt = { { 0 } };
char *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.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),
dsa_seed ds;
char *k;
Py_ssize_t ksz;
- pgev evt = { 0 };
+ struct excinfo exc = EXCINFO_INIT;
+ pypgev evt = { { 0 } };
char *kwlist[] =
{ "class", "pbits", "qbits", "seed", "event", "nsteps", 0 };
PyObject *rc = 0;
+ evt.exc = &exc;
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);