X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/catacomb-python/blobdiff_plain/46e6ad89d596d0987f00440c77e42c36f7d347f7..f1b0cf0da6b3bcc530d7f72982278510d94f6456:/share.c diff --git a/share.c b/share.c index 38d966e..2caa718 100644 --- a/share.c +++ b/share.c @@ -1,13 +1,11 @@ /* -*-c-*- - * - * $Id$ * * Secret sharing * * (c) 2005 Straylight/Edgeware */ -/*----- Licensing notice --------------------------------------------------* +/*----- Licensing notice --------------------------------------------------* * * This file is part of the Python interface to Catacomb. * @@ -15,12 +13,12 @@ * 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. @@ -65,7 +63,7 @@ static PyGetSetDef gfshare_pygetset[]= { static PyTypeObject gfshare_pytype_skel = { PyObject_HEAD_INIT(&PyType_Type) 0, /* Header */ - "catacomb.GFShare", /* @tp_name@ */ + "GFShare", /* @tp_name@ */ sizeof(gfshare_pyobj), /* @tp_basicsize@ */ 0, /* @tp_itemsize@ */ @@ -95,7 +93,7 @@ static PyTypeObject gfshare_pytype_skel = { 0, /* @tp_richcompare@ */ 0, /* @tp_weaklistoffset@ */ 0, /* @tp_iter@ */ - 0, /* @tp_iternexr@ */ + 0, /* @tp_iternext@ */ 0, /* @tp_methods@ */ 0, /* @tp_members@ */ gfshare_pygetset, /* @tp_getset@ */ @@ -115,7 +113,7 @@ static PyObject *gfsharesplit_pynew(PyTypeObject *ty, PyObject *arg, PyObject *kw) { char *p; - int n; + Py_ssize_t n; unsigned t; grand *r = &rand_global; gfshare_pyobj *s; @@ -153,7 +151,7 @@ static PyMethodDef gfsharesplit_pymethods[] = { static PyTypeObject gfsharesplit_pytype_skel = { PyObject_HEAD_INIT(&PyType_Type) 0, /* Header */ - "catacomb.GFShareSplit", /* @tp_name@ */ + "GFShareSplit", /* @tp_name@ */ sizeof(gfshare_pyobj), /* @tp_basicsize@ */ 0, /* @tp_itemsize@ */ @@ -183,7 +181,7 @@ static PyTypeObject gfsharesplit_pytype_skel = { 0, /* @tp_richcompare@ */ 0, /* @tp_weaklistoffset@ */ 0, /* @tp_iter@ */ - 0, /* @tp_iternexr@ */ + 0, /* @tp_iternext@ */ gfsharesplit_pymethods, /* @tp_methods@ */ 0, /* @tp_members@ */ 0, /* @tp_getset@ */ @@ -230,7 +228,7 @@ static PyObject *gfsmeth_add(PyObject *me, PyObject *arg) { unsigned i; char *p; - int n; + Py_ssize_t n; if (!PyArg_ParseTuple(arg, "O&s#:add", convuint, &i, &p, &n)) goto end; if (i > 254) VALERR("index must be < 255"); if (n != GFSHARE_S(me)->sz) VALERR("bad share size"); @@ -274,7 +272,7 @@ static PyGetSetDef gfsharejoin_pygetset[]= { static PyTypeObject gfsharejoin_pytype_skel = { PyObject_HEAD_INIT(&PyType_Type) 0, /* Header */ - "catacomb.GFShareJoin", /* @tp_name@ */ + "GFShareJoin", /* @tp_name@ */ sizeof(gfshare_pyobj), /* @tp_basicsize@ */ 0, /* @tp_itemsize@ */ @@ -304,7 +302,7 @@ static PyTypeObject gfsharejoin_pytype_skel = { 0, /* @tp_richcompare@ */ 0, /* @tp_weaklistoffset@ */ 0, /* @tp_iter@ */ - 0, /* @tp_iternexr@ */ + 0, /* @tp_iternext@ */ gfsharejoin_pymethods, /* @tp_methods@ */ 0, /* @tp_members@ */ gfsharejoin_pygetset, /* @tp_getset@ */ @@ -355,7 +353,7 @@ static PyGetSetDef share_pygetset[]= { static PyTypeObject share_pytype_skel = { PyObject_HEAD_INIT(&PyType_Type) 0, /* Header */ - "catacomb.Share", /* @tp_name@ */ + "Share", /* @tp_name@ */ sizeof(share_pyobj), /* @tp_basicsize@ */ 0, /* @tp_itemsize@ */ @@ -385,7 +383,7 @@ static PyTypeObject share_pytype_skel = { 0, /* @tp_richcompare@ */ 0, /* @tp_weaklistoffset@ */ 0, /* @tp_iter@ */ - 0, /* @tp_iternexr@ */ + 0, /* @tp_iternext@ */ 0, /* @tp_methods@ */ 0, /* @tp_members@ */ share_pygetset, /* @tp_getset@ */ @@ -410,7 +408,7 @@ static PyObject *sharesplit_pynew(PyTypeObject *ty, mp *m = 0; share_pyobj *s; char *kwlist[] = { "threshold", "secret", "modulus", "rng", 0 }; - if (!PyArg_ParseTupleAndKeywords(arg, kw, "O&)&|O&O&:new", kwlist, + if (!PyArg_ParseTupleAndKeywords(arg, kw, "O&O&|O&O&:new", kwlist, convuint, &t, convmp, &sec, convmp, &m, convgrand, &r)) goto end; @@ -446,7 +444,7 @@ static PyMethodDef sharesplit_pymethods[] = { static PyTypeObject sharesplit_pytype_skel = { PyObject_HEAD_INIT(&PyType_Type) 0, /* Header */ - "catacomb.ShareSplit", /* @tp_name@ */ + "ShareSplit", /* @tp_name@ */ sizeof(share_pyobj), /* @tp_basicsize@ */ 0, /* @tp_itemsize@ */ @@ -476,7 +474,7 @@ static PyTypeObject sharesplit_pytype_skel = { 0, /* @tp_richcompare@ */ 0, /* @tp_weaklistoffset@ */ 0, /* @tp_iter@ */ - 0, /* @tp_iternexr@ */ + 0, /* @tp_iternext@ */ sharesplit_pymethods, /* @tp_methods@ */ 0, /* @tp_members@ */ 0, /* @tp_getset@ */ @@ -569,7 +567,7 @@ static PyGetSetDef sharejoin_pygetset[]= { static PyTypeObject sharejoin_pytype_skel = { PyObject_HEAD_INIT(&PyType_Type) 0, /* Header */ - "catacomb.ShareJoin", /* @tp_name@ */ + "ShareJoin", /* @tp_name@ */ sizeof(share_pyobj), /* @tp_basicsize@ */ 0, /* @tp_itemsize@ */ @@ -599,7 +597,7 @@ static PyTypeObject sharejoin_pytype_skel = { 0, /* @tp_richcompare@ */ 0, /* @tp_weaklistoffset@ */ 0, /* @tp_iter@ */ - 0, /* @tp_iternexr@ */ + 0, /* @tp_iternext@ */ sharejoin_pymethods, /* @tp_methods@ */ 0, /* @tp_members@ */ sharejoin_pygetset, /* @tp_getset@ */