diff options
-rw-r--r-- | crypto/src/pqc/crypto/crystals/dilithium/Symmetric.cs | 4 | ||||
-rw-r--r-- | crypto/src/pqc/crypto/crystals/kyber/Symmetric.cs | 5 |
2 files changed, 3 insertions, 6 deletions
diff --git a/crypto/src/pqc/crypto/crystals/dilithium/Symmetric.cs b/crypto/src/pqc/crypto/crystals/dilithium/Symmetric.cs index b3836ef87..6cea667c6 100644 --- a/crypto/src/pqc/crypto/crystals/dilithium/Symmetric.cs +++ b/crypto/src/pqc/crypto/crystals/dilithium/Symmetric.cs @@ -1,9 +1,7 @@ using Org.BouncyCastle.Crypto; using Org.BouncyCastle.Crypto.Digests; -using Org.BouncyCastle.Crypto.Engines; using Org.BouncyCastle.Crypto.Modes; using Org.BouncyCastle.Crypto.Parameters; -using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Pqc.Crypto.Crystals.Dilithium { @@ -53,7 +51,7 @@ namespace Org.BouncyCastle.Pqc.Crypto.Crystals.Dilithium expnonce[0] = (byte)nonce; expnonce[1] = (byte)(nonce >> 8); - ParametersWithIV kp = new ParametersWithIV(new KeyParameter(Arrays.CopyOfRange(key, 0, 32)), expnonce); + ParametersWithIV kp = new ParametersWithIV(new KeyParameter(key, 0, 32), expnonce); cipher.Init(true, kp); } diff --git a/crypto/src/pqc/crypto/crystals/kyber/Symmetric.cs b/crypto/src/pqc/crypto/crystals/kyber/Symmetric.cs index bea8cae54..9aad815da 100644 --- a/crypto/src/pqc/crypto/crystals/kyber/Symmetric.cs +++ b/crypto/src/pqc/crypto/crystals/kyber/Symmetric.cs @@ -4,7 +4,6 @@ using Org.BouncyCastle.Crypto; using Org.BouncyCastle.Crypto.Digests; using Org.BouncyCastle.Crypto.Modes; using Org.BouncyCastle.Crypto.Parameters; -using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Pqc.Crypto.Crystals.Kyber { @@ -135,7 +134,7 @@ namespace Org.BouncyCastle.Pqc.Crypto.Crystals.Kyber expnonce[0] = x; expnonce[1] = y; - ParametersWithIV kp = new ParametersWithIV(new KeyParameter(Arrays.CopyOfRange(key, 0, 32)), expnonce); + ParametersWithIV kp = new ParametersWithIV(new KeyParameter(key, 0, 32), expnonce); cipher.Init(true, kp); } @@ -149,7 +148,7 @@ namespace Org.BouncyCastle.Pqc.Crypto.Crystals.Kyber byte[] expnonce = new byte[12]; expnonce[0] = nonce; - ParametersWithIV kp = new ParametersWithIV(new KeyParameter(Arrays.CopyOfRange(key, 0, 32)), expnonce); + ParametersWithIV kp = new ParametersWithIV(new KeyParameter(key, 0, 32), expnonce); cipher.Init(true, kp); Aes128(output, 0, output.Length); } |