Merge branches 'mdw/latin-ietf' and 'mdw/curve25519'
authorMark Wooding <mdw@distorted.org.uk>
Wed, 3 May 2017 12:02:54 +0000 (13:02 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 3 May 2017 12:02:54 +0000 (13:02 +0100)
* mdw/latin-ietf:
  algorithms.py: Support the IETF versions of ChaCha etc. with 96-bit nonce.

* mdw/curve25519:
  pubkey.c, catacomb/__init__.py: Add bindings for Hamburg's X448.
  pubkey.c, ...: Support Bernstein's `Ed25519' signature scheme.
  pubkey.c, ...: Support Bernstein's `X25519' key-agreement algorithm.

algorithms.py

index c2ab4ee..a2a468f 100644 (file)
@@ -30,8 +30,12 @@ streamciphers = '''
 rc4 seal
 '''.split()
 latindances = '''
-salsa20 salsa20/12 salsa20/8 xsalsa20 xsalsa20/12 xsalsa20/8
-chacha20 chacha12 chacha8 xchacha20 xchacha12 xchacha8
+salsa20 salsa20/12 salsa20/8
+salsa20-ietf salsa20/12-ietf salsa20/8-ietf
+xsalsa20 xsalsa20/12 xsalsa20/8
+chacha20 chacha12 chacha8
+chacha20-ietf chacha12-ietf chacha8-ietf
+xchacha20 xchacha12 xchacha8
 '''.split()
 streamciphers += map(lambda s: s.translate(None, '/'), latindances)
 hashes = '''
@@ -84,9 +88,10 @@ for i in latindances:
       break
   else:
     raise ValueError, 'failed to find root name for %s' % i
+  if i.endswith('-ietf'): root += '_ietf'
   print ('\t_("%(name)s", %(root)s_keysz, %(id)s_rand, ' +
          'RNGF_NONCE | RNGF_LATIN, %(ROOT)s_NONCESZ) \\') % \
-      {'name': i, 'id': i.translate(None, '/'),
+      {'name': i, 'id': i.translate(None, '/').replace('-', '_'),
        'root': root, 'ROOT': root.upper()}
 print '\t/* end */'
 print