pub fn read_exact_span<R, const N: usize>(
reader: &mut R,
) -> Result<SpanBuffer<N>, AescryptError>where
R: Read,Expand description
Reads exactly N bytes from reader into a fresh auto-zeroizing
SpanBuffer<N>.
read_exact_span is the primary stream reader for the constant-memory
decryption path. The returned buffer lives on the stack inside a
secure-gate wrapper so its contents are wiped on drop — important
because pre-authentication header bytes pass through this function.
§Errors
AescryptError::Io—reader.read_exactreturned an error, including premature EOF.
§Panics
Never panics. EOF is surfaced as AescryptError::Io, not a panic.
§Security
Output buffer auto-zeroizes via secure-gate regardless of which
branch of the caller eventually returns.