stream_unpack/decrypt/
mod.rs1use thiserror::Error;
2
3#[cfg(feature = "zipcrypto")]
5pub mod zipcrypto;
6
7#[derive(Error, Debug)]
8pub enum DecryptionError {
9 #[error("generic decryption error: {0}")]
10 Generic(String)
11}
12
13#[derive(Error, Debug)]
14pub enum DecryptorCreationError {
15 #[error("generic decryptor creation error: {0}")]
16 Generic(String),
17
18 #[error("incorrect password")]
19 IncorrectPassword,
20
21 #[error("data is not encrypted")]
22 NotEncrypted
23}
24
25pub trait Decryptor: std::fmt::Debug + Send + Sync {
26 fn update(&mut self, data: &[u8]) -> Result<(usize, &[u8]), DecryptionError>;
31}