From 5fe88ea0500c6e418492f4b166c0d4a24e9632cc Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Sat, 19 Jan 2019 00:52:43 -0600 Subject: shake128/256 support (#4611) * shake128/256 support * remove block_size * doc an exception * change how we detect XOF by adding _xof attribute * interface! * review feedback --- docs/hazmat/primitives/cryptographic-hashes.rst | 30 +++++++++++++++++++++++++ docs/spelling_wordlist.txt | 1 + 2 files changed, 31 insertions(+) (limited to 'docs') diff --git a/docs/hazmat/primitives/cryptographic-hashes.rst b/docs/hazmat/primitives/cryptographic-hashes.rst index bc979365..24cc70b5 100644 --- a/docs/hazmat/primitives/cryptographic-hashes.rst +++ b/docs/hazmat/primitives/cryptographic-hashes.rst @@ -185,6 +185,36 @@ than SHA-2 so at this time most users should choose SHA-2. SHA3/512 is a cryptographic hash function from the SHA-3 family and is standardized by NIST. It produces a 512-bit message digest. +.. class:: SHAKE128(digest_size) + + .. versionadded:: 2.5 + + SHAKE128 is an extendable output function (XOF) based on the same core + permutations as SHA3. It allows the caller to obtain an arbitrarily long + digest length. Longer lengths, however, do not increase security or + collision resistance and lengths shorter than 128 bit (16 bytes) will + decrease it. + + :param int digest_size: The length of output desired. Must be greater than + zero. + + :raises ValueError: If the ``digest_size`` is invalid. + +.. class:: SHAKE256(digest_size) + + .. versionadded:: 2.5 + + SHAKE256 is an extendable output function (XOF) based on the same core + permutations as SHA3. It allows the caller to obtain an arbitrarily long + digest length. Longer lengths, however, do not increase security or + collision resistance and lengths shorter than 256 bit (32 bytes) will + decrease it. + + :param int digest_size: The length of output desired. Must be greater than + zero. + + :raises ValueError: If the ``digest_size`` is invalid. + SHA-1 ~~~~~ diff --git a/docs/spelling_wordlist.txt b/docs/spelling_wordlist.txt index 46144214..7e08f124 100644 --- a/docs/spelling_wordlist.txt +++ b/docs/spelling_wordlist.txt @@ -41,6 +41,7 @@ Docstrings El Encodings endian +extendable fallback Fernet fernet -- cgit v1.2.3