7 if type(x) is not tuple and type(x) is not list:
11 for j in cross(*seq[1:]):
23 square rijndael rijndael192 rijndael256
27 ecb cbc cfb ofb counter
33 salsa20 salsa20/12 salsa20/8 xsalsa20 xsalsa20/12 xsalsa20/8
34 chacha20 chacha12 chacha8 xchacha20 xchacha12 xchacha8
36 streamciphers += map(lambda s: s.replace('/', ''), latindances)
38 md2 md4 md5 tiger has160
39 sha sha224 sha256 sha384 sha512
40 rmd128 rmd160 rmd256 rmd320
41 whirlpool whirlpool256
47 print '/* algorithms.h [generated] */'
51 print '#include <catacomb/%s.h>' % i
53 print '#include <catacomb/%s-%s.h>' % (i, j)
54 for i in streamciphers:
55 print '#include <catacomb/%s.h>' % i
58 print '#include <catacomb/%s.h>' % i
60 print '#include <catacomb/%s-%s.h>' % (i, j)
63 print '#define PRPS(_) \\'
65 print '\t_(%s, %s) \\' % (i.upper(), i)
69 print '#define RNGS(_) \\'
70 for i in (cross(prps, ['ofb', 'counter'])):
71 print ('\t_("%(prim)s-%(mode)s", %(prim)s_keysz, ' +
72 '%(prim)s_%(mode)srand, 0, 0) \\') % \
73 {'prim': i[0], 'mode': i[1]}
74 for i in (cross(hashes, 'mgf')):
75 print ('\t_("%(prim)s-%(mode)s", %(prim)s_%(mode)skeysz, ' +
76 '%(prim)s_%(mode)srand, 0, 0) \\') % \
77 {'prim': i[0], 'mode': i[1]}
78 print '\t_("rc4", rc4_keysz, rc4_rand, 0, 0) \\'
79 print '\t_("seal", seal_keysz, seal_rand, RNGF_INT, 0) \\'
81 for r in ['salsa20', 'xsalsa20', 'chacha', 'xchacha']:
86 raise ValueError, 'failed to find root name for %s' % i
87 print ('\t_("%(name)s", %(root)s_keysz, %(id)s_rand, ' +
88 'RNGF_NONCE, %(ROOT)s_NONCESZ) \\') % \
89 {'name': i, 'id': i.replace('/', ''),
90 'root': root, 'ROOT': root.upper()}