public CreateDecryptor ( byte rgbKey, byte rgbIV, byte additional ) : ICryptoTransform | ||
rgbKey | byte | |
rgbIV | byte | |
additional | byte | |
return | ICryptoTransform |
public override ICryptoTransform CreateDecryptor(byte[] rgbKey, byte[] rgbIV, byte[] additional)
{
if (rgbKey == null)
throw new ArgumentNullException("rgbKey");
if (rgbKey.Length != _keySize)
throw new CryptographicException("rgbKey");
return new ARCFourCryptoTransform(rgbKey);
}
private void Check(BulkCipherAlgorithmARCFour cipher, int keySize) { Assert.AreEqual(keySize / 8, cipher.KeySize); Assert.AreEqual(0, cipher.BlockSize); Assert.AreEqual(keySize, cipher.Strength); Assert.AreEqual(BulkCipherAlgorithmType.Stream, cipher.Type); Assert.IsTrue(cipher.SupportsProtocolVersion(ProtocolVersion.TLS1_0)); Assert.IsFalse(cipher.SupportsProtocolVersion(ProtocolVersion.DTLS1_0)); Assert.IsNotNull(cipher.CreateEncryptor(new byte[keySize / 8], null)); Assert.IsNotNull(cipher.CreateDecryptor(new byte[keySize / 8], null)); }