pub fn create_hmac(key: &Vec<u8>, data: &Vec<u8>) -> Result<Vec<u8>, InvalidKeyLength> {
    let mut mac = HmacSha256::new_varkey(key)?;
    mac.input(data);

    Ok(mac.result().code().to_vec())
}
/// Creates a hmac hash to be appended after the encrypted message
Creates a hmac hash to be appended after the encrypted message
Creates a hmac hash to be appended after the encrypted message
pub fn create_hmac(key: &Vec<u8>, data: &Vec<u8>) -> Result<Vec<u8>, InvalidKeyLength> {
    let mut mac = HmacSha256::new_varkey(key)?;
    mac.input(data);
    Ok(mac.result().code().to_vec())
}
pub fn create_hmac ( key : & Vec < u8 > , data : & Vec < u8 > ) -> Result < Vec < u8 > , InvalidKeyLength > { let mut mac = HmacSha256 :: new_varkey ( key ) ? ; mac . input ( data ) ; Ok ( mac . result ( ) . code ( ) . to_vec ( ) ) }
Creates a hmac hash to be appended after the encrypted message
Creates a hmac hash to be appended after the encrypted message
key
&Vec<u8>
data
&Vec<u8>