pub struct Key { /* private fields */ }Expand description
A Key that allows to encrypt and decrypt messages.
Implementations§
Source§impl Key
impl Key
Sourcepub fn encrypt(&mut self, msg: &mut [u8]) -> Mac
pub fn encrypt(&mut self, msg: &mut [u8]) -> Mac
Encrypts bytes generating returning the generated Mac-
Sourcepub fn decrypt(
&mut self,
msg: &mut [u8],
recv_mac: &Mac,
) -> Result<(), MacNotEqual>
pub fn decrypt( &mut self, msg: &mut [u8], recv_mac: &Mac, ) -> Result<(), MacNotEqual>
Decrypts data, returning an Error if the Mac’s do not match.
pub fn into_sync(self) -> SyncKey
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Key
impl RefUnwindSafe for Key
impl Send for Key
impl Sync for Key
impl Unpin for Key
impl UnwindSafe for Key
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