예제 #1
0
파일: KeyTest.cs 프로젝트: modulexcite/CEX
        private void CompareKeys()
        {
            byte[] key = new byte[32];

            using (RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider())
                rng.GetBytes(key);

            SerpentA a = new SerpentA();
            int[] key1 = a.GetKey(key);
            SerpentB b = new SerpentB();
            int[] key2 = b.GetKey(key);

            if (Compare.AreEqual(key1, key2) == false)
                throw new Exception("Key test failure: Keys are not equal!");
        }
예제 #2
0
        private void CompareKeys()
        {
            byte[] key = new byte[32];

            using (RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider())
                rng.GetBytes(key);

            SerpentA a = new SerpentA();

            int[]    key1 = a.GetKey(key);
            SerpentB b    = new SerpentB();

            int[] key2 = b.GetKey(key);

            if (Compare.AreEqual(key1, key2) == false)
            {
                throw new Exception("Key test failure: Keys are not equal!");
            }
        }