summaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2016-09-06 20:03:25 (GMT)
committerChristian Heimes <christian@python.org>2016-09-06 20:03:25 (GMT)
commit121b9487d13b7dcd5a864a6067c4a5c88ba15b5d (patch)
treeb2ac9866afda319cb6582de045c47f1a023d1973 /setup.py
parent5d75f441ef0a3cfe7af0d865db2530528e424818 (diff)
downloadcpython-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.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/setup.py b/setup.py
index 8c13cf2..bbb6bb7 100644
--- a/setup.py
+++ b/setup.py
@@ -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