summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--crypto/src/crypto/modes/CtsBlockCipher.cs9
1 files changed, 2 insertions, 7 deletions
diff --git a/crypto/src/crypto/modes/CtsBlockCipher.cs b/crypto/src/crypto/modes/CtsBlockCipher.cs
index ff37844ab..b1b00c5fa 100644
--- a/crypto/src/crypto/modes/CtsBlockCipher.cs
+++ b/crypto/src/crypto/modes/CtsBlockCipher.cs
@@ -121,19 +121,14 @@ namespace Org.BouncyCastle.Crypto.Modes
             int		outOff)
         {
             if (length < 0)
-            {
-                throw new ArgumentException("Can't have a negative input outLength!");
-            }
+                throw new ArgumentException("Can't have a negative input length!");
 
             int blockSize = GetBlockSize();
             int outLength = GetUpdateOutputSize(length);
 
             if (outLength > 0)
             {
-                if ((outOff + outLength) > output.Length)
-                {
-                    throw new DataLengthException("output buffer too short");
-                }
+                Check.OutputLength(output, outOff, outLength, "output buffer too short");
             }
 
             int resultLen = 0;