aboutsummaryrefslogtreecommitdiffstats
path: root/docs/hazmat
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2013-11-19 16:49:26 -0800
committerAlex Gaynor <alex.gaynor@gmail.com>2013-11-19 16:49:26 -0800
commit9626b5a50460d2f90baa1f1b8c6a09ccc900c178 (patch)
treee6bd8686168074a76711fc17bf18af06a257e4d0 /docs/hazmat
parenteb7f2a37fee0fdeb70f650b46f580b2eab6d0c05 (diff)
downloadcryptography-9626b5a50460d2f90baa1f1b8c6a09ccc900c178.tar.gz
cryptography-9626b5a50460d2f90baa1f1b8c6a09ccc900c178.tar.bz2
cryptography-9626b5a50460d2f90baa1f1b8c6a09ccc900c178.zip
Validate the IV/nonce length for a given algorithm.
Fixes #159
Diffstat (limited to 'docs/hazmat')
-rw-r--r--docs/hazmat/primitives/interfaces.rst12
1 files changed, 12 insertions, 0 deletions
diff --git a/docs/hazmat/primitives/interfaces.rst b/docs/hazmat/primitives/interfaces.rst
index 11cff51a..e798c0e6 100644
--- a/docs/hazmat/primitives/interfaces.rst
+++ b/docs/hazmat/primitives/interfaces.rst
@@ -56,6 +56,18 @@ Interfaces used by the symmetric cipher modes described in
The name may be used by a backend to influence the operation of a
cipher in conjunction with the algorithm's name.
+ .. method:: validate_for_algorithm(algorithm)
+
+ :param CipherAlgorithm algorithm:
+
+ Checks that the combination of this mode with the provided algorithm
+ meets any necessary invariants. This should raise an exception if they
+ are not met.
+
+ For example, the :class:`~cryptography.hazmat.primitives.modes.CBC`
+ mode uses this method to check that the provided initialization
+ vector's length matches the block size of the algorithm.
+
.. class:: ModeWithInitializationVector