aboutsummaryrefslogtreecommitdiffstats
path: root/docs/hazmat/primitives
diff options
context:
space:
mode:
authorDavid Reid <dreid@dreid.org>2014-01-03 16:02:51 -0800
committerDavid Reid <dreid@dreid.org>2014-01-03 16:02:51 -0800
commit24c9a8d153ed7b1520a87d2ad22d9e9b26f272b8 (patch)
treedc1ea9ab698f092f1310d6adf8077f1ef9ad95d5 /docs/hazmat/primitives
parentf96db83a64bb0ac40d04d27383d7c2defbcec491 (diff)
parent267dbc946b4584b7b4ed10a439b2820d3b048356 (diff)
downloadcryptography-24c9a8d153ed7b1520a87d2ad22d9e9b26f272b8.tar.gz
cryptography-24c9a8d153ed7b1520a87d2ad22d9e9b26f272b8.tar.bz2
cryptography-24c9a8d153ed7b1520a87d2ad22d9e9b26f272b8.zip
Merge pull request #272 from alex/validate-iv
Validate the IV/nonce length for a given algorithm.
Diffstat (limited to 'docs/hazmat/primitives')
-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 361b723e..edb24cd9 100644
--- a/docs/hazmat/primitives/interfaces.rst
+++ b/docs/hazmat/primitives/interfaces.rst
@@ -67,6 +67,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