Struct fire_crypto::cipher::Key
source · 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 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