summary refs log tree commit diff
path: root/crypto/src/crypto/encodings/OaepEncoding.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/crypto/encodings/OaepEncoding.cs')
-rw-r--r--crypto/src/crypto/encodings/OaepEncoding.cs19
1 files changed, 6 insertions, 13 deletions
diff --git a/crypto/src/crypto/encodings/OaepEncoding.cs b/crypto/src/crypto/encodings/OaepEncoding.cs
index a0ae7d1e6..9ddaec779 100644
--- a/crypto/src/crypto/encodings/OaepEncoding.cs
+++ b/crypto/src/crypto/encodings/OaepEncoding.cs
@@ -285,24 +285,17 @@ namespace Org.BouncyCastle.Crypto.Encodings
             return output;
         }
 
-        private byte[] MaskGeneratorFunction(
-            byte[] Z,
-            int zOff,
-            int zLen,
-            int length)
+        private byte[] MaskGeneratorFunction(byte[] Z, int zOff, int zLen, int length)
         {
-            if (mgf1Hash is IXof)
+            if (mgf1Hash is IXof xof)
             {
                 byte[] mask = new byte[length];
-                mgf1Hash.BlockUpdate(Z, zOff, zLen);
-                ((IXof)mgf1Hash).OutputFinal(mask, 0, mask.Length);
-
+                xof.BlockUpdate(Z, zOff, zLen);
+                xof.OutputFinal(mask, 0, length);
                 return mask;
             }
-            else
-            {
-                return MaskGeneratorFunction1(Z, zOff, zLen, length);
-            }
+
+            return MaskGeneratorFunction1(Z, zOff, zLen, length);
         }
 
         /**