Overhaul formatting.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 16 Jun 2013 14:22:38 +0000 (15:22 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 16 Jun 2013 14:23:14 +0000 (15:23 +0100)
Expunge CVS droppings and use newer comment stylings.

17 files changed:
algorithms.c
buffer.c
bytestring.c
catacomb-python.h
catacomb.c
catacomb/__init__.py
ec.c
field.c
group.c
key.c
mp.c
passphrase.c
pgen.c
pubkey.c
rand.c
share.c
util.c

index ea52434..16d426d 100644 (file)
@@ -1,7 +1,5 @@
 /* -*-c-*-
  *
- * $Id$
- *
  * Symmetric cryptography
  *
  * (c) 2004 Straylight/Edgeware
index af4e1bf..59a85bf 100644 (file)
--- a/buffer.c
+++ b/buffer.c
@@ -1,7 +1,5 @@
 /* -*-c-*-
  *
- * $Id$
- *
  * Reading and writing buffers of stuff
  *
  * (c) 2005 Straylight/Edgeware
index d6bd900..6b45d24 100644 (file)
@@ -1,7 +1,5 @@
 /* -*-c-*-
  *
- * $Id$
- *
  * Byte strings
  *
  * (c) 2004 Straylight/Edgeware
index bd9a8e5..a384097 100644 (file)
@@ -1,7 +1,5 @@
 /* -*-c-*-
  *
- * $Id$
- *
  * Definitions for Catacomb bindings
  *
  * (c) 2004 Straylight/Edgeware
index 29f09ac..3aebea3 100644 (file)
@@ -1,7 +1,5 @@
 /* -*-c-*-
  *
- * $Id$
- *
  * Where the fun begins
  *
  * (c) 2004 Straylight/Edgeware
index aaec637..8dac0b4 100644 (file)
@@ -1,38 +1,35 @@
-# -*-python-*-
-#
-# $Id$
-#
-# Setup for Catacomb/Python bindings
-#
-# (c) 2004 Straylight/Edgeware
-#
-
-#----- Licensing notice -----------------------------------------------------
-#
-# This file is part of the Python interface to Catacomb.
-#
-# Catacomb/Python is free software; you can redistribute it and/or modify
-# 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.
-
-#----- Imports --------------------------------------------------------------
+### -*-python-*-
+###
+### Setup for Catacomb/Python bindings
+###
+### (c) 2004 Straylight/Edgeware
+###
+
+###----- Licensing notice ---------------------------------------------------
+###
+### This file is part of the Python interface to Catacomb.
+###
+### Catacomb/Python is free software; you can redistribute it and/or modify
+### 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.
 
 import _base
 import types as _types
 from binascii import hexlify as _hexify, unhexlify as _unhexify
 from sys import argv as _argv
 
-#----- Basic stuff ----------------------------------------------------------
+###--------------------------------------------------------------------------
+### Basic stuff.
 
 ## For the benefit of the default keyreporter, we need the program na,e.
 _base._ego(_argv[0])
@@ -46,17 +43,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
@@ -85,7 +82,8 @@ def _checkend(r):
     raise SyntaxError, 'junk at end of string'
   return x
 
-#----- Bytestrings ----------------------------------------------------------
+###--------------------------------------------------------------------------
+### Bytestrings.
 
 class _tmp:
   def fromhex(x):
@@ -98,7 +96,8 @@ class _tmp:
 _augment(ByteString, _tmp)
 bytes = ByteString.fromhex
 
-#----- Multiprecision integers and binary polynomials -----------------------
+###--------------------------------------------------------------------------
+### Multiprecision integers and binary polynomials.
 
 class _tmp:
   def negp(x): return x < 0
@@ -132,7 +131,8 @@ class _tmp:
   product = staticmethod(product)
 _augment(MPMul, _tmp)
 
-#----- Abstract fields ------------------------------------------------------
+###--------------------------------------------------------------------------
+### Abstract fields.
 
 class _tmp:
   def fromstring(str): return _checkend(Field.parse(str))
@@ -154,7 +154,8 @@ class _tmp:
   def __repr__(me): return '%s(%s)' % (repr(me.field), repr(me.value))
 _augment(FE, _tmp)
 
-#----- Elliptic curves ------------------------------------------------------
+###--------------------------------------------------------------------------
+### Elliptic curves.
 
 class _tmp:
   def __repr__(me):
@@ -179,7 +180,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)
@@ -193,7 +194,8 @@ class _tmp:
     return '(%s, %s)' % (me.x, me.y)
 _augment(ECPtCurve, _tmp)
 
-#----- Key sizes ------------------------------------------------------------
+###--------------------------------------------------------------------------
+### Key sizes.
 
 class _tmp:
   def __repr__(me): return 'KeySZAny(%d)' % me.default
@@ -204,7 +206,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'
@@ -223,12 +225,13 @@ class _tmp:
     return found
 _augment(KeySZSet, _tmp)
 
-#----- Abstract groups ------------------------------------------------------
+###--------------------------------------------------------------------------
+### Abstract groups.
 
 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:
@@ -249,7 +252,8 @@ class _tmp:
     return '%r(%r)' % (me.group, str(me))
 _augment(GE, _tmp)
 
-#----- RSA encoding techniques ----------------------------------------------
+###--------------------------------------------------------------------------
+### RSA encoding techniques.
 
 class PKCS1Crypt (object):
   def __init__(me, ep = '', rng = rand):
@@ -292,7 +296,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):
@@ -311,7 +315,8 @@ class _tmp:
   def sign(me, msg, enc): return me.privop(enc.encode(msg, me.n.nbits))
 _augment(RSAPriv, _tmp)
 
-#----- Built-in named curves and prime groups -------------------------------
+###--------------------------------------------------------------------------
+### Built-in named curves and prime groups.
 
 class _groupmap (object):
   def __init__(me, map, nth):
@@ -349,7 +354,8 @@ eccurves = _groupmap(_base._eccurves, ECInfo._curven)
 primegroups = _groupmap(_base._pgroups, DHInfo._groupn)
 bingroups = _groupmap(_base._bingroups, BinDHInfo._groupn)
 
-#----- Prime number generation ----------------------------------------------
+###--------------------------------------------------------------------------
+### Prime number generation.
 
 class PrimeGenEventHandler (object):
   def pg_begin(me, ev):
@@ -514,20 +520,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
 
diff --git a/ec.c b/ec.c
index 9946205..2b2dba0 100644 (file)
--- a/ec.c
+++ b/ec.c
@@ -1,7 +1,5 @@
 /* -*-c-*-
  *
- * $Id$
- *
  * Elliptic curves
  *
  * (c) 2004 Straylight/Edgeware
diff --git a/field.c b/field.c
index af7a561..eafa42f 100644 (file)
--- a/field.c
+++ b/field.c
@@ -1,7 +1,5 @@
 /* -*-c-*-
  *
- * $Id$
- *
  * Abstract fields
  *
  * (c) 2004 Straylight/Edgeware
diff --git a/group.c b/group.c
index 001eb19..544a8c7 100644 (file)
--- a/group.c
+++ b/group.c
@@ -1,7 +1,5 @@
 /* -*-c-*-
  *
- * $Id$
- *
  * Abstract group inteface
  *
  * (c) 2004 Straylight/Edgeware
diff --git a/key.c b/key.c
index 597407b..7deb382 100644 (file)
--- a/key.c
+++ b/key.c
@@ -1,7 +1,5 @@
 /* -*-c-*-
  *
- * $Id$
- *
  * Key files and data
  *
  * (c) 2005 Straylight/Edgeware
diff --git a/mp.c b/mp.c
index ceb9142..705a65e 100644 (file)
--- a/mp.c
+++ b/mp.c
@@ -1,7 +1,5 @@
 /* -*-c-*-
  *
- * $Id$
- *
  * Multiprecision arithmetic
  *
  * (c) 2004 Straylight/Edgeware
index 1380d2f..3d8c84b 100644 (file)
@@ -1,7 +1,5 @@
 /* -*-c-*-
  *
- * $Id$
- *
  * Reading and writing passphrases
  *
  * (c) 2005 Straylight/Edgeware
diff --git a/pgen.c b/pgen.c
index cb8d10c..4758c78 100644 (file)
--- a/pgen.c
+++ b/pgen.c
@@ -1,7 +1,5 @@
 /* -*-c-*-
  *
- * $Id$
- *
  * Prime number generation
  *
  * (c) 2005 Straylight/Edgeware
index 1e7e366..c47f1b5 100644 (file)
--- a/pubkey.c
+++ b/pubkey.c
@@ -1,7 +1,5 @@
 /* -*-c-*-
  *
- * $Id$
- *
  * Public-key cryptography
  *
  * (c) 2004 Straylight/Edgeware
diff --git a/rand.c b/rand.c
index fee2a9b..9f086e6 100644 (file)
--- a/rand.c
+++ b/rand.c
@@ -1,7 +1,5 @@
 /* -*-c-*-
  *
- * $Id$
- *
  * Random-number generators
  *
  * (c) 2004 Straylight/Edgeware
diff --git a/share.c b/share.c
index ad9f933..7e58783 100644 (file)
--- a/share.c
+++ b/share.c
@@ -1,7 +1,5 @@
 /* -*-c-*-
  *
- * $Id$
- *
  * Secret sharing
  *
  * (c) 2005 Straylight/Edgeware
diff --git a/util.c b/util.c
index c1d0ad8..96a4052 100644 (file)
--- a/util.c
+++ b/util.c
@@ -1,7 +1,5 @@
 /* -*-c-*-
  *
- * $Id$
- *
  * Miscellaneous utilities (not Catacomb-specific)
  *
  * (c) 2005 Straylight/Edgeware