@@@ py_buffer/freebin wip
[catacomb-python] / group.c
diff --git a/group.c b/group.c
index 6b26d9d..77c3e9f 100644 (file)
--- a/group.c
+++ b/group.c
@@ -589,7 +589,10 @@ static PyObject *ge_pyexp(PyObject *x, PyObject *n, PyObject *m)
   mp *nn;
   ge *z;
 
-  if (m != Py_None || !GE_PYCHECK(x) || (nn = getmp(n)) == 0)
+  if (m != Py_None || !GE_PYCHECK(x)) RETURN_NOTIMPL;
+  if (FE_PYCHECK(n) && FE_F(n)->ops->ty == FTY_PRIME)
+    nn = F_OUT(FE_F(n), MP_NEW, FE_X(n));
+  else if ((nn = implicitmp(n)) == 0)
     RETURN_NOTIMPL;
   z = G_CREATE(GE_G(x));
   G_EXP(GE_G(x), z, GE_X(x), nn);
@@ -770,7 +773,7 @@ static PyObject *gemeth_toraw(PyObject *me)
   return (rc);
 }
 
-static PyObject *gmexp_exp(PyObject *me, void *pp, int n)
+static PyObject *gmexp_exp(PyObject *me, void *pp, size_t n)
 {
   ge *z = G_CREATE(GROUP_G(me));
   G_MEXP(GROUP_G(me), z, pp, n);