/* -*-c-*-
- *
- * $Id$
*
* Abstract group inteface
*
* (c) 2004 Straylight/Edgeware
*/
-/*----- Licensing notice --------------------------------------------------*
+/*----- Licensing notice --------------------------------------------------*
*
* This file is part of the Python interface to Catacomb.
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* Catacomb/Python is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with Catacomb/Python; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
}
c = PyInt_FromLong(i);
found:
- PyDict_SetItemString(d, (/*unconst*/ char *)pp[i].name, c);
+ PyDict_SetItemString(d, (/*unconst*/ char *)p, c);
Py_DECREF(c);
}
*ne = i;
- return (d);
+ return (d);
}
static PyObject *meth__groupn(PyObject *me, PyObject *arg,
if (parse(&qd, &gp)) SYNERR(qd.e);
rc = fginfo_pywrap(&gp, ty);
end:
- return (rc);
+ return (rc);
}
static PyObject *meth__DHInfo_parse(PyObject *me, PyObject *arg)
gb.p = gc->r.p;
gb.q = gc->g.r;
g = group_binary(&gb);
- MP_DROP(gb.g);
+ MP_DROP(gb.g);
} else if (strcmp(G_NAME(g), "ec") == 0) {
gctx_ec *gc = (gctx_ec *)g;
ec_info ei;
{
group_pyobj *gobj = newtype(ty, 0, g->ops->name);
gobj->g = g;
- gobj->ty.type.tp_basicsize = sizeof(ge_pyobj);
- gobj->ty.type.tp_base = ge_pytype;
+ gobj->ty.ht_type.tp_basicsize = sizeof(ge_pyobj);
+ gobj->ty.ht_type.tp_base = ge_pytype;
Py_INCREF(group_pytype);
- gobj->ty.type.tp_flags = (Py_TPFLAGS_DEFAULT |
- Py_TPFLAGS_BASETYPE |
- Py_TPFLAGS_CHECKTYPES |
- Py_TPFLAGS_HEAPTYPE);
- gobj->ty.type.tp_alloc = PyType_GenericAlloc;
- gobj->ty.type.tp_free = 0;
- gobj->ty.type.tp_new = ge_pynew;
- PyType_Ready(&gobj->ty.type);
+ gobj->ty.ht_type.tp_flags = (Py_TPFLAGS_DEFAULT |
+ Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_CHECKTYPES |
+ Py_TPFLAGS_HEAPTYPE);
+ gobj->ty.ht_type.tp_alloc = PyType_GenericAlloc;
+ gobj->ty.ht_type.tp_free = 0;
+ gobj->ty.ht_type.tp_new = ge_pynew;
+ PyType_Ready(&gobj->ty.ht_type);
return ((PyObject *)gobj);
}
gmexp_id, gmexp_fill, gmexp_exp, gmexp_drop));
}
-static PyObject *gmeth_check(PyObject *me, PyObject *arg, PyObject *kw)
+static PyObject *gmeth_checkgroup(PyObject *me, PyObject *arg, PyObject *kw)
{
char *kwlist[] = { "rng", 0 };
grand *r = &rand_global;
const char *p;
- if (!PyArg_ParseTupleAndKeywords(arg, kw, "|O&:check", kwlist,
+ if (!PyArg_ParseTupleAndKeywords(arg, kw, "|O&:checkgroup", kwlist,
convgrand, &r))
goto end;
if ((p = G_CHECK(GROUP_G(me), r)) != 0)
#define METHNAME(name) gmeth_##name
METH (mexp, "\
G.mexp([(X0, N0), (X1, N1), ...]) -> X0^N0 X1^N1 ...")
- KWMETH(check, "G.check(rand = random): check group is good")
+ KWMETH(checkgroup, "G.checkgroup(rand = random): check group is good")
#undef METHNAME
{ 0 }
};
METH (_BinDHInfo__groupn, 0)
KWMETH(_DHInfo_generate, "\
generate(PBITS, [qbits = 0, event = pgen_nullev,\n\
- rng = rand, nsteps = 0]) -> D")
+ rng = rand, nsteps = 0]) -> D")
KWMETH(_DHInfo_genlimlee, "\
genlimlee(PBITS, QBITS, [event = pgen_nullev, ievent = pgen_nullev,\n\
- rng = rand, nsteps = 0, subgroupp = True]) -> (D, [Q, ...])")
+ rng = rand, nsteps = 0, subgroupp = True]) -> (D, [Q, ...])")
KWMETH(_DHInfo_gendsa, "\
gendsa(PBITS, QBITS, SEED, [event = pgen_nullev, nsteps = 0])\n\
-> (D, SEED, COUNT)")