pub struct RspamdSecretbox { /* private fields */ }Implementations§
Source§impl RspamdSecretbox
impl RspamdSecretbox
Sourcepub fn new(key: Zeroizing<GenericArray<u8, U32>>, nonce: XNonce) -> Self
pub fn new(key: Zeroizing<GenericArray<u8, U32>>, nonce: XNonce) -> Self
Construct new secretbox following Rspamd conventions
Sourcepub fn encrypt_in_place(self, data: &mut [u8]) -> Tag
pub fn encrypt_in_place(self, data: &mut [u8]) -> Tag
Encrypts data in place and returns a tag
Sourcepub fn decrypt_in_place(
&mut self,
data: &mut [u8],
tag: &Tag,
) -> Result<usize, RspamdError>
pub fn decrypt_in_place( &mut self, data: &mut [u8], tag: &Tag, ) -> Result<usize, RspamdError>
Decrypts in place if auth tag is correct
Auto Trait Implementations§
impl Freeze for RspamdSecretbox
impl RefUnwindSafe for RspamdSecretbox
impl Send for RspamdSecretbox
impl Sync for RspamdSecretbox
impl Unpin for RspamdSecretbox
impl UnwindSafe for RspamdSecretbox
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