Skip to main content

StreamConfig

Enum StreamConfig 

Source
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

VariantPadding schemeTrailer lengthTrailer layout
V0legacy modulo (low nibble of reserved_modulo)32 Bcontiguous HMAC tag
V1legacy modulo (last buffered byte)33 Bmodulo byte then HMAC tag
V2legacy modulo (last buffered byte)33 Bmodulo byte then HMAC tag
V3PKCS#7 (1..=16)32 Bcontiguous 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.

Fields

§reserved_modulo: u8

5th header byte; low nibble is the final-block byte count.

§

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

Source§

fn clone(&self) -> StreamConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for StreamConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V