Exemplo n.º 1
0
        public void NextSubKey_GetsTwoNextSubKeys_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[] { 0xa0, 0x88, 0x23, 0x2a },
                new byte[] { 0xfa, 0x54, 0xa3, 0x6c },
                new byte[] { 0xfe, 0x2c, 0x39, 0x76 },
                new byte[] { 0x17, 0xb1, 0x39, 0x05 }
            };

            key.NextSubKey();

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

            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]);
                }
            }
        }
Exemplo n.º 2
0
        public void NextSubKey_GetsNextSubKey_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[] { 0x2b, 0x28, 0xab, 0x09 },
                new byte[] { 0x7e, 0xae, 0xf7, 0xcf },
                new byte[] { 0x15, 0xd2, 0x15, 0x4f },
                new byte[] { 0x16, 0xa6, 0x88, 0x3c }
            };

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

            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]);
                }
            }
        }