calculateMac function
Implementation
Uint8List calculateMac(Uint8List key, Uint8List nonce, Uint8List ciphertext) {
var hmacSha256 = crypto.Hmac(crypto.sha256, key);
var mac = hmacSha256.convert([...nonce, ...ciphertext]).bytes;
return Uint8List.fromList(mac);
}