pub enum StreamConfig {
V0 {
reserved_modulo: u8,
},
V1,
V2,
V3,
}Expand description
Per-version configuration for decrypt_ciphertext_stream.
Selects the padding scheme and trailer layout to use after the streaming
CBC loop has consumed the ciphertext. Construct this from the (version, modulo_or_reserved) tuple returned by
crate::decryption::read_file_version.
§Format
| Variant | Padding scheme | Trailer length | Trailer layout |
|---|---|---|---|
V0 | legacy modulo (low nibble of reserved_modulo) | 32 B | contiguous HMAC tag |
V1 | legacy modulo (last buffered byte) | 33 B | modulo byte then HMAC tag |
V2 | legacy modulo (last buffered byte) | 33 B | modulo byte then HMAC tag |
V3 | PKCS#7 (1..=16) | 32 B | contiguous HMAC tag |
§Security
V0/V1/V2 exist only for read compatibility; this crate never produces
them. Use V3 for any new file.
Variants§
V0
AES Crypt v0 — legacy modulo padding, 32-byte contiguous HMAC trailer.
reserved_modulo is the 5th header byte (the v0 modulo byte) and
determines the final-block length: len = (reserved_modulo & 0x0F),
or 16 when that nibble is zero.
V1
AES Crypt v1 — legacy modulo padding with the modulo byte embedded in a 33-byte scattered trailer.
V2
AES Crypt v2 — same trailer/padding shape as v1, plus header extensions before the encrypted session block.
V3
AES Crypt v3 — PKCS#7 padding and a 32-byte contiguous HMAC-SHA256 trailer. The only format this crate writes.
Trait Implementations§
Source§impl Clone for StreamConfig
impl Clone for StreamConfig
Source§fn clone(&self) -> StreamConfig
fn clone(&self) -> StreamConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more