pub struct ChunkCipher(/* private fields */);Expand description
Keeps one expanded AEAD instance so streaming does not rekey per chunk.
Implementations§
Source§impl ChunkCipher
impl ChunkCipher
pub fn new(key: &DerivedKey) -> Result<Self, CryptoError>
Sourcepub fn seal_in_place(
&self,
nonce: &[u8; 12],
aad: &[u8],
buffer: &mut [u8],
length: usize,
) -> Result<usize, CryptoError>
pub fn seal_in_place( &self, nonce: &[u8; 12], aad: &[u8], buffer: &mut [u8], length: usize, ) -> Result<usize, CryptoError>
Encrypts buffer[..length] in place and appends the tag, returning the ciphertext length.
Sourcepub fn open_in_place(
&self,
nonce: &[u8; 12],
aad: &[u8],
buffer: &mut [u8],
) -> Result<usize, CryptoError>
pub fn open_in_place( &self, nonce: &[u8; 12], aad: &[u8], buffer: &mut [u8], ) -> Result<usize, CryptoError>
Decrypts buffer in place, returning the authenticated plaintext length.
Auto Trait Implementations§
impl Forget for ChunkCipher
impl Freeze for ChunkCipher
impl Move for ChunkCipher
impl RefUnwindSafe for ChunkCipher
impl Send for ChunkCipher
impl Sync for ChunkCipher
impl Unpin for ChunkCipher
impl UnsafeUnpin for ChunkCipher
impl UnwindSafe for ChunkCipher
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