Inheritance: IKeyDerivationFunction
 public void DifferingSaltsProduceDifferingKeys()
 {
     var keyDerivationFunction = new Pkcs5S2KeyGenerator();
     var key1 = keyDerivationFunction.DeriveKey("", new byte[0]);
     var key2 = keyDerivationFunction.DeriveKey("", new byte[] {1});
     Assert.That(key1, Is.Not.EquivalentTo(key2));
 }
 public void IdenticalParametersProduceIdenticalKeys()
 {
     var keyDerivationFunction = new Pkcs5S2KeyGenerator();
     var key1 = keyDerivationFunction.DeriveKey("", new byte[0]);
     var key2 = keyDerivationFunction.DeriveKey("", new byte[0]);
     Assert.That(key1, Is.EquivalentTo(key2));
 }
 public void DifferingKeysizeProduceDifferingKeys()
 {
     var keyDerivationFunction1 = new Pkcs5S2KeyGenerator();
     var keyDerivationFunction2 = new Pkcs5S2KeyGenerator(512);
     var key1 = keyDerivationFunction1.DeriveKey("", new byte[0]);
     var key2 = keyDerivationFunction2.DeriveKey("", new byte[0]);
     Assert.That(key1, Is.Not.EquivalentTo(key2));
 }
 public void KeyLengthIsKeyBitSizeDividedBy8(int keyBitSize)
 {
     var keyDerivationFunction = new Pkcs5S2KeyGenerator(keyBitSize);
     var key = keyDerivationFunction.DeriveKey("", new byte[0]);
     Assert.That(key.Length, Is.EqualTo(keyBitSize / 8));
 }