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
/// The ciphertext tree [`encrypt`](crate::encrypt) produces and
/// [`decrypt`](crate::decrypt) consumes.
///
/// The shape mirrors the structure of the plaintext that was encrypted: a
/// scalar yields [`Single`](CipherText::Single), while non-empty sequences
/// and maps yield [`Sequence`](CipherText::Sequence) and
/// [`Map`](CipherText::Map). Empty composites use the authenticated marker
/// variants [`EmptySequence`](CipherText::EmptySequence) and
/// [`EmptyMap`](CipherText::EmptyMap), since they contain no element
/// ciphertexts to authenticate the supplied AAD. Nested structures are
/// represented recursively. An absent value (`Option::None`, a host null)
/// is a null leaf, a `Single` like any other scalar.
///
/// The two parameters:
///
/// - `Leaf` is the sealed leaf the cipher produces
/// ([`Cipher::Leaf`](crate::Cipher::Leaf)) — e.g. [`LocalCipherText`](crate::LocalCipherText)
/// for a local AES cipher, or an envelope leaf that additionally carries
/// a wrapped data key.
/// - `P` is the passthrough payload. For the sink-based path it is a
/// [`PassthroughFrame`](crate::PassthroughFrame): [`Node`](crate::Node)
/// is this tree with that payload.
///
/// Only the `Leaf` type carries a byte-level format commitment (and should
/// implement `serde` where ciphertexts are persisted). The container itself
/// has no canonical byte representation: hosts project it onto their native
/// structures (a JS object tree, the Go binding's transport codec), with
/// leaves as opaque byte strings.