## For the benefit of the default keyreporter, we need the program na,e.
_base._ego(_argv[0])
+## How to fix a name back into the right identifier. Alas, the rules are not
+## consistent.
+def _fixname(name):
+
+ ## Hyphens consistently become underscores.
+ name = name.replace('-', '_')
+
+ ## But slashes might become underscores or just vanish.
+ if name.startswith('salsa20'): name = name.translate(None, '/')
+ else: name = name.replace('/', '_')
+
+ ## Done.
+ return name
+
## Initialize the module. Drag in the static methods of the various
## classes; create names for the various known crypto algorithms.
def _init():
setattr(c, j[plen:], classmethod(b[j]))
for i in [gcciphers, gchashes, gcmacs, gcprps]:
for c in i.itervalues():
- d[c.name.replace('-', '_').translate(None, '/')] = c
+ d[_fixname(c.name)] = c
for c in gccrands.itervalues():
- d[c.name.replace('-', '_').translate(None, '/') + 'rand'] = c
+ d[_fixname(c.name + 'rand')] = c
_init()
## A handy function for our work: add the methods of a named class to an