From 3065e16bcc05ddde3af87484a38b67b06471670e Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Thu, 22 Nov 2018 23:42:42 +0800 Subject: add sha3 support (#4573) * add sha3 support * missed versionadded * add prose, remove block_size --- src/cryptography/hazmat/primitives/hashes.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src') 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 @@ -150,6 +150,30 @@ class SHA512(object): block_size = 128 +@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" -- cgit v1.2.3