return (0);
}
-static PyGetSetDef ecptnc_pygetset[] = {
+static const PyGetSetDef ecptnc_pygetset[] = {
#define GETSETNAME(op, name) epnc##op##_##name
GET (ix, "P.ix -> integer x coordinate of P")
GET (iy, "P.iy -> integer y coordinate of P")
{ 0 }
};
-static PyMethodDef ecptnc_pymethods[] = {
+static const PyMethodDef ecptnc_pymethods[] = {
#define METHNAME(func) epmeth_##func
METH (tobuf, "X.tobuf() -> BIN")
#undef METHNAME
{ 0 }
};
-static PyNumberMethods ecpt_pynumber = {
+static const PyNumberMethods ecpt_pynumber = {
0, /* @nb_add@ */
0, /* @nb_subtract@ */
0, /* @nb_multiply@ */
0, /* @tp_setattr@ */
0, /* @tp_compare@ */
0, /* @tp_repr@ */
- &ecpt_pynumber, /* @tp_as_number@ */
+ PYNUMBER(ecpt), /* @tp_as_number@ */
0, /* @tp_as_sequence@ */
0, /* @tp_as_mapping@ */
ecpt_pyhash, /* @tp_hash@ */
0, /* @tp_weaklistoffset@ */
0, /* @tp_iter@ */
0, /* @tp_iternext@ */
- ecptnc_pymethods, /* @tp_methods@ */
+ PYMETHODS(ecptnc), /* @tp_methods@ */
0, /* @tp_members@ */
- ecptnc_pygetset, /* @tp_getset@ */
+ PYGETSET(ecptnc), /* @tp_getset@ */
0, /* @tp_base@ */
0, /* @tp_dict@ */
0, /* @tp_descr_get@ */
0 /* @tp_is_gc@ */
};
-static PyGetSetDef ecpt_pygetset[] = {
+static const PyGetSetDef ecpt_pygetset[] = {
#define GETSETNAME(op, name) ep##op##_##name
GET (curve, "P.curve -> elliptic curve containing P")
GET (point, "P.point -> standalone curve point")
{ 0 }
};
-static PyMethodDef ecpt_pymethods[] = {
+static const PyMethodDef ecpt_pymethods[] = {
#define METHNAME(func) epmeth_##func
METH (toraw, "X.toraw() -> BIN")
KWMETH(ec2osp, "X.ec2osp([flags = EC_EXPLY]) -> BIN")
{ 0 }
};
-static PyNumberMethods ecptcurve_pynumber = {
+static const PyNumberMethods ecptcurve_pynumber = {
ecpt_pyadd, /* @nb_add@ */
ecpt_pysub, /* @nb_subtract@ */
ecpt_pymul, /* @nb_multiply@ */
0, /* @tp_setattr@ */
0, /* @tp_compare@ */
0, /* @tp_repr@ */
- &ecptcurve_pynumber, /* @tp_as_number@ */
+ PYNUMBER(ecptcurve), /* @tp_as_number@ */
0, /* @tp_as_sequence@ */
0, /* @tp_as_mapping@ */
0, /* @tp_hash@ */
0, /* @tp_weaklistoffset@ */
0, /* @tp_iter@ */
0, /* @tp_iternext@ */
- ecpt_pymethods, /* @tp_methods@ */
+ PYMETHODS(ecpt), /* @tp_methods@ */
0, /* @tp_members@ */
- ecpt_pygetset, /* @tp_getset@ */
+ PYGETSET(ecpt), /* @tp_getset@ */
0, /* @tp_base@ */
0, /* @tp_dict@ */
0, /* @tp_descr_get@ */
static PyObject *ecget_inf(PyObject *me, void *hunoz)
{ ec inf = EC_INIT; return (ecpt_pywrap(me, &inf)); }
-static PyGetSetDef eccurve_pygetset[] = {
+static const PyGetSetDef eccurve_pygetset[] = {
#define GETSETNAME(op, name) ec##op##_##name
GET (name, "E.name -> name of this kind of curve")
GET (a, "E.a -> first parameter of curve")
{ 0 }
};
-static PyMethodDef eccurve_pymethods[] = {
+static const PyMethodDef eccurve_pymethods[] = {
#define METHNAME(name) ecmeth_##name
METH (mmul, "E.mmul([(P0, N0), (P1, N1), ...]) = N0 P0 + N1 P1 + ...")
METH (find, "E.find(X) -> P")
0, /* @tp_weaklistoffset@ */
0, /* @tp_iter@ */
0, /* @tp_iternext@ */
- eccurve_pymethods, /* @tp_methods@ */
+ PYMETHODS(eccurve), /* @tp_methods@ */
0, /* @tp_members@ */
- eccurve_pygetset, /* @tp_getset@ */
+ PYGETSET(eccurve), /* @tp_getset@ */
0, /* @tp_base@ */
0, /* @tp_dict@ */
0, /* @tp_descr_get@ */
static PyObject *eiget_h(PyObject *me, void *hunoz)
{ return (mp_pywrap(MP_COPY(ECINFO_EI(me)->h))); }
-static PyGetSetDef ecinfo_pygetset[] = {
+static const PyGetSetDef ecinfo_pygetset[] = {
#define GETSETNAME(op, name) ei##op##_##name
GET (curve, "I.curve -> the elliptic curve")
GET (G, "I.G -> generator point for the group")
{ 0 }
};
-static PyMethodDef ecinfo_pymethods[] = {
+static const PyMethodDef ecinfo_pymethods[] = {
#define METHNAME(name) eimeth_##name
KWMETH(check, "I.check([rng = rand]) -> None")
#undef METHNAME
0, /* @tp_weaklistoffset@ */
0, /* @tp_iter@ */
0, /* @tp_iternext@ */
- ecinfo_pymethods, /* @tp_methods@ */
+ PYMETHODS(ecinfo), /* @tp_methods@ */
0, /* @tp_members@ */
- ecinfo_pygetset, /* @tp_getset@ */
+ PYGETSET(ecinfo), /* @tp_getset@ */
0, /* @tp_base@ */
0, /* @tp_dict@ */
0, /* @tp_descr_get@ */
/*----- Setup -------------------------------------------------------------*/
-static PyMethodDef methods[] = {
+static const PyMethodDef methods[] = {
#define METHNAME(func) meth_##func
METH (_ECPt_frombuf, "frombuf(E, STR) -> (P, REST)")
METH (_ECPtCurve_fromraw, "fromraw(E, STR) -> (P, REST)")