Struct ssh_cipher::Decryptor
source · pub struct Decryptor { /* private fields */ }Available on crate features
aes-cbc or aes-ctr or tdes only.Expand description
Stateful decryptor object for unauthenticated SSH symmetric ciphers.
Note that this deliberately does not support AEAD modes such as AES-GCM and ChaCha20Poly1305, which are one-shot by design.
Implementations§
source§impl Decryptor
impl Decryptor
sourcepub fn new(cipher: Cipher, key: &[u8], iv: &[u8]) -> Result<Self>
pub fn new(cipher: Cipher, key: &[u8], iv: &[u8]) -> Result<Self>
Create a new decryptor object with the given Cipher, key, and IV.
sourcepub fn decrypt(&mut self, buffer: &mut [u8]) -> Result<()>
pub fn decrypt(&mut self, buffer: &mut [u8]) -> Result<()>
Decrypt the given buffer in place.
Returns Error::Length in the event that buffer is not a multiple of the cipher’s
block size.
sourcepub fn peek_decrypt(&self, buffer: &mut [u8]) -> Result<()>
pub fn peek_decrypt(&self, buffer: &mut [u8]) -> Result<()>
Decrypt the given buffer in place without altering the internal state
Returns Error::Length in the event that buffer is not a multiple of the cipher’s
block size.
Auto Trait Implementations§
impl Freeze for Decryptor
impl RefUnwindSafe for Decryptor
impl Send for Decryptor
impl Sync for Decryptor
impl Unpin for Decryptor
impl UnwindSafe for Decryptor
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more