mod chunk;
mod cipher;
mod error;
mod key;
mod reference;
pub(crate) use chunk::decrypt_chunk_data;
#[cfg(feature = "encryption")]
pub(crate) use chunk::encrypt_chunk;
pub use cipher::{transcrypt, transcrypt_in_place};
pub use error::EncryptionError;
pub use key::EncryptionKey;
pub use reference::EncryptedChunkRef;
#[cfg(feature = "encryption")]
pub trait ChunkEncrypt {
type Encrypted;
fn encrypt_with(&self, key: &EncryptionKey) -> crate::error::Result<Self::Encrypted>;
fn encrypt(&self) -> crate::error::Result<Self::Encrypted> {
self.encrypt_with(&EncryptionKey::generate())
}
}