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.