goto end;
if ((rp.n && !MP_ODDP(rp.n)) ||
(rp.p && !MP_ODDP(rp.p)) ||
- (rp.p && !MP_ODDP(rp.q)))
+ (rp.q && !MP_ODDP(rp.q)))
VALERR("RSA modulus and factors must be odd");
if (rsa_recover(&rp)) VALERR("couldn't construct private key");
if (rng != Py_None && !GRAND_PYCHECK(rng))
unsigned n = 0;
rsa_priv rp;
mp *e = 0;
- pgev evt = { 0 };
+ struct excinfo exc = EXCINFO_INIT;
+ pypgev evt = { { 0 } };
char *kwlist[] = { "class", "nbits", "event", "rng", "nsteps", "e", 0 };
PyObject *rc = 0;
+ evt.exc = &exc;
if (!PyArg_ParseTupleAndKeywords(arg, kw, "OO&|O&O&O&O&:generate", kwlist,
&me, convuint, &nbits, convpgev, &evt,
convgrand, &r, convuint, &n,
goto end;
if (e) MP_COPY(e);
else e = mp_fromulong(MP_NEW, 65537);
- if (rsa_gen_e(&rp, nbits, e, r, n, evt.proc, evt.ctx))
- PGENERR;
+ if (rsa_gen_e(&rp, nbits, e, r, n, evt.ev.proc, evt.ev.ctx))
+ PGENERR(&exc);
rc = rsapriv_pywrap(&rp);
end:
droppgev(&evt);