From: Mark Wooding Date: Mon, 23 Jun 2008 14:07:58 +0000 (+0100) Subject: ec (ecmeth_mmul): Fix point conversion. X-Git-Tag: 1.0.1~5 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/catacomb-python/commitdiff_plain/50bff227f550cbc564d7e2ec479351175a4643b1 ec (ecmeth_mmul): Fix point conversion. Really quite broken. * Firstly, the code tried to copy a point to an uninitialized destination point, which just isn't a good idea. * And secondly, after tediously doing the correct conversion, it just tried to copy the raw point over the top of the correct converted point. Not good, really. --- diff --git a/ec.c b/ec.c index f31670e..9946205 100644 --- a/ec.c +++ b/ec.c @@ -774,10 +774,10 @@ static int ecmmul_fill(void *pp, PyObject *me, PyObject *x, PyObject *m) { ec_mulfactor *f = pp; + EC_CREATE(&f->base); if (getecpt(ECCURVE_C(me), &f->base, x) || (f->exp = getmp(m)) == 0) return (-1); - f->base = *ECPT_P(x); return (0); }