1 files changed, 4 insertions, 9 deletions
diff --git a/crypto/src/crypto/BufferedAeadCipher.cs b/crypto/src/crypto/BufferedAeadCipher.cs
index fb3408e12..22f65c628 100644
--- a/crypto/src/crypto/BufferedAeadCipher.cs
+++ b/crypto/src/crypto/BufferedAeadCipher.cs
@@ -16,10 +16,7 @@ namespace Org.BouncyCastle.Crypto
public BufferedAeadCipher(IAeadCipher cipher)
{
- if (cipher == null)
- throw new ArgumentNullException("cipher");
-
- this.cipher = cipher;
+ this.cipher = cipher ?? throw new ArgumentNullException(nameof(cipher));
}
public override string AlgorithmName
@@ -36,13 +33,11 @@ namespace Org.BouncyCastle.Crypto
* @exception ArgumentException if the parameters argument is
* inappropriate.
*/
- public override void Init(
- bool forEncryption,
- ICipherParameters parameters)
+ public override void Init(bool forEncryption, ICipherParameters parameters)
{
- if (parameters is ParametersWithRandom)
+ if (parameters is ParametersWithRandom withRandom)
{
- parameters = ((ParametersWithRandom)parameters).Parameters;
+ parameters = withRandom.Parameters;
}
cipher.Init(forEncryption, parameters);
|