diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-01-13 16:19:01 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-01-13 16:19:01 +0700 |
commit | c87a30228f7162febe9babd597b4f89e9f91dad6 (patch) | |
tree | 5df72c0b7a4beb3bc152c37972ff5742114c2274 | |
parent | added additional OIDs in line with draft-uni-qsckeys-00.txt (diff) | |
download | BouncyCastle.NET-ed25519-c87a30228f7162febe9babd597b4f89e9f91dad6.tar.xz |
added key length check
-rw-r--r-- | crypto/src/crypto/engines/SEEDEngine.cs | 3 |
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); |