From: Mark Wooding Date: Wed, 23 Oct 2019 09:39:23 +0000 (+0100) Subject: field.c: Return the binary-field polynomial as, err, a polynomial. X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb-python/commitdiff_plain/56e8606ccec4aaa4958ec7027d133bbe7b80fb2d field.c: Return the binary-field polynomial as, err, a polynomial. Sharing the extraction code with the prime-field case means it gets returned as an integer. --- diff --git a/field.c b/field.c index d35f1b8..024c578 100644 --- a/field.c +++ b/field.c @@ -801,8 +801,11 @@ end: return (0); } +static PyObject *bfget_p(PyObject *me, void *hunoz) + { return (gf_pywrap(MP_COPY(FIELD_F(me)->m))); } + static PyGetSetDef binpolyfield_pygetset[] = { -#define GETSETNAME(op, name) pf##op##_##name +#define GETSETNAME(op, name) bf##op##_##name GET (p, "F.p -> field polynomial") #undef GETSETNAME { 0 } @@ -881,7 +884,7 @@ static PyObject *bnfget_beta(PyObject *me, void *hunoz) } static PyGetSetDef binnormfield_pygetset[] = { -#define GETSETNAME(op, name) pf##op##_##name +#define GETSETNAME(op, name) bf##op##_##name GET (p, "F.p -> field polynomial") #undef GETSETNAME #define GETSETNAME(op, name) bnf##op##_##name