private void Check(int keySize) { BulkCipherAlgorithmAES cipher = new BulkCipherAlgorithmAES(keySize); Assert.AreEqual(keySize / 8, cipher.KeySize); Assert.AreEqual(16, cipher.BlockSize); Assert.AreEqual(keySize, cipher.Strength); Assert.AreEqual(BulkCipherAlgorithmType.Block, cipher.Type); Assert.IsTrue(cipher.SupportsProtocolVersion(ProtocolVersion.TLS1_0)); Assert.IsTrue(cipher.SupportsProtocolVersion(ProtocolVersion.DTLS1_0)); Assert.IsNotNull(cipher.CreateEncryptor(new byte[keySize / 8], null)); Assert.IsNotNull(cipher.CreateDecryptor(new byte[keySize / 8], null)); Assert.IsNotNull(cipher.CreateEncryptor(new byte[keySize / 8], new byte[16])); Assert.IsNotNull(cipher.CreateDecryptor(new byte[keySize / 8], new byte[16])); }
public void EncryptionKeyInvalid() { BulkCipherAlgorithmAES cipher = new BulkCipherAlgorithmAES(128); cipher.CreateEncryptor(new byte[15], null); }
public void EncryptionKeyNull() { BulkCipherAlgorithmAES cipher = new BulkCipherAlgorithmAES(128); cipher.CreateEncryptor(null, null); }
private void Check(int keySize) { BulkCipherAlgorithmAES cipher = new BulkCipherAlgorithmAES(keySize); Assert.AreEqual (keySize/8, cipher.KeySize); Assert.AreEqual (16, cipher.BlockSize); Assert.AreEqual (keySize, cipher.Strength); Assert.AreEqual (BulkCipherAlgorithmType.Block, cipher.Type); Assert.IsTrue (cipher.SupportsProtocolVersion(ProtocolVersion.TLS1_0)); Assert.IsTrue (cipher.SupportsProtocolVersion(ProtocolVersion.DTLS1_0)); Assert.IsNotNull (cipher.CreateEncryptor(new byte[keySize/8], null)); Assert.IsNotNull (cipher.CreateDecryptor(new byte[keySize/8], null)); Assert.IsNotNull (cipher.CreateEncryptor(new byte[keySize/8], new byte[16])); Assert.IsNotNull (cipher.CreateDecryptor(new byte[keySize/8], new byte[16])); }