General: Fix lots of whitespace issues.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 17 Feb 2007 12:18:00 +0000 (12:18 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 17 Feb 2007 12:22:30 +0000 (12:22 +0000)
23 files changed:
MANIFEST.in
README
algorithms.c
algorithms.py
buffer.c
bytestring.c
catacomb-python.h
catacomb.c
catacomb/__init__.py
catacomb/pwsafe.py
ec.c
field.c
group.c
key.c
mp.c
passphrase.c
pgen.c
pubkey.c
pwsafe
rand.c
setup.py
share.c
util.c

index e8a4bb9..af5f781 100644 (file)
@@ -3,5 +3,5 @@ include *.c *.h
 include algorithms.py
 include pwsafe
 include debian/rules debian/control debian/changelog debian/copyright
-recursive-include catacomb *.py 
+recursive-include catacomb *.py
 prune py
diff --git a/README b/README
index 699d922..bd28614 100644 (file)
--- a/README
+++ b/README
@@ -63,7 +63,7 @@ Class hierarchy
          gmhash
            [gmac objects]
 
-ecinfo(curve = ecprimeprojcurve(), 
+ecinfo(curve = ecprimeprojcurve(),
       G = ecprimeprojcurve()(),
       r = 115792089210356248762697446949407573529996955224135760342422259061068512044369,
-      h = 1)
\ No newline at end of file
+      h = 1)
index de7ab75..ea52434 100644 (file)
@@ -7,7 +7,7 @@
  * (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 +47,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 +57,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 +145,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 +439,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 +455,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 +699,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 +727,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 +941,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 +993,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 +1203,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 +1240,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)
index 2348705..3aae0f0 100644 (file)
@@ -47,7 +47,7 @@ for i in prps:
   for j in pmodes:
     print '#include <catacomb/%s-%s.h>' % (i, j)
 for i in streamciphers:
-  print '#include <catacomb/%s.h>' % i  
+  print '#include <catacomb/%s.h>' % i
 print
 for i in hashes:
   print '#include <catacomb/%s.h>' % i
@@ -58,7 +58,7 @@ print
 print '#define PRPS(_) \\'
 for i in prps:
   print '  _(%s, %s) \\' % (i.upper(), i)
-print '  /* end */'
+print '         /* end */'
 print
 
 print '#define RNGF_INT 1u'
@@ -67,13 +67,13 @@ print
 print '#define RNGS(_) \\'
 for i in (cross(prps, ['ofb', 'counter'])):
   print ('  _("%(prim)s-%(mode)s", %(prim)s_keysz, ' +
-         '%(prim)s_%(mode)srand, 0) \\') % \
-         {'prim': i[0], 'mode': i[1]}
+        '%(prim)s_%(mode)srand, 0) \\') % \
+        {'prim': i[0], 'mode': i[1]}
 for i in (cross(hashes, 'mgf')):
   print ('  _("%(prim)s-%(mode)s", %(prim)s_%(mode)skeysz, ' +
-         '%(prim)s_%(mode)srand, 0) \\') % \
-         {'prim': i[0], 'mode': i[1]}
-print '  _("rc4", rc4_keysz, rc4_rand, 0) \\'
-print '  _("seal", seal_keysz, seal_rand, RNGF_INT) \\'
-print '  /* end */'
+        '%(prim)s_%(mode)srand, 0) \\') % \
+        {'prim': i[0], 'mode': i[1]}
+print '         _("rc4", rc4_keysz, rc4_rand, 0) \\'
+print '         _("seal", seal_keysz, seal_rand, RNGF_INT) \\'
+print '         /* end */'
 print
index 7220d84..af4e1bf 100644 (file)
--- a/buffer.c
+++ b/buffer.c
@@ -7,7 +7,7 @@
  * (c) 2005 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.
@@ -186,7 +186,7 @@ static PyObject *rbmeth_getecpt(PyObject *me, PyObject *arg, PyObject *kw)
 end:
   return (0);
 }
-    
+
 static PyObject *rbmeth_getecptraw(PyObject *me, PyObject *arg)
 {
   PyTypeObject *cobj = ecpt_pytype;
index fac797c..d6bd900 100644 (file)
@@ -7,7 +7,7 @@
  * (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.
index 79034af..dafe0fd 100644 (file)
@@ -7,7 +7,7 @@
  * (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.
 
 #define INSERT(name, ob) do {                                          \
   PyObject *_o = (PyObject *)(ob);                                     \
-  Py_INCREF(_o);                                                       \
+  Py_INCREF(_o);                                                       \
   PyModule_AddObject(mod, name, _o);                                   \
 } while (0)
 
@@ -267,7 +267,7 @@ extern PyMethodDef *donemethods(void);
   METH (items,         "D.items() -> LIST")                            \
   METH (iterkeys,      "D.iterkeys() -> ITER")                         \
   METH (itervalues,    "D.itervalues() -> ITER")                       \
-  METH (iteritems,     "D.iteritems() -> ITER")                        \
+  METH (iteritems,     "D.iteritems() -> ITER")                        \
   KWMETH(get,          "D.get(KEY, [default = None]) -> VALUE")        \
 
 #define GMAP_DOMETHODS(METH, KWMETH)                                   \
@@ -338,7 +338,7 @@ typedef struct fe_pyobj {
   field *f;
   mp *x;
 } fe_pyobj;
-      
+
 extern PyTypeObject *field_pytype;
 extern PyTypeObject *primefield_pytype;
 extern PyTypeObject *niceprimefield_pytype;
@@ -394,7 +394,7 @@ typedef struct ecinfo_pyobj {
   ec_info ei;
   PyObject *cobj;
 } ecinfo_pyobj;
-      
+
 extern PyTypeObject *ecinfo_pytype;
 #define ECINFO_PYCHECK(o) PyObject_TypeCheck((o), ecinfo_pytype)
 #define ECINFO_EI(o) (&((ecinfo_pyobj *)(o))->ei)
@@ -560,7 +560,7 @@ extern PyObject *gmac_pywrap(PyObject *, gmac *, unsigned);
 extern int convgmac(PyObject *, void *);
 
 /*----- Key generation ----------------------------------------------------*/
-    
+
 typedef struct pfilt_pyobj {
   PyObject_HEAD
   pfilt f;
index 65d3985..29f09ac 100644 (file)
@@ -7,7 +7,7 @@
  * (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.
index 6f80254..cda656d 100644 (file)
 # 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.
@@ -46,17 +46,17 @@ def _init():
     if i[0] != '_':
       d[i] = b[i];
   for i in ['MP', 'GF', 'Field',
-            'ECPt', 'ECPtCurve', 'ECCurve', 'ECInfo',
-            'DHInfo', 'BinDHInfo', 'RSAPriv', 'BBSPriv',
-            'PrimeFilter', 'RabinMiller',
-            'Group', 'GE',
-            'KeyData']:
+           'ECPt', 'ECPtCurve', 'ECCurve', 'ECInfo',
+           'DHInfo', 'BinDHInfo', 'RSAPriv', 'BBSPriv',
+           'PrimeFilter', 'RabinMiller',
+           'Group', 'GE',
+           'KeyData']:
     c = d[i]
     pre = '_' + i + '_'
     plen = len(pre)
     for j in b:
       if j[:plen] == pre:
-        setattr(c, j[plen:], classmethod(b[j]))
+       setattr(c, j[plen:], classmethod(b[j]))
   for i in [gcciphers, gchashes, gcmacs, gcprps]:
     for c in i.itervalues():
       d[c.name.replace('-', '_')] = c
@@ -179,7 +179,7 @@ _augment(ECPt, _tmp)
 class _tmp:
   def __repr__(me):
     return 'ECInfo(curve = %r, G = %r, r = %s, h = %s)' % \
-           (me.curve, me.G, me.r, me.h)
+          (me.curve, me.G, me.r, me.h)
   def group(me):
     return ECGroup(me)
 _augment(ECInfo, _tmp)
@@ -204,7 +204,7 @@ _augment(KeySZAny, _tmp)
 class _tmp:
   def __repr__(me):
     return 'KeySZRange(%d, %d, %d, %d)' % \
-           (me.default, me.min, me.max, me.mod)
+          (me.default, me.min, me.max, me.mod)
   def check(me, sz): return me.min <= sz <= me.max and sz % me.mod == 0
   def best(me, sz):
     if sz < me.min: raise ValueError, 'key too small'
@@ -228,7 +228,7 @@ _augment(KeySZSet, _tmp)
 class _tmp:
   def __repr__(me):
     return '%s(p = %s, r = %s, g = %s)' % \
-           (type(me).__name__, me.p, me.r, me.g)
+          (type(me).__name__, me.p, me.r, me.g)
 _augment(FGInfo, _tmp)
 
 class _tmp:
@@ -292,7 +292,7 @@ class PSS (object):
     return _base._pss_encode(msg, nbits, me.mgf, me.hash, me.saltsz, me.rng)
   def decode(me, msg, sig, nbits):
     return _base._pss_decode(msg, sig, nbits,
-                             me.mgf, me.hash, me.saltsz, me.rng)
+                            me.mgf, me.hash, me.saltsz, me.rng)
 
 class _tmp:
   def encrypt(me, msg, enc):
@@ -303,7 +303,7 @@ class _tmp:
       x = enc.decode(msg, me.pubop(sig), me.n.nbits)
       return x is None or x == msg
     except ValueError:
-      return False      
+      return False
 _augment(RSAPub, _tmp)
 
 class _tmp:
@@ -504,20 +504,20 @@ class SimulTester (PrimeGenEventHandler):
 def sgprime(start, step = 2, name = 'p', event = pgen_nullev, nsteps = 0):
   start = MP(start)
   return pgen(start, name, SimulStepper(step = step), SimulTester(), event,
-              nsteps, RabinMiller.iters(start.nbits))
+             nsteps, RabinMiller.iters(start.nbits))
 
 def findprimitive(mod, hh = [], exp = None, name = 'g', event = pgen_nullev):
   return pgen(0, name, PrimitiveStepper(), PrimitiveTester(mod, hh, exp),
-              event, 0, 1)
+             event, 0, 1)
 
 def kcdsaprime(pbits, qbits, rng = rand,
-               event = pgen_nullev, name = 'p', nsteps = 0):
+              event = pgen_nullev, name = 'p', nsteps = 0):
   hbits = pbits - qbits
   h = pgen(rng.mp(hbits, 1), name + ' [h]',
-           PrimeGenStepper(2), PrimeGenTester(),
-           event, nsteps, RabinMiller.iters(hbits))
+          PrimeGenStepper(2), PrimeGenTester(),
+          event, nsteps, RabinMiller.iters(hbits))
   q = pgen(rng.mp(qbits, 1), name, SimulStepper(2 * h, 1, 2),
-           SimulTester(2 * h, 1), event, nsteps, RabinMiller.iters(qbits))
+          SimulTester(2 * h, 1), event, nsteps, RabinMiller.iters(qbits))
   p = 2 * q * h + 1
   return p, q, h
 
index 823b47f..bfd4e86 100644 (file)
@@ -29,14 +29,14 @@ class Crypto (object):
     iv = y[:me.c.__class__.blksz]
     if me.c.__class__.blksz: me.c.setiv(iv)
     return me.c.decrypt(y[me.c.__class__.blksz:])
-  
+
 class PPK (Crypto):
   def __init__(me, pp, c, h, m, salt = None):
     if not salt: salt = _C.rand.block(h.hashsz)
     tag = '%s\0%s' % (pp, salt)
     Crypto.__init__(me, c, h, m,
-                  h().hash('cipher:' + tag).done(),
-                  h().hash('mac:' + tag).done())
+                 h().hash('cipher:' + tag).done(),
+                 h().hash('mac:' + tag).done())
     me.salt = salt
 
 class Buffer (object):
@@ -70,9 +70,9 @@ class PWIter (object):
     k = me.k
     while True:
       if k is None:
-        raise StopIteration
+       raise StopIteration
       if k[0] == '$':
-        break
+       break
       k = me.pw.db.nextkey(k)
     me.k = me.pw.db.nextkey(k)
     return me.pw.unpack(me.pw.db[k])[0]
@@ -100,7 +100,7 @@ class PW (object):
     tag = me.db['tag']
     _C.ppcancel(tag)
     ppk = PPK(_C.ppread(tag, _C.PMODE_VERIFY),
-              me.k.c.__class__, me.k.h, me.k.m.__class__)
+             me.k.c.__class__, me.k.h, me.k.m.__class__)
     me.db['key'] = ppk.encrypt(_wrapstr(me.ck) + _wrapstr(me.mk))
     me.db['salt'] = ppk.salt
   def pack(me, key, value):
diff --git a/ec.c b/ec.c
index fcbb8c2..67bbeef 100644 (file)
--- a/ec.c
+++ b/ec.c
@@ -7,7 +7,7 @@
  * (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.
@@ -984,7 +984,7 @@ static PyObject *ecget_name(PyObject *me, void *hunoz)
 static PyObject *ecget_a(PyObject *me, void *hunoz)
   { return (fe_pywrap(ECCURVE_FOBJ(me), MP_COPY(ECCURVE_C(me)->a))); }
 
-static PyObject *ecget_b(PyObject *me, void *hunoz) 
+static PyObject *ecget_b(PyObject *me, void *hunoz)
   { return (fe_pywrap(ECCURVE_FOBJ(me), MP_COPY(ECCURVE_C(me)->b))); }
 
 static PyObject *ecget_field(PyObject *me, void *hunoz)
@@ -1002,7 +1002,7 @@ static PyGetSetDef eccurve_pygetset[] = {
   GET  (inf,           "E.inf -> point at infinity of this curve")
 #undef GETSETNAME
   { 0 }
-};  
+};
 
 static PyMethodDef eccurve_pymethods[] = {
 #define METHNAME(name) ecmeth_##name
@@ -1487,12 +1487,12 @@ static PyTypeObject ecinfo_pytype_skel = {
 
 static PyMethodDef methods[] = {
 #define METHNAME(func) meth_##func
-  METH (_ECPt_frombuf,         "frombuf(E, STR) -> (P, REST)")
-  METH (_ECPtCurve_fromraw,    "fromraw(E, STR) -> (P, REST)")
-  METH (_ECPt_parse,           "parse(E, STR) -> (P, REST)")
-  METH (_ECCurve_parse,        "parse(STR) -> (E, REST)")
-  METH (_ECInfo_parse,         "parse(STR) -> (I, REST)")
-  METH (_ECInfo__curven,       "_curven(N) -> I")
+  METH (_ECPt_frombuf,         "frombuf(E, STR) -> (P, REST)")
+  METH (_ECPtCurve_fromraw,    "fromraw(E, STR) -> (P, REST)")
+  METH (_ECPt_parse,           "parse(E, STR) -> (P, REST)")
+  METH (_ECCurve_parse,        "parse(STR) -> (E, REST)")
+  METH (_ECInfo_parse,         "parse(STR) -> (I, REST)")
+  METH (_ECInfo__curven,       "_curven(N) -> I")
 #undef METHNAME
   { 0 }
 };
diff --git a/field.c b/field.c
index 9f51f5f..af7a561 100644 (file)
--- a/field.c
+++ b/field.c
@@ -7,7 +7,7 @@
  * (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.
@@ -610,7 +610,7 @@ static PyObject *pfget_p(PyObject *me, void *hunoz)
 
 static PyGetSetDef primefield_pygetset[] = {
 #define GETSETNAME(op, name) pf##op##_##name
-  GET  (p,             "F.p -> prime field characteristic")
+  GET  (p,             "F.p -> prime field characteristic")
 #undef GETSETNAME
 };
 
@@ -736,7 +736,7 @@ static PyObject *bfget_m(PyObject *me, void *hunoz)
 
 static PyGetSetDef binfield_pygetset[] = {
 #define GETSETNAME(op, name) bf##op##_##name
-  GET  (m,             "F.m -> field polynomial degree")
+  GET  (m,             "F.m -> field polynomial degree")
 #undef GETSETNAME
   { 0 }
 };
@@ -809,7 +809,7 @@ end:
 
 static PyGetSetDef binpolyfield_pygetset[] = {
 #define GETSETNAME(op, name) pf##op##_##name
-  GET  (p,             "F.p -> field polynomial")
+  GET  (p,             "F.p -> field polynomial")
 #undef GETSETNAME
   { 0 }
 };
@@ -888,10 +888,10 @@ static PyObject *bnfget_beta(PyObject *me, void *hunoz)
 
 static PyGetSetDef binnormfield_pygetset[] = {
 #define GETSETNAME(op, name) pf##op##_##name
-  GET  (p,             "F.p -> field polynomial")
+  GET  (p,             "F.p -> field polynomial")
 #undef GETSETNAME
 #define GETSETNAME(op, name) bnf##op##_##name
-  GET  (beta,          "F.beta -> conversion factor")
+  GET  (beta,          "F.beta -> conversion factor")
 #undef GETSETNAME
   { 0 }
 };
@@ -966,7 +966,7 @@ end:
 
 static PyMethodDef methods[] = {
 #define METHNAME(func) meth_##func
-  METH (_Field_parse,          "parse(STR) -> F, REST")
+  METH (_Field_parse,          "parse(STR) -> F, REST")
 #undef METHNAME
   { 0 }
 };
diff --git a/group.c b/group.c
index fe05f15..cd3472f 100644 (file)
--- a/group.c
+++ b/group.c
@@ -7,7 +7,7 @@
  * (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.
@@ -231,7 +231,7 @@ static PyObject *namedgroups(const pentry *pp, int *ne)
     Py_DECREF(c);
   }
   *ne = i;
-  return (d);  
+  return (d);
 }
 
 static PyObject *meth__groupn(PyObject *me, PyObject *arg,
@@ -269,7 +269,7 @@ static PyObject *meth__parse(PyObject *me, PyObject *arg, PyTypeObject *ty,
   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)
@@ -468,7 +468,7 @@ group *group_copy(group *g)
     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;
@@ -1350,10 +1350,10 @@ static PyMethodDef methods[] = {
   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)")
diff --git a/key.c b/key.c
index f9acd3c..cd330c7 100644 (file)
--- a/key.c
+++ b/key.c
@@ -7,7 +7,7 @@
  * (c) 2005 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.
@@ -336,7 +336,7 @@ static void keydata_pydealloc(PyObject *me)
 static PyObject *kdmeth_matchp(PyObject *me, PyObject *arg)
 {
   key_filter f;
-  
+
   if (!PyArg_ParseTuple(arg, "O&:matchp", convfilter, &f))
     return (0);
   return (getbool(KEY_MATCH(KEYDATA_KD(me), &f)));
@@ -388,7 +388,7 @@ static PyObject *kdmeth_plock(PyObject *me, PyObject *arg)
   int err;
   PyObject *rc = 0;
   key_data *kd;
-  
+
   if (!PyArg_ParseTuple(arg, "s:plock", &tag))
     goto end;
   if ((err = key_plock(&kd, KEYDATA_KD(me), tag)) != 0)
@@ -404,7 +404,7 @@ static PyObject *kdmeth_lock(PyObject *me, PyObject *arg)
   int n;
   PyObject *rc = 0;
   key_data *kd;
-  
+
   if (!PyArg_ParseTuple(arg, "s#:lock", &p, &n))
     goto end;
   key_lock(&kd, KEYDATA_KD(me), p, n);
@@ -440,7 +440,7 @@ static PyObject *meth__KeyData_decode(PyObject *me, PyObject *arg)
     goto end;
   if ((kd = key_decode(p, n)) == 0)
     KEYERR(KERR_MALFORMED);
-  rc =  keydata_pywrap(kd);
+  rc = keydata_pywrap(kd);
 end:
   return (rc);
 }
@@ -635,7 +635,7 @@ static PyObject *kdemeth_punlock(PyObject *me, PyObject *arg)
   int err;
   PyObject *rc = 0;
   key_data *kd;
-  
+
   if (!PyArg_ParseTuple(arg, "s:punlock", &tag))
     goto end;
   if ((err = key_punlock(&kd, KEYDATA_KD(me), tag)) != 0)
@@ -652,7 +652,7 @@ static PyObject *kdemeth_unlock(PyObject *me, PyObject *arg)
   int err;
   PyObject *rc = 0;
   key_data *kd;
-  
+
   if (!PyArg_ParseTuple(arg, "s#:unlock", &p, &n))
     goto end;
   if ((err = key_unlock(&kd, KEYDATA_KD(me), p, n)) != 0)
@@ -1395,7 +1395,7 @@ static void key_pydealloc(PyObject *me)
 static PyObject *kmeth_delete(PyObject *me, PyObject *arg)
 {
   int err;
-  
+
   if (!PyArg_ParseTuple(arg, ":delete")) goto end;
   if ((err = key_delete(KEY_KF(me), KEY_K(me))) != 0) KEYERR(err);
   RETURN_ME;
@@ -1406,7 +1406,7 @@ end:
 static PyObject *kmeth_expire(PyObject *me, PyObject *arg)
 {
   int err;
-  
+
   if (!PyArg_ParseTuple(arg, ":expire")) goto end;
   if ((err = key_expire(KEY_KF(me), KEY_K(me))) != 0) KEYERR(err);
   RETURN_ME;
@@ -1418,7 +1418,7 @@ static PyObject *kmeth_used(PyObject *me, PyObject *arg)
 {
   long t;
   int err;
-  
+
   if (!PyArg_ParseTuple(arg, "l:used", &t)) goto end;
   if ((err = key_used(KEY_KF(me), KEY_K(me), t)) != 0) KEYERR(err);
   RETURN_ME;
@@ -1909,7 +1909,7 @@ static PyObject *keyfile_pylookup(PyObject *me, PyObject *key)
   }
 end:
   return (rc);
-}  
+}
 
 static PyObject *kfmeth_newkey(PyObject *me, PyObject *arg, PyObject *kw)
 {
diff --git a/mp.c b/mp.c
index 983e193..bc7f7a6 100644 (file)
--- a/mp.c
+++ b/mp.c
@@ -7,7 +7,7 @@
  * (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.
@@ -498,7 +498,7 @@ static PyObject *mp_pyfloat(PyObject *x)
   return (PyFloat_FromDouble(f));
 }
 
-#define COERCE(pre, PRE)                                               \
+#define COERCE(pre, PRE)                                               \
   static int pre##_pycoerce(PyObject **x, PyObject **y)                        \
   {                                                                    \
     mp *z;                                                             \
@@ -574,7 +574,7 @@ end:
   }
 BITOP(mp, setbit, 2c);
 BITOP(mp, clearbit, 2c);
-BITOP(gf, setbit, ); 
+BITOP(gf, setbit, );
 BITOP(gf, clearbit, );
 #undef BITOP
 
@@ -1193,7 +1193,7 @@ fail:
 
 static PyObject *mm_mexpr(PyObject *me, void *v, int n)
   { return mp_pywrap(mpmont_mexpr(MPMONT_PY(me), MP_NEW, v, n)); }
-  
+
 static void mp_mexp_drop(void *p)
 {
   mp_expfactor *f = p;
@@ -1233,7 +1233,7 @@ fail:
 
 static PyObject *mm_mexp(PyObject *me, void *v, int n)
   { return mp_pywrap(mpmont_mexp(MPMONT_PY(me), MP_NEW, v, n)); }
-  
+
 static PyObject *mmmeth_mexp(PyObject *me, PyObject *arg)
 {
   return mexp_common(me, arg, sizeof(mp_expfactor),
@@ -1386,7 +1386,7 @@ end:
 
 static PyObject *mb_mexp(PyObject *me, void *v, int n)
   { return mp_pywrap(mpbarrett_mexp(MPBARRETT_PY(me), MP_NEW, v, n)); }
-  
+
 static PyObject *mbmeth_mexp(PyObject *me, PyObject *arg)
 {
   return mexp_common(me, arg, sizeof(mp_expfactor),
@@ -1970,7 +1970,7 @@ static PyMethodDef gf_pymethods[] = {
   METH (gcdx,
         "X.gcdx(Y) -> (gcd(X, Y), U, V) with X U + Y V = gcd(X, Y)")
   METH (modinv,        "X.modinv(Y) -> multiplicative inverse of Y mod X")
-  METH (irreduciblep,  "X.irreduciblep() -> true/false")
+  METH (irreduciblep,  "X.irreduciblep() -> true/false")
 #undef METHNAME
 #define METHNAME(func) mpmeth_##func
   KWMETH(tostring,     "X.tostring(radix = 10) -> STR")
@@ -2438,13 +2438,13 @@ and normal basis representations.",
 
 static PyMethodDef methods[] = {
 #define METHNAME(func) meth_##func
-  KWMETH(_MP_fromstring,        "\
+  KWMETH(_MP_fromstring,       "\
 fromstring(STR, radix = 0) -> (X, REST)\n\
 \n\
 Parse STR as a large integer, according to radix.  If radix is zero,\n\
 read a prefix from STR to decide radix: allow `0' for octal, `0x' for hex\n\
 or `R_' for other radix R.")
-  KWMETH(_GF_fromstring,        "\
+  KWMETH(_GF_fromstring,       "\
 fromstring(STR, radix = 0) -> (X, REST)\n\
 \n\
 Parse STR as a binary polynomial, according to radix.  If radix is zero,\n\
index 42c1863..1380d2f 100644 (file)
@@ -7,7 +7,7 @@
  * (c) 2005 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.
@@ -73,7 +73,7 @@ end:
 static void pixie_pydealloc(PyObject *me)
 {
   close(PIXIE_FD(me));
-  FREEOBJ(me);  
+  FREEOBJ(me);
 }
 
 static PyObject *pixmeth_read(PyObject *me, PyObject *arg, PyObject *kw)
diff --git a/pgen.c b/pgen.c
index ae4dcc5..cb8d10c 100644 (file)
--- a/pgen.c
+++ b/pgen.c
@@ -7,7 +7,7 @@
  * (c) 2005 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.
@@ -40,7 +40,7 @@ static PyObject *pfilt_pywrap(pfilt *f)
   o = PyObject_New(pfilt_pyobj, pfilt_pytype);
   o->f = *f;
   o->st = pfilt_step(f, 0);
-  return ((PyObject *)o);  
+  return ((PyObject *)o);
 }
 
 static PyObject *pfilt_pymake(PyTypeObject *ty, PyObject *xobj)
@@ -548,7 +548,7 @@ static int pgev_python(int rq, pgen_event *ev, void *p)
     goto end;
   else if (l < PGEN_ABORT || l > PGEN_PASS)
     VALERR("return code out of range");
-  else 
+  else
     st = l;
 end:
   if (pyev) {
@@ -698,7 +698,7 @@ static PyObject *psget_step(PyObject *me, void *hunoz)
 
 static PyGetSetDef pgstep_pygetset[] = {
 #define GETSETNAME(op, name) ps##op##_##name
-  GET  (step,          "S.step -> step size for the stepper")
+  GET  (step,          "S.step -> step size for the stepper")
 #undef GETSETNAME
   { 0 }
 };
@@ -780,7 +780,7 @@ static PyObject *pjget_jump(PyObject *me, void *hunoz)
 
 static PyGetSetDef pgjump_pygetset[] = {
 #define GETSETNAME(op, name) pj##op##_##name
-  GET  (jump,          "S.jump -> jump size for the stepper")
+  GET  (jump,          "S.jump -> jump size for the stepper")
 #undef GETSETNAME
   { 0 }
 };
@@ -933,7 +933,7 @@ static PyObject *meth_pgen(PyObject *me, PyObject *arg, PyObject *kw)
 end:
   mp_drop(r); mp_drop(x);
   droppgev(&step); droppgev(&test); droppgev(&evt);
-  return (rc);    
+  return (rc);
 }
 
 static PyObject *meth_strongprime_setup(PyObject *me,
@@ -1035,10 +1035,10 @@ pgen(START, [name = 'p', stepper = PrimeGenStepper(2),\n\
      nsteps = 0, ntests = RabinMiller.iters(START.nbits)]) -> P")
   KWMETH(strongprime_setup,            "\
 strongprime_setup(NBITS, [name = 'p', event = pgen_nullev,\n\
-                  rng = rand, nsteps = 0]) -> (START, JUMP)")
+                 rng = rand, nsteps = 0]) -> (START, JUMP)")
   KWMETH(strongprime,                  "\
 strongprime_setup(NBITS, [name = 'p', event = pgen_nullev,\n\
-                  rng = rand, nsteps = 0]) -> P")
+                 rng = rand, nsteps = 0]) -> P")
   KWMETH(limlee,                       "\
 limlee(PBITS, QBITS, [name = 'p', event = pgen_nullev,\n\
        ievent = pgen_nullev, rng = rand, nsteps = 0]) -> (P, [Q, ...])")
index e7bfb98..1e7e366 100644 (file)
--- a/pubkey.c
+++ b/pubkey.c
@@ -7,7 +7,7 @@
  * (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.
@@ -198,7 +198,7 @@ static PyMemberDef dsapub_pymembers[] = {
   MEMBER(G,    T_OBJECT, READONLY, "D.G -> group to work in")
   MEMBER(p,    T_OBJECT, READONLY, "D.p -> public key (group element")
   MEMBER(rng,  T_OBJECT, READONLY, "D.rng -> random number generator")
-  MEMBER(hash,         T_OBJECT, READONLY, "D.hash -> hash class")
+  MEMBER(hash, T_OBJECT, READONLY, "D.hash -> hash class")
 #undef MEMBERSTRUCT
   { 0 }
 };
diff --git a/pwsafe b/pwsafe
index 208ccdc..5965906 100755 (executable)
--- a/pwsafe
+++ b/pwsafe
@@ -166,15 +166,15 @@ def cmd_dump(av):
     k = db.nextkey(k)
 
 commands = { 'create': [cmd_create,
-                        '[-c CIPHER] [-h HASH] [-m MAC] [PP-TAG]'],
-             'find' : [cmd_find, 'LABEL'],
-             'store' : [cmd_store, 'LABEL [VALUE]'],
-             'list' : [cmd_list, '[GLOB-PATTERN]'],
-             'changepp' : [cmd_changepp, ''],
-             'copy' : [cmd_copy, 'DEST-FILE [GLOB-PATTERN]'],
-             'to-pixie' : [cmd_topixie, '[TAG [PIXIE-TAG]]'],
-             'delete' : [cmd_del, 'TAG'],
-             'dump' : [cmd_dump, '']}
+                       '[-c CIPHER] [-h HASH] [-m MAC] [PP-TAG]'],
+            'find' : [cmd_find, 'LABEL'],
+            'store' : [cmd_store, 'LABEL [VALUE]'],
+            'list' : [cmd_list, '[GLOB-PATTERN]'],
+            'changepp' : [cmd_changepp, ''],
+            'copy' : [cmd_copy, 'DEST-FILE [GLOB-PATTERN]'],
+            'to-pixie' : [cmd_topixie, '[TAG [PIXIE-TAG]]'],
+            'delete' : [cmd_del, 'TAG'],
+            'dump' : [cmd_dump, '']}
 
 def version():
   print '%s 1.0.0' % prog
@@ -183,7 +183,7 @@ def usage(fp):
 def help():
   version()
   print
-  usage(stdout)  
+  usage(stdout)
   print '''
 Maintains passwords or other short secrets securely.
 
@@ -202,8 +202,8 @@ Commands provided:
 
 try:
   opts, argv = getopt(argv[1:],
-                      'hvuf:',
-                      ['help', 'version', 'usage', 'file='])
+                     'hvuf:',
+                     ['help', 'version', 'usage', 'file='])
 except GetoptError:
   usage(stderr)
   exit(1)
diff --git a/rand.c b/rand.c
index 7a3ad53..fee2a9b 100644 (file)
--- a/rand.c
+++ b/rand.c
@@ -7,7 +7,7 @@
  * (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.
@@ -524,7 +524,7 @@ static PyObject *trget_goodbits(PyObject *me, void *hunoz)
 
 static PyGetSetDef truerand_pygetset[] = {
 #define GETSETNAME(op, name) tr##op##_##name
-  GET  (goodbits,      "R.goodbits -> good bits of entropy remaining")
+  GET  (goodbits,      "R.goodbits -> good bits of entropy remaining")
 #undef GETSETNAME
   { 0 }
 };
@@ -619,7 +619,7 @@ static PyObject *gcrand_pynew(PyTypeObject *ty, PyObject *arg, PyObject *kw)
   if (keysz(n, info->keysz) != n) VALERR("bad key length");
   return (grand_dopywrap(ty, info->func(k, n), f_freeme));
 end:
-  return (0);  
+  return (0);
 }
 
 static PyObject *gcirand_pynew(PyTypeObject *ty, PyObject *arg, PyObject *kw)
@@ -638,7 +638,7 @@ static PyObject *gcirand_pynew(PyTypeObject *ty, PyObject *arg, PyObject *kw)
                         ((gcirand_func *)info->func)(k, n, i),
                         f_freeme));
 end:
-  return (0);  
+  return (0);
 }
 
 static PyObject *gccrand_pywrap(const gccrand_info *info)
@@ -1236,7 +1236,7 @@ static PyObject *meth__BBSPriv_generate(PyObject *me,
   rc->bp.n = MP_COPY(bp.n);
 end:
   mp_drop(bp.p); mp_drop(bp.q); mp_drop(bp.n); mp_drop(x);
-  return ((PyObject *)rc); 
+  return ((PyObject *)rc);
 }
 
 static void bbspriv_pydealloc(PyObject *me)
@@ -1281,9 +1281,9 @@ static PyMethodDef bbspriv_pymethods[] = {
 
 static PyGetSetDef bbspriv_pygetset[] = {
 #define GETSETNAME(op, name) bp##op##_##name
-  GET  (n,             "R.n -> Blum modulus")
-  GET  (p,             "R.p -> one of the factors of the modulus")
-  GET  (q,             "R.q -> one of the factors of the modulus")
+  GET  (n,             "R.n -> Blum modulus")
+  GET  (p,             "R.p -> one of the factors of the modulus")
+  GET  (q,             "R.q -> one of the factors of the modulus")
 #undef GETSETNAME
   { 0 }
 };
index 6d287c0..8ff559d 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -78,28 +78,28 @@ for g in ['algorithms.h']:
     fnew = fout + '.new'
     if kid == 0:
       try:
-        out = file(fnew, 'w')
-        dup2(out.fileno(), stdout.fileno())
-        out.close()
-        execl(sys.executable, sys.executable, fin)
+       out = file(fnew, 'w')
+       dup2(out.fileno(), stdout.fileno())
+       out.close()
+       execl(sys.executable, sys.executable, fin)
       except:
-        stderr.write('error running %s -> %s: %s\n' %
-                     (fin, fout, sys.exc_info()[1]))
-        _exit(127)
+       stderr.write('error running %s -> %s: %s\n' %
+                    (fin, fout, sys.exc_info()[1]))
+       _exit(127)
     _, rc = waitpid(kid, 0)
     if rc:
       raise SubprocessFailure, (fin, rc)
     rename(fnew, fout)
 
 cat = Extension('catacomb._base',
-                ['catacomb.c', 'bytestring.c', 'buffer.c',
-                 'rand.c', 'algorithms.c', 'pubkey.c', 'pgen.c',
-                 'mp.c', 'field.c', 'ec.c', 'group.c', 'passphrase.c',
-                 'share.c', 'key.c', 'util.c'],
-                ##extra_compile_args = ['-O0'],
-                include_dirs = uniquify(incdirs),
-                library_dirs = uniquify(libdirs),
-                libraries = uniquify(libs))
+               ['catacomb.c', 'bytestring.c', 'buffer.c',
+                'rand.c', 'algorithms.c', 'pubkey.c', 'pgen.c',
+                'mp.c', 'field.c', 'ec.c', 'group.c', 'passphrase.c',
+                'share.c', 'key.c', 'util.c'],
+               ##extra_compile_args = ['-O0'],
+               include_dirs = uniquify(incdirs),
+               library_dirs = uniquify(libdirs),
+               libraries = uniquify(libs))
 
 setup(name = 'catacomb-python',
       version = '1.0.0',
diff --git a/share.c b/share.c
index c5222e0..011de17 100644 (file)
--- a/share.c
+++ b/share.c
@@ -7,7 +7,7 @@
  * (c) 2005 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.
diff --git a/util.c b/util.c
index 7201401..89130cb 100644 (file)
--- a/util.c
+++ b/util.c
@@ -7,7 +7,7 @@
  * (c) 2005 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.
@@ -278,7 +278,7 @@ static void iter_pydealloc(PyObject *me)
 static PyObject *itemiter_pynext(PyObject *me)
 {
   PyObject *k = 0, *v = 0, *rc = 0;
-  
+
   if ((k = PyIter_Next(ITER_I(me))) != 0 &&
       (v = PyObject_GetItem(ITER_MAP(me), k)) != 0)
     rc = Py_BuildValue("(OO)", k, v);
@@ -337,7 +337,7 @@ static PyTypeObject itemiter_pytype_skel = {
 static PyObject *valiter_pynext(PyObject *me)
 {
   PyObject *k = 0, *rc = 0;
-  
+
   if ((k = PyIter_Next(ITER_I(me))) != 0)
     rc = PyObject_GetItem(ITER_MAP(me), k);
   Py_XDECREF(k);
@@ -403,7 +403,7 @@ PySequenceMethods gmap_pysequence = {
   PyMapping_HasKey,                    /* @sq_contains@ */
   0,                                   /* @sq_inplace_concat@ */
   0                                    /* @sq_inplace_repeat@ */
-};  
+};
 
 int gmap_pysize(PyObject *me)
 {
@@ -454,7 +454,7 @@ PyObject *gmapmeth_values(PyObject *me, PyObject *arg)
       (l = PyList_New(0)) == 0 ||
       (i = PyObject_GetIter(me)) == 0)
     goto done;
-  while ((k = PyIter_Next(i)) != 0) {  
+  while ((k = PyIter_Next(i)) != 0) {
     if ((v = PyObject_GetItem(me, k)) == 0 ||
        PyList_Append(l, v))
       err = -1;