allocation optimization and in place crypt

This commit is contained in:
2026-06-05 00:22:38 +07:00
parent 6cd4d001ad
commit 05696a836a
10 changed files with 234 additions and 183 deletions
+3 -3
View File
@@ -1,6 +1,6 @@
use bytes::{Bytes, BytesMut};
use bytes::BytesMut;
pub(crate) trait AeadPacker {
fn encrypt(&mut self, data: &mut BytesMut) -> Result<Bytes, chacha20poly1305::aead::Error>;
fn decrypt(&mut self, data: &mut BytesMut) -> Result<Bytes, chacha20poly1305::aead::Error>;
fn encrypt(&mut self, data: &mut BytesMut) -> Result<(), chacha20poly1305::aead::Error>;
fn decrypt(&mut self, data: &mut BytesMut) -> Result<(), chacha20poly1305::aead::Error>;
}