use std::fmt::Debug;
use smb_msg::EncryptionNonce;
use super::CryptoError;
pub struct EncryptionResult {
pub signature: u128,
}
pub trait EncryptingAlgo: Debug + Send + Sync {
fn encrypt(
&mut self,
payload: &mut [u8],
header_data: &[u8],
nonce: &EncryptionNonce,
) -> Result<EncryptionResult, CryptoError>;
fn decrypt(
&mut self,
payload: &mut [u8],
header_data: &[u8],
nonce: &EncryptionNonce,
signature: u128,
) -> Result<(), CryptoError>;
fn nonce_size(&self) -> usize;
fn clone_box(&self) -> Box<dyn EncryptingAlgo>;
}
#[cfg(feature = "__encrypt_core")]
mod impls;
#[cfg(feature = "__encrypt_core")]
pub use impls::*;
#[cfg(not(feature = "__encrypt_core"))]
mod disabled;
#[cfg(not(feature = "__encrypt_core"))]
pub use disabled::*;
#[cfg(any(feature = "encrypt_aes128ccm", feature = "encrypt_aes256ccm"))]
mod encrypt_ccm;
#[cfg(any(feature = "encrypt_aes128gcm", feature = "encrypt_aes256gcm"))]
mod encrypt_gcm;