aboutsummaryrefslogtreecommitdiffstats
path: root/docs/primitives
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2013-10-22 17:49:59 -0700
committerAlex Gaynor <alex.gaynor@gmail.com>2013-10-22 17:49:59 -0700
commit68e5de708d623a03ea4cbd4d3a4297b5722950eb (patch)
tree352e79f01a0dc7194e9b67967cb4d208b918e452 /docs/primitives
parente17bd00da8f7805bb7ed469d50c5ac2d5433fc72 (diff)
parent1f3d718cd48ae5f2efe01f724cdf00669087af8f (diff)
downloadcryptography-68e5de708d623a03ea4cbd4d3a4297b5722950eb.tar.gz
cryptography-68e5de708d623a03ea4cbd4d3a4297b5722950eb.tar.bz2
cryptography-68e5de708d623a03ea4cbd4d3a4297b5722950eb.zip
Merge pull request #171 from dreid/use-currentmodule
Make use of currentmodule to maybe reduce redundant module definitions a...
Diffstat (limited to 'docs/primitives')
-rw-r--r--docs/primitives/cryptographic-hashes.rst20
-rw-r--r--docs/primitives/symmetric-encryption.rst28
2 files changed, 29 insertions, 19 deletions
diff --git a/docs/primitives/cryptographic-hashes.rst b/docs/primitives/cryptographic-hashes.rst
index abeb8467..dcf21250 100644
--- a/docs/primitives/cryptographic-hashes.rst
+++ b/docs/primitives/cryptographic-hashes.rst
@@ -1,7 +1,9 @@
Message Digests
===============
-.. class:: cryptography.primitives.hashes.BaseHash(data=None)
+.. currentmodule:: cryptography.primitives.hashes
+
+.. class:: BaseHash(data=None)
Abstract base class that implements a common interface for all hash
algorithms that follow here.
@@ -32,7 +34,7 @@ SHA-1
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:: SHA1()
SHA-1 is a cryptographic hash function standardized by NIST. It has a
160-bit message digest.
@@ -40,22 +42,22 @@ SHA-1
SHA-2 Family
~~~~~~~~~~~~
-.. class:: cryptography.primitives.hashes.SHA224()
+.. class:: SHA224()
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()
+.. class:: SHA256()
SHA-256 is a cryptographic hash function from the SHA-2 family and
standardized by NIST. It has a 256-bit message digest.
-.. class:: cryptography.primitives.hashes.SHA384()
+.. class:: SHA384()
SHA-384 is a cryptographic hash function from the SHA-2 family and
standardized by NIST. It has a 384-bit message digest.
-.. class:: cryptography.primitives.hashes.SHA512()
+.. class:: SHA512()
SHA-512 is a cryptographic hash function from the SHA-2 family and
standardized by NIST. It has a 512-bit message digest.
@@ -63,7 +65,7 @@ SHA-2 Family
RIPEMD160
~~~~~~~~~
-.. class:: cryptography.primitives.hashes.RIPEMD160()
+.. class:: RIPEMD160()
RIPEMD160 is a cryptographic hash function that is part of ISO/IEC
10118-3:2004. It has a 160-bit message digest.
@@ -71,7 +73,7 @@ RIPEMD160
Whirlpool
~~~~~~~~~
-.. class:: cryptography.primitives.hashes.Whirlpool()
+.. class:: Whirlpool()
Whirlpool is a cryptographic hash function that is part of ISO/IEC
10118-3:2004. It has a 512-bit message digest.
@@ -84,7 +86,7 @@ MD5
MD5 is a deprecated hash algorithm that has practical known collision
attacks. You are strongly discouraged from using it.
-.. class:: cryptography.primitives.hashes.MD5()
+.. class:: MD5()
MD5 is a deprecated cryptographic hash function. It has a 128-bit message
digest and has practical known collision attacks.
diff --git a/docs/primitives/symmetric-encryption.rst b/docs/primitives/symmetric-encryption.rst
index 9768246c..87e1e692 100644
--- a/docs/primitives/symmetric-encryption.rst
+++ b/docs/primitives/symmetric-encryption.rst
@@ -1,6 +1,8 @@
Symmetric Encryption
====================
+.. currentmodule:: cryptography.primitives.block
+
.. testsetup::
import binascii
@@ -11,7 +13,7 @@ Symmetric Encryption
Symmetric encryption is a way to encrypt (hide the plaintext value) material
where the encrypter and decrypter both use the same key.
-.. class:: cryptography.primitives.block.BlockCipher(cipher, mode)
+.. class:: BlockCipher(cipher, mode)
Block ciphers work by encrypting content in chunks, often 64- or 128-bits.
They combine an underlying algorithm (such as AES), with a mode (such as
@@ -43,7 +45,9 @@ where the encrypter and decrypter both use the same key.
:class:`~cryptography.primitives.interfaces.CipherContext`
provider.
-.. class:: cryptography.primitives.interfaces.CipherContext()
+.. currentmodule:: cryptography.primitives.interfaces
+
+.. class:: CipherContext()
When calling ``encryptor()`` or ``decryptor()`` on a BlockCipher object you
will receive a return object conforming to the CipherContext interface. You
@@ -64,7 +68,9 @@ where the encrypter and decrypter both use the same key.
Ciphers
~~~~~~~
-.. class:: cryptography.primitives.block.ciphers.AES(key)
+.. currentmodule:: cryptography.primitives.block.ciphers
+
+.. class:: AES(key)
AES (Advanced Encryption Standard) is a block cipher standardized by NIST.
AES is both fast, and cryptographically strong. It is a good default
@@ -73,7 +79,7 @@ Ciphers
:param bytes key: The secret key, either ``128``, ``192``, or ``256`` bits.
This must be kept secret.
-.. class:: cryptography.primitives.block.ciphers.Camellia(key)
+.. class:: Camellia(key)
Camellia is a block cipher approved for use by CRYPTREC and ISO/IEC.
It is considered to have comparable security and performance to AES, but
@@ -83,7 +89,7 @@ Ciphers
This must be kept secret.
-.. class:: cryptography.primitives.block.ciphers.TripleDES(key)
+.. class:: TripleDES(key)
Triple DES (Data Encryption Standard), sometimes refered to as 3DES, is a
block cipher standardized by NIST. Triple DES has known cryptoanalytic
@@ -103,7 +109,9 @@ Ciphers
Modes
~~~~~
-.. class:: cryptography.primitives.block.modes.CBC(initialization_vector)
+.. currentmodule:: cryptography.primitives.block.modes
+
+.. class:: CBC(initialization_vector)
CBC (Cipher block chaining) is a mode of operation for block ciphers. It is
considered cryptographically strong.
@@ -117,7 +125,7 @@ Modes
a given ``key``.
-.. class:: cryptography.primitives.block.modes.CTR(nonce)
+.. class:: CTR(nonce)
.. warning::
@@ -135,7 +143,7 @@ Modes
with a given key. The nonce does not need to be kept
secret and may be included alongside the ciphertext.
-.. class:: cryptography.primitives.block.modes.OFB(initialization_vector)
+.. class:: OFB(initialization_vector)
OFB (Output Feedback) is a mode of operation for block ciphers. It
transforms a block cipher into a stream cipher.
@@ -148,7 +156,7 @@ Modes
reuse an ``initialization_vector`` with
a given ``key``.
-.. class:: cryptography.primitives.block.modes.CFB(initialization_vector)
+.. class:: CFB(initialization_vector)
CFB (Cipher Feedback) is a mode of operation for block ciphers. It
transforms a block cipher into a stream cipher.
@@ -171,7 +179,7 @@ Insecure Modes
and existing applications should strongly consider migrating away.
-.. class:: cryptography.primitives.block.modes.ECB()
+.. class:: ECB()
ECB (Electronic Code Book) is the simplest mode of operation for block
ciphers. Each block of data is encrypted in the same way. This means