1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
use Error;
use CipherDirection;
/// An incremental AEAD engine: associated data first, then the message, then
/// [`do_final`](Self::do_final).
///
/// Each message runs under the key and nonce of the last
/// [`AeadCipherInit::init`]. Associated data is authenticated but neither
/// encrypted nor written to the output. Encryption appends the tag to the
/// ciphertext; decryption expects it at the end of the input and verifies it
/// in `do_final`.
///
/// Each engine documents its timing. Lengths are public throughout: the
/// lengths of the message, the associated data and the nonce, and the tag
/// size, decide how much work is done, and the result of a tag check shows in
/// the outcome. A construction over a block cipher is constant time exactly
/// when that cipher is.
/// Prepares an [`AeadCipher`] from a parameter value of type `P`.
///
/// An engine implements it for each parameter type it accepts;
/// [`AeadParamsRef`](crate::AeadParamsRef) serves the common case. Parameter
/// types only carry values: lengths and sizes are validated here.