chiark / gitweb /
Use ValueError instead of SyntaxError throughout.
[catacomb-python] / ec.c
diff --git a/ec.c b/ec.c
index d27036eed9c478136bf0fd35d0a9b82490edf07b..13b7798592601d2c174e42d1c7a56a2adc4200c7 100644 (file)
--- a/ec.c
+++ b/ec.c
@@ -436,7 +436,7 @@ static int ecptxl_1(ec_curve *c, ec *p, PyObject *x)
     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);
@@ -817,7 +817,7 @@ static PyObject *meth__ECPtCurve_fromraw(PyObject *me, PyObject *arg)
   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:
@@ -851,7 +851,7 @@ static PyObject *meth__ECPt_parse(PyObject *me, PyObject *arg)
   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);
@@ -975,7 +975,7 @@ static PyObject *meth__ECCurve_parse(PyObject *me, PyObject *arg)
   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);
@@ -1355,7 +1355,7 @@ static PyObject *meth__ECInfo_parse(PyObject *me, PyObject *arg)
   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);