aboutsummaryrefslogtreecommitdiff
path: root/frozen_deps/sha3.py
diff options
context:
space:
mode:
authorDeterminant <tederminant@gmail.com>2020-11-17 18:47:40 -0500
committerDeterminant <tederminant@gmail.com>2020-11-17 18:47:40 -0500
commit3bef51eec2299403467e621ae660cef3f9256ac8 (patch)
tree9b72aaa95fb6dffacd8b20164699870a32ab6825 /frozen_deps/sha3.py
parent92b8b8e9628cac41d37226416107adc76b10e01b (diff)
update frozen deps
Diffstat (limited to 'frozen_deps/sha3.py')
-rw-r--r--frozen_deps/sha3.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/frozen_deps/sha3.py b/frozen_deps/sha3.py
new file mode 100644
index 0000000..5657f66
--- /dev/null
+++ b/frozen_deps/sha3.py
@@ -0,0 +1,24 @@
+# Copyright (C) 2012-2016 Christian Heimes (christian@python.org)
+# Licensed to PSF under a Contributor Agreement.
+#
+
+# monkey patch _hashlib
+import hashlib as _hashlib
+
+from _pysha3 import keccak_224, keccak_256, keccak_384, keccak_512
+from _pysha3 import sha3_224, sha3_256, sha3_384, sha3_512
+from _pysha3 import shake_128, shake_256
+
+
+__all__ = ("sha3_224", "sha3_256", "sha3_384", "sha3_512",
+ "keccak_224", "keccak_256", "keccak_384", "keccak_512",
+ "shake_128", "shake_256")
+
+
+if not hasattr(_hashlib, "sha3_512"):
+ _hashlib.sha3_224 = sha3_224
+ _hashlib.sha3_256 = sha3_256
+ _hashlib.sha3_384 = sha3_384
+ _hashlib.sha3_512 = sha3_512
+ _hashlib.shake_128 = shake_128
+ _hashlib.shake_256 = shake_256