コード例 #1
0
        public void DoubleRoundCorrect2()
        {
            uint[] s = { 0xde501066, 0x6f9eb8f7, 0xe4fbbd9b, 0x454e3f57,
                         0xb75540d3, 0x43e93a4c, 0x3a6f2aa0, 0x726d6b36,
                         0x9243f484, 0x9145d1e8, 0x4fa9d247, 0xdc8dee11,
                         0x054bf545, 0x254dd653, 0xd9421b6d, 0x67b276c1 };

            Salsa20Transformation.DoubleRound(s);
            Assert.Equal(s[0], (uint)0xccaaf672);
            Assert.Equal(s[1], (uint)0x23d960f7);
            Assert.Equal(s[2], (uint)0x9153e63a);
            Assert.Equal(s[3], (uint)0xcd9a60d0);
            Assert.Equal(s[4], (uint)0x50440492);
            Assert.Equal(s[5], (uint)0xf07cad19);
            Assert.Equal(s[6], (uint)0xae344aa0);
            Assert.Equal(s[7], (uint)0xdf4cfdfc);
            Assert.Equal(s[8], (uint)0xca531c29);
            Assert.Equal(s[9], (uint)0x8e7943db);
            Assert.Equal(s[10], (uint)0xac1680cd);
            Assert.Equal(s[11], (uint)0xd503ca00);
            Assert.Equal(s[12], (uint)0xa74b2ad6);
            Assert.Equal(s[13], (uint)0xbc331c5c);
            Assert.Equal(s[14], (uint)0x1dda24c7);
            Assert.Equal(s[15], (uint)0xee928277);
        }
コード例 #2
0
        public void DoubleRoundCorrect()
        {
            uint[] s = { 0x00000001, 0x00000000, 0x00000000, 0x00000000,
                         0x00000000, 0x00000000, 0x00000000, 0x00000000,
                         0x00000000, 0x00000000, 0x00000000, 0x00000000,
                         0x00000000, 0x00000000, 0x00000000, 0x00000000 };

            Salsa20Transformation.DoubleRound(s);
            Assert.Equal(s[0], (uint)0x8186a22d);
            Assert.Equal(s[1], (uint)0x0040a284);
            Assert.Equal(s[2], (uint)0x82479210);
            Assert.Equal(s[3], (uint)0x06929051);
            Assert.Equal(s[4], (uint)0x08000090);
            Assert.Equal(s[5], (uint)0x02402200);
            Assert.Equal(s[6], (uint)0x00004000);
            Assert.Equal(s[7], (uint)0x00800000);
            Assert.Equal(s[8], (uint)0x00010200);
            Assert.Equal(s[9], (uint)0x20400000);
            Assert.Equal(s[10], (uint)0x08008104);
            Assert.Equal(s[11], (uint)0x00000000);
            Assert.Equal(s[12], (uint)0x20500000);
            Assert.Equal(s[13], (uint)0xa0000040);
            Assert.Equal(s[14], (uint)0x0008180a);
            Assert.Equal(s[15], (uint)0x612a8020);
        }