示例#1
0
        protected static int CalculateRecordMac(KeyParameter macKey, byte[] additionalData, byte[] buf, int off, int len, byte[] outMac)
        {
            _mac.Reset();
            _mac.Init(macKey);

            UpdateRecordMacText(_mac, additionalData, 0, additionalData.Length);
            UpdateRecordMacText(_mac, buf, off, len);
            UpdateRecordMacLength(_mac, additionalData.Length);
            UpdateRecordMacLength(_mac, len);

            return(MacUtilities.DoFinalOut(_mac, outMac));
        }