[][src]Function yaca::simple_calculate_cmac

pub fn simple_calculate_cmac(
    algo: &EncryptAlgorithm,
    sym_key: &Key,
    message: &[u8]
) -> Result<Vec<u8>>

Calculates a CMAC of given message using symmetric key

  • algo is an encryption algorithm that will be used.
  • sym_key is a key that will be used, supported key types:
  • message is a message to calculate HMAC from.
  • The function returns message MAC.
  • For verification, calculate message CMAC and compare with received MAC using Yaca::memcmp().