diff options
| author | Christian Heimes <christian@python.org> | 2016-09-06 20:03:25 (GMT) |
|---|---|---|
| committer | Christian Heimes <christian@python.org> | 2016-09-06 20:03:25 (GMT) |
| commit | 121b9487d13b7dcd5a864a6067c4a5c88ba15b5d (patch) | |
| tree | b2ac9866afda319cb6582de045c47f1a023d1973 /setup.py | |
| parent | 5d75f441ef0a3cfe7af0d865db2530528e424818 (diff) | |
| download | cpython-121b9487d13b7dcd5a864a6067c4a5c88ba15b5d.zip cpython-121b9487d13b7dcd5a864a6067c4a5c88ba15b5d.tar.gz cpython-121b9487d13b7dcd5a864a6067c4a5c88ba15b5d.tar.bz2 | |
Issue #26798: Add BLAKE2 (blake2b and blake2s) to hashlib.
Diffstat (limited to 'setup.py')
| -rw-r--r-- | setup.py | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -889,6 +889,22 @@ class PyBuildExt(build_ext): exts.append( Extension('_sha1', ['sha1module.c'], depends=['hashlib.h']) ) + blake2_deps = [os.path.join('_blake2', 'impl', name) + for name in os.listdir('Modules/_blake2/impl')] + blake2_deps.append('hashlib.h') + + blake2_macros = [] + if os.uname().machine == "x86_64": + # Every x86_64 machine has at least SSE2. + blake2_macros.append(('BLAKE2_USE_SSE', '1')) + + exts.append( Extension('_blake2', + ['_blake2/blake2module.c', + '_blake2/blake2b_impl.c', + '_blake2/blake2s_impl.c'], + define_macros=blake2_macros, + depends=blake2_deps) ) + # Modules that provide persistent dictionary-like semantics. You will # probably want to arrange for at least one of them to be available on # your machine, though none are defined by default because of library |
