- raise ValueError, 'failed to find root name for %s' % i
- print ('\t_("%(name)s", %(root)s_keysz, %(id)s_rand, ' +
- 'RNGF_NONCE | RNGF_LATIN, %(ROOT)s_NONCESZ) \\') % \
- {'name': i, 'id': i.translate(None, '/'),
- 'root': root, 'ROOT': root.upper()}
-print '\t/* end */'
-print
+ 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, ' +
+ 'RNG_LATIN, %(ROOT)s_NONCESZ) \\') % \
+ {'name': i, 'id': i.replace('/', '').replace('-', '_'),
+ 'root': root, 'ROOT': root.upper()})
+for i in [128, 256]:
+ print(('\t_("shake%(w)d", shake%(w)d_keysz, cshake%(w)d_rand, ' +
+ 'RNG_SHAKE, 0) \\') % \
+ {'w': i})
+ print(('\t_("kmac%(w)d", kmac%(w)d_keysz, kmac%(w)d_rand, ' +
+ 'RNG_KMAC, 0) \\') % \
+ {'w': i})
+print('\t/* end */')
+print('')