Пример #1
0
        private static byte[] AesSivMac(byte[] macKey, byte[] header, byte[] data)
        {
            var cmzerod = Double(CMac.GetHashTag(macKey, new byte[16]));
            var h1Mac   = CMac.GetHashTag(macKey, header);
            var m1      = XorArray(h1Mac, cmzerod);
            var t       = XorEnd(data, m1);
            var iv      = CMac.GetHashTag(macKey, t);

            return(iv);
        }
Пример #2
0
 private static byte[] AesSp800108(byte[] data, byte[] macKey)
 {
     byte[] key1 = CMac.GetHashTag(macKey, data.Concat <byte>(new byte[] { 0x01, 0x01, 0x00 }).ToArray());
     byte[] key2 = CMac.GetHashTag(macKey, data.Concat <byte>(new byte[] { 0x02, 0x01, 0x00 }).ToArray());
     return(key1.Concat(key2).ToArray());
 }