blob: 7068316ec209675f4cc3c32614b50b0b9a183e74 [file] [log] [blame]
David Reid30722b92013-11-07 13:03:39 -08001.. hazmat::
2
3Interfaces
4==========
5
6
7``cryptography`` uses `Abstract Base Classes`_ as interfaces to describe the
David Reidbd18bcd2013-11-07 13:13:30 -08008properties and methods of most primitive constructs. Backends may also use
9this information to influence their operation. Interfaces should also be used
David Reid30722b92013-11-07 13:03:39 -080010to document argument and return types.
11
David Reid9ed25e42013-11-07 13:15:27 -080012.. _`Abstract Base Classes`: http://docs.python.org/3.2/library/abc.html
David Reid30722b92013-11-07 13:03:39 -080013
14
15Cipher Modes
16~~~~~~~~~~~~
17
18.. currentmodule:: cryptography.hazmat.primitives.interfaces
19
20Interfaces used by the symmetric cipher modes described in
21:ref:`Symmetric Encryption Modes <symmetric-encryption-modes>`.
22
23.. class:: Mode
24
25 A named cipher mode.
26
27 .. attribute:: name
28
29 :type: str
30
31 This should be the standard shorthand name for the mode, for example
32 Cipher-Block Chaining mode is "CBC".
33
34 The name may be used by a backend to influence the operation of a
35 cipher in conjunction with the algorithm's name.
36
37
38.. class:: ModeWithInitializationVector
39
40 A cipher mode with an initialization vector.
41
42 .. attribute:: initialization_vector
43
44 :type: bytes
45
46 Exact requirements of the initialization are described by the
47 documentation of individual modes.
48
49
50.. class:: ModeWithNonce
51
52 A cipher mode with a nonce.
53
54 .. attribute:: nonce
55
56 :type: bytes
57
58 Exact requirements of the nonce are described by the documentation of
59 individual modes.