aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Iversen <teh.ivo@gmail.com>2013-10-19 15:56:17 +1100
committerPaul Kehrer <paul.l.kehrer@gmail.com>2013-10-19 21:50:13 -0500
commit505491bd64dd410a3ac6c7f01c71e902a3c58917 (patch)
treead7d63f2830f7e15a8b2f7dd0d1c008c482214cd
parent9cd2ae4d4ca898cc4b9fee935d41422c70f9ccf1 (diff)
downloadcryptography-505491bd64dd410a3ac6c7f01c71e902a3c58917.tar.gz
cryptography-505491bd64dd410a3ac6c7f01c71e902a3c58917.tar.bz2
cryptography-505491bd64dd410a3ac6c7f01c71e902a3c58917.zip
Simplify documentation
-rw-r--r--docs/primitives/cryptographic-hashes.rst123
1 files changed, 24 insertions, 99 deletions
diff --git a/docs/primitives/cryptographic-hashes.rst b/docs/primitives/cryptographic-hashes.rst
index 1499f762..6e8f601b 100644
--- a/docs/primitives/cryptographic-hashes.rst
+++ b/docs/primitives/cryptographic-hashes.rst
@@ -1,23 +1,20 @@
Message Digests
====================
-SHA-1
-~~~~~~~
-
-.. attention::
-
- NIST has deprecated SHA-1 in favor of the SHA-2 variants. New applications
- are strongly suggested to use SHA-2 over SHA-1.
-
-.. class:: cryptography.primitives.hashes.SHA1()
+.. class:: cryptography.primitives.hashes.BaseHash
- SHA-1 is a cryptographic hash function standardized by NIST. It has a
- 160-bit message digest.
+ Abstract base class that implements a common interface for
+ all hash algorithms that follow here
.. method:: update(string)
:param bytes string: The bytes you wish to hash.
+ .. method:: copy()
+
+ :return: a new instance of this object with a
+ copied internal state.
+
.. method:: digest()
:return bytes: The message digest as bytes.
@@ -26,120 +23,60 @@ SHA-1
:return str: The message digest as hex.
+SHA-1
+~~~~~
-SHA-2 Family
-~~~~~~~
-
-.. class:: cryptography.primitives.hashes.SHA224()
-
- SHA-224 is a cryptographic hash function from the SHA-2 family and
- standardized by NIST. It has a 224-bit message digest.
+.. attention::
- .. method:: update(string)
+ NIST has deprecated SHA-1 in favor of the SHA-2 variants. New applications
+ are strongly suggested to use SHA-2 over SHA-1.
- :param bytes string: The bytes you wish to hash.
+.. class:: cryptography.primitives.hashes.SHA1()
- .. method:: digest()
+ SHA-1 is a cryptographic hash function standardized by NIST. It has a
+ 160-bit message digest.
- :return bytes: The message digest as bytes.
+SHA-2 Family
+~~~~~~~~~~~~
- .. method:: hexdigest()
+.. class:: cryptography.primitives.hashes.SHA224()
- :return str: The message digest as hex.
+ SHA-224 is a cryptographic hash function from the SHA-2 family and
+ standardized by NIST. It has a 224-bit message digest.
.. class:: cryptography.primitives.hashes.SHA256()
SHA-256 is a cryptographic hash function from the SHA-2 family and
standardized by NIST. It has a 256-bit message digest.
- .. method:: update(string)
-
- :param bytes string: The bytes you wish to hash.
-
- .. method:: digest()
-
- :return bytes: The message digest as bytes.
-
- .. method:: hexdigest()
-
- :return str: The message digest as hex.
-
.. class:: cryptography.primitives.hashes.SHA384()
SHA-384 is a cryptographic hash function from the SHA-2 family and
standardized by NIST. It has a 384-bit message digest.
- .. method:: update(string)
-
- :param bytes string: The bytes you wish to hash.
-
- .. method:: digest()
-
- :return bytes: The message digest as bytes.
-
- .. method:: hexdigest()
-
- :return str: The message digest as hex.
-
.. class:: cryptography.primitives.hashes.SHA512()
SHA-512 is a cryptographic hash function from the SHA-2 family and
standardized by NIST. It has a 512-bit message digest.
- .. method:: update(string)
-
- :param bytes string: The bytes you wish to hash.
-
- .. method:: digest()
-
- :return bytes: The message digest as bytes.
-
- .. method:: hexdigest()
-
- :return str: The message digest as hex.
-
RIPEMD160
-~~~~~~~
+~~~~~~~~~
.. class:: cryptography.primitives.hashes.RIPEMD160()
RIPEMD160 is a cryptographic hash function that is part of ISO/IEC
10118-3:2004. It has a 160-bit message digest.
- .. method:: update(string)
-
- :param bytes string: The bytes you wish to hash.
-
- .. method:: digest()
-
- :return bytes: The message digest as bytes.
-
- .. method:: hexdigest()
-
- :return str: The message digest as hex.
-
Whirlpool
-~~~~~~~
+~~~~~~~~~
.. class:: cryptography.primitives.hashes.Whirlpool()
Whirlpool is a cryptographic hash function that is part of ISO/IEC
10118-3:2004. It has a 512-bit message digest.
- .. method:: update(string)
-
- :param bytes string: The bytes you wish to hash.
-
- .. method:: digest()
-
- :return bytes: The message digest as bytes.
-
- .. method:: hexdigest()
-
- :return str: The message digest as hex.
-
MD5
-~~~~~~~
+~~~
.. warning::
@@ -150,15 +87,3 @@ MD5
MD5 is a deprecated cryptographic hash function. It has a 160-bit message
digest and has practical known collision attacks.
-
- .. method:: update(string)
-
- :param bytes string: The bytes you wish to hash.
-
- .. method:: digest()
-
- :return bytes: The message digest as bytes.
-
- .. method:: hexdigest()
-
- :return str: The message digest as hex.