ARCFourCipherSuitePlugin.ARCFourCryptoTransformTest.CheckVector C# (CSharp) Метод

CheckVector() приватный Метод

private CheckVector ( byte key, byte plaintext, byte ciphertext ) : void
key byte
plaintext byte
ciphertext byte
Результат void
        private void CheckVector(byte[] key, byte[] plaintext, byte[] ciphertext)
        {
            BulkCipherAlgorithmARCFour cipher = new BulkCipherAlgorithmARCFour(key.Length*8);
            ICryptoTransform encryptor = cipher.CreateEncryptor(key, null);
            byte[] enc = encryptor.TransformFinalBlock(plaintext, 0, plaintext.Length);
            ICryptoTransform decryptor = cipher.CreateDecryptor(key, null);
            byte[] dec = decryptor.TransformFinalBlock(enc, 0, enc.Length);
            Assert.AreEqual(ciphertext, enc);
            Assert.AreEqual(plaintext, dec);
        }