verifyMac function
Implementation
void verifyMac(
Uint8List hmacKey, Uint8List nonce, Uint8List ciphertext, Uint8List mac) {
Uint8List calculatedMac = calculateMac(hmacKey, nonce, ciphertext);
if (!const ListEquality().equals(calculatedMac, mac)) {
throw Exception('Invalid MAC');
}
}