summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2022-01-13 16:19:01 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2022-01-13 16:19:01 +0700
commitc87a30228f7162febe9babd597b4f89e9f91dad6 (patch)
tree5df72c0b7a4beb3bc152c37972ff5742114c2274
parentadded additional OIDs in line with draft-uni-qsckeys-00.txt (diff)
downloadBouncyCastle.NET-ed25519-c87a30228f7162febe9babd597b4f89e9f91dad6.tar.xz
added key length check
-rw-r--r--crypto/src/crypto/engines/SEEDEngine.cs3
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/src/crypto/engines/SEEDEngine.cs b/crypto/src/crypto/engines/SEEDEngine.cs
index f615b8476..d4142c867 100644
--- a/crypto/src/crypto/engines/SEEDEngine.cs
+++ b/crypto/src/crypto/engines/SEEDEngine.cs
@@ -240,6 +240,9 @@ namespace Org.BouncyCastle.Crypto.Engines
 		private int[] createWorkingKey(
 			byte[] inKey)
 		{
+			if (inKey.Length != 16)
+				throw new ArgumentException("key size must be 128 bits");
+
 			int[] key = new int[32];
 			long lower = bytesToLong(inKey, 0);
 			long upper = bytesToLong(inKey, 8);