Ejemplo n.º 1
0
        public void PreviousSubKey_GetsPreviousSubKey_Received()
        {
            byte[] keyBytes =
            {
                0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c
            };
            AesKey key = new AesKey(keyBytes);

            byte[][] expected =
            {
                new byte[] { 0xd0, 0xc9, 0xe1, 0xb6 },
                new byte[] { 0x14, 0xee, 0x3f, 0x63 },
                new byte[] { 0xf9, 0x25, 0x0c, 0x0c },
                new byte[] { 0xa8, 0x89, 0xc8, 0xa6 }
            };

            byte[][] result = key.PreviousSubKey();

            for (int i = 0; i < result.Length; i++)
            {
                for (int j = 0; j < result[i].Length; j++)
                {
                    Assert.AreEqual(expected[j][i], result[j][i]);
                }
            }
        }