{
gccipher_pyobj *g = newtype(gccipher_pytype, 0, cc->name);
g->cc = cc;
- g->ty.type.tp_basicsize = sizeof(gcipher_pyobj);
- g->ty.type.tp_base = gcipher_pytype;
+ g->ty.ht_type.tp_basicsize = sizeof(gcipher_pyobj);
+ g->ty.ht_type.tp_base = gcipher_pytype;
Py_INCREF(gcipher_pytype);
- g->ty.type.tp_flags = (Py_TPFLAGS_DEFAULT |
- Py_TPFLAGS_BASETYPE |
- Py_TPFLAGS_HEAPTYPE);
- g->ty.type.tp_alloc = PyType_GenericAlloc;
- g->ty.type.tp_free = 0;
- g->ty.type.tp_new = gcipher_pynew;
- PyType_Ready(&g->ty.type);
+ g->ty.ht_type.tp_flags = (Py_TPFLAGS_DEFAULT |
+ Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_HEAPTYPE);
+ g->ty.ht_type.tp_alloc = PyType_GenericAlloc;
+ g->ty.ht_type.tp_free = 0;
+ g->ty.ht_type.tp_new = gcipher_pynew;
+ PyType_Ready(&g->ty.ht_type);
return ((PyObject *)g);
}
{
gchash_pyobj *g = newtype(gchash_pytype, 0, ch->name);
g->ch = ch;
- g->ty.type.tp_basicsize = sizeof(ghash_pyobj);
- g->ty.type.tp_base = ghash_pytype;
+ g->ty.ht_type.tp_basicsize = sizeof(ghash_pyobj);
+ g->ty.ht_type.tp_base = ghash_pytype;
Py_INCREF(ghash_pytype);
- g->ty.type.tp_flags = (Py_TPFLAGS_DEFAULT |
- Py_TPFLAGS_BASETYPE |
- Py_TPFLAGS_HEAPTYPE);
- g->ty.type.tp_alloc = PyType_GenericAlloc;
- g->ty.type.tp_free = 0;
- g->ty.type.tp_new = ghash_pynew;
- PyType_Ready(&g->ty.type);
+ g->ty.ht_type.tp_flags = (Py_TPFLAGS_DEFAULT |
+ Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_HEAPTYPE);
+ g->ty.ht_type.tp_alloc = PyType_GenericAlloc;
+ g->ty.ht_type.tp_free = 0;
+ g->ty.ht_type.tp_new = ghash_pynew;
+ PyType_Ready(&g->ty.ht_type);
return ((PyObject *)g);
}
{
gcmac_pyobj *g = newtype(gcmac_pytype, 0, cm->name);
g->cm = cm;
- g->ty.type.tp_basicsize = sizeof(gmac_pyobj);
- g->ty.type.tp_base = gmac_pytype;
+ g->ty.ht_type.tp_basicsize = sizeof(gmac_pyobj);
+ g->ty.ht_type.tp_base = gmac_pytype;
Py_INCREF(gmac_pytype);
- g->ty.type.tp_flags = (Py_TPFLAGS_DEFAULT |
- Py_TPFLAGS_BASETYPE |
- Py_TPFLAGS_HEAPTYPE);
- g->ty.type.tp_alloc = PyType_GenericAlloc;
- g->ty.type.tp_free = 0;
- g->ty.type.tp_new = gmac_pynew;
- PyType_Ready(&g->ty.type);
+ g->ty.ht_type.tp_flags = (Py_TPFLAGS_DEFAULT |
+ Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_HEAPTYPE);
+ g->ty.ht_type.tp_alloc = PyType_GenericAlloc;
+ g->ty.ht_type.tp_free = 0;
+ g->ty.ht_type.tp_new = gmac_pynew;
+ PyType_Ready(&g->ty.ht_type);
return ((PyObject *)g);
}
if (!cobj) cobj = gcmac_pywrap((/*unconst*/ gcmac *)GM_CLASS(m));
else Py_INCREF(cobj);
g = newtype((PyTypeObject *)cobj, 0, 0);
- g->ty.name = PyString_FromFormat("%s(keyed)", m->ops->c->name);
- g->ty.type.tp_name = PyString_AS_STRING(g->ty.name);
- g->ty.type.tp_base = gmhash_pytype;
+ g->ty.ht_name = PyString_FromFormat("%s(keyed)", m->ops->c->name);
+ g->ty.ht_type.tp_name = PyString_AS_STRING(g->ty.ht_name);
+ g->ty.ht_type.tp_base = gmhash_pytype;
Py_INCREF(gmac_pytype);
- g->ty.type.tp_flags = (Py_TPFLAGS_DEFAULT |
- Py_TPFLAGS_BASETYPE |
- Py_TPFLAGS_HEAPTYPE);
- g->ty.type.tp_alloc = PyType_GenericAlloc;
- g->ty.type.tp_free = 0;
- g->ty.type.tp_new = gmhash_pynew;
- PyType_Ready(&g->ty.type);
+ g->ty.ht_type.tp_flags = (Py_TPFLAGS_DEFAULT |
+ Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_HEAPTYPE);
+ g->ty.ht_type.tp_alloc = PyType_GenericAlloc;
+ g->ty.ht_type.tp_free = 0;
+ g->ty.ht_type.tp_new = gmhash_pynew;
+ PyType_Ready(&g->ty.ht_type);
g->m = m;
g->f = f;
return ((PyObject *)g);
{
gcprp_pyobj *g = newtype(gcprp_pytype, 0, prp->name);
g->prp = prp;
- g->ty.type.tp_basicsize = sizeof(gprp_pyobj) + prp->ctxsz;
- g->ty.type.tp_base = gprp_pytype;
+ g->ty.ht_type.tp_basicsize = sizeof(gprp_pyobj) + prp->ctxsz;
+ g->ty.ht_type.tp_base = gprp_pytype;
Py_INCREF(gprp_pytype);
- g->ty.type.tp_flags = (Py_TPFLAGS_DEFAULT |
- Py_TPFLAGS_BASETYPE |
- Py_TPFLAGS_HEAPTYPE);
- g->ty.type.tp_alloc = PyType_GenericAlloc;
- g->ty.type.tp_free = 0;
- g->ty.type.tp_new = gprp_pynew;
- PyType_Ready(&g->ty.type);
+ g->ty.ht_type.tp_flags = (Py_TPFLAGS_DEFAULT |
+ Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_HEAPTYPE);
+ g->ty.ht_type.tp_alloc = PyType_GenericAlloc;
+ g->ty.ht_type.tp_free = 0;
+ g->ty.ht_type.tp_new = gprp_pynew;
+ PyType_Ready(&g->ty.ht_type);
return ((PyObject *)g);
}
return (0); \
}
+#if PY_VERSION_HEX < 0x02050000 /* Compatibility hack */
+# define ht_name name
+# define ht_type type
+#endif
+
#define root_pytype 0
#define type_pytype &PyType_Type
#define INITTYPE(ty, base) do { \
python2.3-catacomb
python2.4-catacomb
+python2.5-catacomb
Section: python
Priority: extra
Maintainer: Mark Wooding <mdw@distorted.org.uk>
-Build-Depends: catacomb-dev, python, python2.3-dev, python2.4-dev
+Build-Depends: catacomb-dev, python, python2.3-dev, python2.4-dev, python2.5-dev
Standards-Version: 3.1.1
Package: python-catacomb
Package: python2.3-catacomb
Architecture: any
-Depends: ${shlibs:Depends}, ${python:Depends}
+Depends: ${shlibs:Depends}
Description: Python bindings for the Catacomb cryptographic library.
Catacomb is a cryptographic library. It implements a large number of
encryption algorithms, hash functions, message authentication codes
Package: python2.4-catacomb
Architecture: any
-Depends: ${shlibs:Depends}, ${python:Depends}
+Depends: ${shlibs:Depends}
Description: Python bindings for the Catacomb cryptographic library.
Catacomb is a cryptographic library. It implements a large number of
encryption algorithms, hash functions, message authentication codes
This package contains the Python bindings for Catacomb, for version 2.4 of
Python.
+Package: python2.5-catacomb
+Architecture: any
+Depends: ${shlibs:Depends}
+Description: Python bindings for the Catacomb cryptographic library.
+ Catacomb is a cryptographic library. It implements a large number of
+ encryption algorithms, hash functions, message authentication codes
+ and random number generators. It has a multi-precision maths library,
+ for implementing public key schemes such as RSA, DSA and Diffie-Hellman.
+ It contains rudimentary key-management tools.
+ .
+ The objective of Catacomb is to make a crypto library which is
+ relatively straightforward to audit for security. Its focus is on
+ clarity of source code and portability more than performance.
+ .
+ This package contains the Python bindings for Catacomb, for version 2.5 of
+ Python.
+
Package: python-catacomb-bin
Architecture: all
Depends: python, python-catacomb
export DH_COMPAT = 4
-DEFVERSION = 2.3
-VERSIONS = $(DEFVERSION) 2.4
+DEFVERSION = 2.4
+VERSIONS = $(DEFVERSION) 2.3 2.5
build: build-stamp
eccurve_pyobj *cobj = newtype(ty, 0, c->ops->name);
cobj->c = c;
cobj->fobj = fobj;
- cobj->ty.type.tp_basicsize = sizeof(ecpt_pyobj);
- cobj->ty.type.tp_base = ecptcurve_pytype;
+ cobj->ty.ht_type.tp_basicsize = sizeof(ecpt_pyobj);
+ cobj->ty.ht_type.tp_base = ecptcurve_pytype;
Py_INCREF(ecptcurve_pytype);
- cobj->ty.type.tp_flags = (Py_TPFLAGS_DEFAULT |
- Py_TPFLAGS_BASETYPE |
- Py_TPFLAGS_CHECKTYPES |
- Py_TPFLAGS_HEAPTYPE);
- cobj->ty.type.tp_alloc = PyType_GenericAlloc;
- cobj->ty.type.tp_free = 0;
- cobj->ty.type.tp_new = ecpt_pynew;
- PyType_Ready(&cobj->ty.type);
+ cobj->ty.ht_type.tp_flags = (Py_TPFLAGS_DEFAULT |
+ Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_CHECKTYPES |
+ Py_TPFLAGS_HEAPTYPE);
+ cobj->ty.ht_type.tp_alloc = PyType_GenericAlloc;
+ cobj->ty.ht_type.tp_free = 0;
+ cobj->ty.ht_type.tp_new = ecpt_pynew;
+ PyType_Ready(&cobj->ty.ht_type);
return ((PyObject *)cobj);
}
{
field_pyobj *fobj = newtype(ty, 0, f->ops->name);
fobj->f = f;
- fobj->ty.type.tp_basicsize = sizeof(fe_pyobj);
- fobj->ty.type.tp_base = fe_pytype;
+ fobj->ty.ht_type.tp_basicsize = sizeof(fe_pyobj);
+ fobj->ty.ht_type.tp_base = fe_pytype;
Py_INCREF(fe_pytype);
- fobj->ty.type.tp_flags = (Py_TPFLAGS_DEFAULT |
- Py_TPFLAGS_BASETYPE |
- Py_TPFLAGS_CHECKTYPES |
- Py_TPFLAGS_HEAPTYPE);
- fobj->ty.type.tp_alloc = PyType_GenericAlloc;
- fobj->ty.type.tp_free = 0;
- fobj->ty.type.tp_new = fe_pynew;
- PyType_Ready(&fobj->ty.type);
+ fobj->ty.ht_type.tp_flags = (Py_TPFLAGS_DEFAULT |
+ Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_CHECKTYPES |
+ Py_TPFLAGS_HEAPTYPE);
+ fobj->ty.ht_type.tp_alloc = PyType_GenericAlloc;
+ fobj->ty.ht_type.tp_free = 0;
+ fobj->ty.ht_type.tp_new = fe_pynew;
+ PyType_Ready(&fobj->ty.ht_type);
return ((PyObject *)fobj);
}
{
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);
}
key *k;
int err;
- if (!PyArg_ParseTupleAndKeywords(arg, kw, "O&sl:new", kwlist,
+ if (!PyArg_ParseTupleAndKeywords(arg, kw, "O&s|l:newkey", kwlist,
convu32, &id, &type, &exptime))
goto end;
- if ((err = key_new(KEYFILE_KF(me), id, type, exptime, &k)) == 0)
+ if ((err = key_new(KEYFILE_KF(me), id, type, exptime, &k)) != 0)
KEYERR(err);
return (key_pywrap(me, k));
end:
-#! /usr/bin/python2.2
+#! /usr/bin/python
# -*-python-*-
import catacomb as C
{
gccrand_pyobj *g = newtype(gccrand_pytype, 0, info->name);
g->info = info;
- g->ty.type.tp_basicsize = sizeof(grand_pyobj);
- g->ty.type.tp_base = gcrand_pytype;
+ g->ty.ht_type.tp_basicsize = sizeof(grand_pyobj);
+ g->ty.ht_type.tp_base = gcrand_pytype;
Py_INCREF(gcrand_pytype);
- g->ty.type.tp_flags = (Py_TPFLAGS_DEFAULT |
- Py_TPFLAGS_BASETYPE |
- Py_TPFLAGS_HEAPTYPE);
- g->ty.type.tp_alloc = PyType_GenericAlloc;
- g->ty.type.tp_free = 0;
+ g->ty.ht_type.tp_flags = (Py_TPFLAGS_DEFAULT |
+ Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_HEAPTYPE);
+ g->ty.ht_type.tp_alloc = PyType_GenericAlloc;
+ g->ty.ht_type.tp_free = 0;
if (info->f & RNGF_INT)
- g->ty.type.tp_new = gcirand_pynew;
+ g->ty.ht_type.tp_new = gcirand_pynew;
else
- g->ty.type.tp_new = gcrand_pynew;
- PyType_Ready(&g->ty.type);
+ g->ty.ht_type.tp_new = gcrand_pynew;
+ PyType_Ready(&g->ty.ht_type);
return ((PyObject *)g);
}
(PyHeapTypeObject *)_PyObject_GC_Malloc(_PyObject_VAR_SIZE(metaty, 0));
if (!skel) skel = &emptytype;
memcpy(ty, skel, sizeof(*skel));
- if (ty->type.tp_base) Py_INCREF(ty->type.tp_base);
+ if (ty->ht_type.tp_base) Py_INCREF(ty->ht_type.tp_base);
#define COPY(blah) do { \
- if (ty->type.tp_as_##blah) { \
+ if (ty->ht_type.tp_as_##blah) { \
memcpy(&ty->as_##blah, \
- ty->type.tp_as_##blah, \
+ ty->ht_type.tp_as_##blah, \
sizeof(ty->as_##blah)); \
- ty->type.tp_as_##blah = &ty->as_##blah; \
+ ty->ht_type.tp_as_##blah = &ty->as_##blah; \
} \
} while (0)
COPY(number);
COPY(buffer);
#undef COPY
if (name)
- ty->name = PyString_FromString(name);
- else if (ty->type.tp_name)
- ty->name = PyString_FromString(ty->type.tp_name);
- if (ty->name)
- ty->type.tp_name = PyString_AS_STRING(ty->name);
- PyObject_INIT(&ty->type, metaty);
+ ty->ht_name = PyString_FromString(name);
+ else if (ty->ht_type.tp_name)
+ ty->ht_name = PyString_FromString(ty->ht_type.tp_name);
+ if (ty->ht_name)
+ ty->ht_type.tp_name = PyString_AS_STRING(ty->ht_name);
+ PyObject_INIT(&ty->ht_type, metaty);
Py_INCREF(metaty);
return (ty);
}