aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2018-11-22 23:42:42 +0800
committerAlex Gaynor <alex.gaynor@gmail.com>2018-11-22 09:42:42 -0600
commit3065e16bcc05ddde3af87484a38b67b06471670e (patch)
tree2c5f497c0a4d4a8008b8d8ea6f17102c9939d1b6 /src
parentcd4de3ce6dc2a0dd4171b869e187857e4125853b (diff)
downloadcryptography-3065e16bcc05ddde3af87484a38b67b06471670e.tar.gz
cryptography-3065e16bcc05ddde3af87484a38b67b06471670e.tar.bz2
cryptography-3065e16bcc05ddde3af87484a38b67b06471670e.zip
add sha3 support (#4573)
* add sha3 support * missed versionadded * add prose, remove block_size
Diffstat (limited to 'src')
-rw-r--r--src/cryptography/hazmat/primitives/hashes.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/cryptography/hazmat/primitives/hashes.py b/src/cryptography/hazmat/primitives/hashes.py
index 79029937..259a2c01 100644
--- a/src/cryptography/hazmat/primitives/hashes.py
+++ b/src/cryptography/hazmat/primitives/hashes.py
@@ -151,6 +151,30 @@ class SHA512(object):
@utils.register_interface(HashAlgorithm)
+class SHA3_224(object): # noqa: N801
+ name = "sha3-224"
+ digest_size = 28
+
+
+@utils.register_interface(HashAlgorithm)
+class SHA3_256(object): # noqa: N801
+ name = "sha3-256"
+ digest_size = 32
+
+
+@utils.register_interface(HashAlgorithm)
+class SHA3_384(object): # noqa: N801
+ name = "sha3-384"
+ digest_size = 48
+
+
+@utils.register_interface(HashAlgorithm)
+class SHA3_512(object): # noqa: N801
+ name = "sha3-512"
+ digest_size = 64
+
+
+@utils.register_interface(HashAlgorithm)
class MD5(object):
name = "md5"
digest_size = 16