X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/catacomb-python/blobdiff_plain/0e29d9164d5cc4e3cafa509cda19de2e025446c1..278e43d0c27875a1355ebaf3bef6d0f5df739626:/ec.c diff --git a/ec.c b/ec.c index 9d4d6e7..c603489 100644 --- a/ec.c +++ b/ec.c @@ -204,8 +204,8 @@ static long ecpt_pyhash(PyObject *me) EC_OUT(ECPT_C(me), &p, ECPT_P(me)); ec_putraw(ECPT_C(me), &b, &p); EC_DESTROY(&p); - xfree(q); h = unihash_hash(&unihash_global, h, BBASE(&b), BLEN(&b)); + xfree(q); return (h % LONG_MAX); } @@ -525,8 +525,8 @@ static PyObject *ecpt_pyint(PyObject *me) PyObject *rc = 0; if (EC_ATINF(ECPT_P(me))) VALERR("point at infinity"); getecptout(&p, me); - if (mp_tolong_checked(p.x, &l)) goto end; - rc = PyInt_FromLong(l); + if (!mp_tolong_checked(p.x, &l, 0)) rc = PyInt_FromLong(l); + else rc = mp_topylong(p.x); end: EC_DESTROY(&p); return (rc); @@ -835,7 +835,7 @@ static PyObject *ecmeth_mmul(PyObject *me, PyObject *arg) static PyObject *meth__ECPtCurve_fromraw(PyObject *me, PyObject *arg) { char *p; - int len; + Py_ssize_t len; buf b; PyObject *rc = 0; ec_curve *cc; @@ -857,7 +857,7 @@ static PyObject *meth__ECPtCurve_os2ecp(PyObject *me, PyObject *arg, PyObject *kw) { char *p; - int len; + Py_ssize_t len; buf b; PyObject *rc = 0; ec_curve *cc; @@ -881,7 +881,7 @@ static PyObject *meth__ECPt_frombuf(PyObject *me, PyObject *arg) { buf b; char *p; - int sz; + Py_ssize_t sz; PyObject *rc = 0; ec pp = EC_INIT;