#define VALERR(str) EXCERR(PyExc_ValueError, str)
#define TYERR(str) EXCERR(PyExc_TypeError, str)
#define ZDIVERR(str) EXCERR(PyExc_ZeroDivisionError, str)
-#define SYNERR(str) EXCERR(PyExc_SyntaxError, str)
#define SYSERR(str) EXCERR(PyExc_SystemError, str)
#define NIERR(str) EXCERR(PyExc_NotImplementedError, str)
#define INDEXERR(idx) do { \
qd.p = q;
qd.e = 0;
if (!ec_ptparse(&qd, p))
- SYNERR(qd.e);
+ VALERR(qd.e);
goto fix;
} else if (c && (xx = tomp(x)) != 0) {
xx = F_IN(c->f, xx, xx);
buf_init(&b, p, len);
cc = ECCURVE_C(me);
if (ec_getraw(cc, &b, &pp))
- SYNERR("bad point");
+ VALERR("bad point");
EC_IN(cc, &pp, &pp);
rc = Py_BuildValue("(NN)", ecpt_pywrap(me, &pp), bytestring_pywrapbuf(&b));
end:
if (!PyArg_ParseTuple(arg, "Os:parse", &me, &p)) goto end;
qd.p = p;
qd.e = 0;
- if (!ec_ptparse(&qd, &pp)) SYNERR(qd.e);
+ if (!ec_ptparse(&qd, &pp)) VALERR(qd.e);
rc = Py_BuildValue("(Ns)", ecpt_pywrapout(me, &pp), qd.p);
end:
return (rc);
qd.p = p;
qd.e = 0;
if ((c = ec_curveparse(&qd)) == 0)
- SYNERR(qd.e);
+ VALERR(qd.e);
rc = eccurve_pywrap(0, c);
end:
return (rc);
qd.p = p;
qd.e = 0;
if (ec_infoparse(&qd, &ei))
- SYNERR(qd.e);
+ VALERR(qd.e);
rc = Py_BuildValue("(Ns)", ecinfo_pywrap(&ei), qd.p);
end:
return (rc);
qd.p = p;
qd.e = 0;
if ((f = field_parse(&qd)) == 0)
- SYNERR(qd.e);
+ VALERR(qd.e);
rc = Py_BuildValue("(Ns)", field_pywrap(f), qd.p);
end:
return (rc);
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);
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));
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)));
end:
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);
if (!good_radix_p(r, 1)) VALERR("bad radix");
sc.buf = p; sc.lim = p + len;
if ((zz = mp_read(MP_NEW, r, &mptext_stringops, &sc)) == 0)
- SYNERR("bad integer");
+ VALERR("bad integer");
z = Py_BuildValue("(Ns#)", mp_pywrap(zz), sc.buf, (int)(sc.lim - sc.buf));
end:
return (z);
if ((zz = mp_read(MP_NEW, r, &mptext_stringops, &sc)) == 0 ||
MP_NEGP(zz)) {
if (zz) MP_DROP(zz);
- SYNERR("bad binary polynomial");
+ VALERR("bad binary polynomial");
}
z = Py_BuildValue("(Ns#)", gf_pywrap(zz), sc.buf, (int)(sc.lim - sc.buf));
end: