X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb-python/blobdiff_plain/dc0757504af5097a4bb323d64e429a99f86d1076..452714b53759e3cdeb3cbf2e181b3456386baae9:/group.c diff --git a/group.c b/group.c index 0fc8eb2..1432fc8 100644 --- a/group.c +++ b/group.c @@ -184,7 +184,7 @@ static PyObject *meth__DHInfo_gendsa(PyObject *me, unsigned steps = 0; dsa_seed ds; char *k; - int ksz; + Py_ssize_t ksz; pgev evt = { 0 }; char *kwlist[] = { "class", "pbits", "qbits", "seed", "event", "nsteps", 0 }; @@ -264,7 +264,7 @@ static PyObject *meth__parse(PyObject *me, PyObject *arg, PyTypeObject *ty, if (!PyArg_ParseTuple(arg, "Os:parse", &me, &p)) goto end; qd.p = p; qd.e = 0; - if (parse(&qd, &gp)) SYNERR(qd.e); + if (parse(&qd, &gp)) VALERR(qd.e); rc = fginfo_pywrap(&gp, ty); end: return (rc); @@ -517,7 +517,7 @@ static PyObject *ge_pynew(PyTypeObject *ty, PyObject *arg, PyObject *kw) sc.buf = PyString_AS_STRING(x); sc.lim = sc.buf + PyString_GET_SIZE(x); if (G_READ(g, xx, &mptext_stringops, &sc) || sc.buf < sc.lim) - SYNERR("malformed group element string"); + VALERR("malformed group element string"); } else TYERR("can't convert to group element"); return (ge_pywrap((PyObject *)ty, xx)); @@ -815,7 +815,7 @@ static PyObject *meth__GE_frombuf(PyObject *me, PyObject *arg) { buf b; char *p; - int n; + Py_ssize_t n; group *g; ge *x = 0; @@ -836,7 +836,7 @@ static PyObject *meth__GE_fromraw(PyObject *me, PyObject *arg) { buf b; char *p; - int n; + Py_ssize_t n; group *g; ge *x = 0; @@ -857,7 +857,7 @@ static PyObject *meth__GE_fromstring(PyObject *me, PyObject *arg) { mptext_stringctx sc; char *p; - int n; + Py_ssize_t n; group *g; ge *x = 0; @@ -868,9 +868,9 @@ static PyObject *meth__GE_fromstring(PyObject *me, PyObject *arg) g = GROUP_G(me); x = G_CREATE(g); if (G_READ(g, x, &mptext_stringops, &sc)) - SYNERR("bad group element string"); + VALERR("bad group element string"); return (Py_BuildValue("(Ns#)", ge_pywrap(me, x), - sc.buf, (int)(sc.lim - sc.buf))); + sc.buf, (Py_ssize_t)(sc.lim - sc.buf))); end: if (x) G_DESTROY(g, x); return (0); @@ -887,7 +887,7 @@ static PyObject *meth__Group_parse(PyObject *me, PyObject *arg) qd.p = p; qd.e = 0; if ((g = group_parse(&qd)) == 0) - SYNERR(qd.e); + VALERR(qd.e); return (group_pywrap(g)); end: return (0); @@ -1122,7 +1122,7 @@ static PyObject *pgget_info(PyObject *me, void *hunoz) gctx_prime *gg = (gctx_prime *)GROUP_G(me); dp.p = MP_COPY(gg->mm.m); dp.q = MP_COPY(gg->g.r); - dp.g = mpmont_reduce(&gg->mm, MP_NEW, gg->gen); + dp.g = mpmont_reduce(&gg->mm, MP_NEW, gg->gen.x); return (fginfo_pywrap(&dp, dhinfo_pytype)); } @@ -1199,7 +1199,7 @@ static PyObject *bgget_info(PyObject *me, void *hunoz) gctx_bin *gg = (gctx_bin *)GROUP_G(me); dp.p = MP_COPY(gg->r.p); dp.q = MP_COPY(gg->g.r); - dp.g = MP_COPY(gg->gen); + dp.g = MP_COPY(gg->gen.x); return (fginfo_pywrap(&dp, bindhinfo_pytype)); }