pub struct Cipher(/* private fields */);Implementations§
Source§impl Cipher
impl Cipher
pub fn new(key: &Key) -> Self
pub fn encrypt(&self, msg: impl AsRef<[u8]>) -> Result<Encypted>
pub fn encrypt_with_aad( &self, aad: impl AsRef<[u8]>, msg: impl AsRef<[u8]>, ) -> Result<Encypted>
pub fn decrypt(&self, encrypted: &Encypted) -> Result<Bytes>
pub fn decrypt_with_aad( &self, aad: impl AsRef<[u8]>, encrypted: &Encypted, ) -> Result<Bytes>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Cipher
impl RefUnwindSafe for Cipher
impl Send for Cipher
impl Sync for Cipher
impl Unpin for Cipher
impl UnsafeUnpin for Cipher
impl UnwindSafe for Cipher
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