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
//! Stream-cipher contracts.
use crateCipherDirection;
/// An initialized symmetric-key stream cipher.
///
/// This trait contains only operations that can be dispatched through a trait
/// object. Initialization is provided independently by [`StreamCipherInit`].
///
/// Implementations with the same [`Error`](StreamCipher::Error) type can be
/// stored together behind `dyn StreamCipher<Error = E>` after initialization.
/// Initializes an object from parameters of type `P`.
///
/// This trait is independent from [`StreamCipher`]. Consumers that need both
/// capabilities use `C: StreamCipher + StreamCipherInit<P>`. Keeping `P` as a
/// trait parameter lets one caller-owned parameter object flow through any
/// number of composing cipher layers.