chiark
/
gitweb
/
~mdw
/
catacomb-python
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mp.c: Fix Jacobi symbol notation in docstring.
[catacomb-python]
/
algorithms.py
diff --git
a/algorithms.py
b/algorithms.py
index 4187c4664bc814ff24460ba73a4d0ef9ca0a006c..46abccbc7b8942217e61c8671f7bcc577cefb466 100644
(file)
--- a/
algorithms.py
+++ b/
algorithms.py
@@
-37,12
+37,13
@@
chacha20 chacha12 chacha8
chacha20-ietf chacha12-ietf chacha8-ietf
xchacha20 xchacha12 xchacha8
'''.split()
chacha20-ietf chacha12-ietf chacha8-ietf
xchacha20 xchacha12 xchacha8
'''.split()
-streamciphers += map(lambda s: s.
translate(None, '/
'), latindances)
+streamciphers += map(lambda s: s.
replace('/', '
'), latindances)
hashes = '''
md2 md4 md5 tiger has160
sha sha224 sha256 sha512/224 sha512/256 sha384 sha512
rmd128 rmd160 rmd256 rmd320
whirlpool whirlpool256
hashes = '''
md2 md4 md5 tiger has160
sha sha224 sha256 sha512/224 sha512/256 sha384 sha512
rmd128 rmd160 rmd256 rmd320
whirlpool whirlpool256
+sha3-224 sha3-256 sha3-384 sha3-512
'''.split()
hmodes = '''
mgf hmac
'''.split()
hmodes = '''
mgf hmac
@@
-93,7
+94,14
@@
for i in latindances:
if i.endswith('-ietf'): root += '_ietf'
print ('\t_("%(name)s", %(root)s_keysz, %(id)s_rand, ' +
'RNG_LATIN, %(ROOT)s_NONCESZ) \\') % \
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.
translate(None, '/
').replace('-', '_'),
+ {'name': i, 'id': i.
replace('/', '
').replace('-', '_'),
'root': root, 'ROOT': root.upper()}
'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
print '\t/* end */'
print