chiark / gitweb /
Overhaul build system using new `cfd' machinery.
[catacomb-python] / algorithms.c
index de7ab75a86332feafe72895ed7df288f38476d9b..16d426d0f8a5b0f3e7a6bf33edc35def295e2dde 100644 (file)
@@ -1,13 +1,11 @@
 /* -*-c-*-
- *
- * $Id$
  *
  * Symmetric cryptography
  *
  * (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.
@@ -47,7 +45,7 @@ PyObject *keysz_pywrap(const octet *k)
     } break;
     case KSZ_RANGE: {
       keyszrange_pyobj *o =
-        PyObject_New(keyszrange_pyobj, keyszrange_pytype);
+       PyObject_New(keyszrange_pyobj, keyszrange_pytype);
       o->dfl = k[1];
       o->min = k[2];
       o->max = k[3];
@@ -57,7 +55,7 @@ PyObject *keysz_pywrap(const octet *k)
     } break;
     case KSZ_SET: {
       keyszset_pyobj *o =
-        PyObject_New(keyszset_pyobj, keyszset_pytype);
+       PyObject_New(keyszset_pyobj, keyszset_pytype);
       int i, n;
       o->dfl = k[1];
       for (i = 0; k[i + 1]; i++) ;
@@ -145,7 +143,7 @@ static PyObject *keyszset_pynew(PyTypeObject *ty,
     if (xx < 0) VALERR("key size cannot be negative");
     PyList_Append(l, x);
     Py_DECREF(x);
-    x = 0;    
+    x = 0;
   }
   Py_DECREF(set);
   if ((set = PySequence_Tuple(l)) == 0) goto end;
@@ -439,7 +437,7 @@ PyObject *gcipher_pywrap(PyObject *cobj, gcipher *c, unsigned f)
   g = PyObject_NEW(gcipher_pyobj, (PyTypeObject *)cobj);
   g->c = c;
   g->f = f;
-  return ((PyObject *)g);  
+  return ((PyObject *)g);
 }
 
 static PyObject *gcipher_pynew(PyTypeObject *ty, PyObject *arg, PyObject *kw)
@@ -455,7 +453,7 @@ static PyObject *gcipher_pynew(PyTypeObject *ty, PyObject *arg, PyObject *kw)
                         GC_INIT(GCCIPHER_CC(ty), k, sz),
                         f_freeme));
 end:
-  return (0);  
+  return (0);
 }
 
 PyObject *gccipher_pywrap(gccipher *cc)
@@ -699,7 +697,7 @@ static PyObject *ghash_pynew(PyTypeObject *ty, PyObject *arg, PyObject *kw)
     goto end;
   return (ghash_pywrap((PyObject *)ty, GH_INIT(GCHASH_CH(ty)), f_freeme));
 end:
-  return (0);  
+  return (0);
 }
 
 PyObject *gchash_pywrap(gchash *ch)
@@ -727,7 +725,7 @@ PyObject *ghash_pywrap(PyObject *cobj, ghash *h, unsigned f)
   g = PyObject_NEW(ghash_pyobj, (PyTypeObject *)cobj);
   g->h = h;
   g->f = f;
-  return ((PyObject *)g);  
+  return ((PyObject *)g);
 }
 
 static void ghash_pydealloc(PyObject *me)
@@ -941,7 +939,7 @@ static PyObject *gmac_pynew(PyTypeObject *ty, PyObject *arg, PyObject *kw)
                      GM_KEY(GCMAC_CM(ty), k, sz),
                      f_freeme));
 end:
-  return (0);  
+  return (0);
 }
 
 static PyObject *gmhash_pynew(PyTypeObject *ty, PyObject *arg, PyObject *kw)
@@ -993,7 +991,7 @@ PyObject *gmac_pywrap(PyObject *cobj, gmac *m, unsigned f)
   PyType_Ready(&g->ty.ht_type);
   g->m = m;
   g->f = f;
-  return ((PyObject *)g);  
+  return ((PyObject *)g);
 }
 
 static void gmac_pydealloc(PyObject *me)
@@ -1203,7 +1201,7 @@ static const struct prpinfo *const gprptab[] = {
 #define PRP_ENTRY(PRE, pre) &pre##_prpinfo,
   PRPS(PRP_ENTRY)
   0
-};    
+};
 
 typedef struct gcprp_pyobj {
   PyHeapTypeObject ty;
@@ -1240,7 +1238,7 @@ static PyObject *gprp_pynew(PyTypeObject *ty, PyObject *arg, PyObject *kw)
   Py_INCREF(me);
   return (me);
 end:
-  return (0);  
+  return (0);
 }
 
 static void gprp_pydealloc(PyObject *me)