field.c: Return the binary-field polynomial as, err, a polynomial.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 23 Oct 2019 09:39:23 +0000 (10:39 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 22 Nov 2019 22:18:10 +0000 (22:18 +0000)
Sharing the extraction code with the prime-field case means it gets
returned as an integer.

field.c

diff --git a/field.c b/field.c
index d35f1b8..024c578 100644 (file)
--- 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