summary refs log tree commit diff
path: root/crypto/src/pqc
diff options
context:
space:
mode:
authorroyb <roy.basmacier@primekey.com>2022-09-29 18:31:17 -0400
committerroyb <roy.basmacier@primekey.com>2022-09-29 18:31:17 -0400
commitf770ff91867405c13e8b28118324693a8917b78b (patch)
tree00d08c47c8529c644e7de471d4f34246ce2b6307 /crypto/src/pqc
parentAdded ASN.1 key encoding/decoding for Kyber, Dilithium, and Falcon. (diff)
parentGrain128Aead performance, constant-time (diff)
downloadBouncyCastle.NET-ed25519-f770ff91867405c13e8b28118324693a8917b78b.tar.xz
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'crypto/src/pqc')
-rw-r--r--crypto/src/pqc/crypto/crystals/dilithium/Symmetric.cs5
-rw-r--r--crypto/src/pqc/crypto/crystals/kyber/Symmetric.cs8
-rw-r--r--crypto/src/pqc/crypto/sphincsplus/SPHINCSPlusEngine.cs1
3 files changed, 7 insertions, 7 deletions
diff --git a/crypto/src/pqc/crypto/crystals/dilithium/Symmetric.cs b/crypto/src/pqc/crypto/crystals/dilithium/Symmetric.cs
index a46c12d90..d025b98fd 100644
--- a/crypto/src/pqc/crypto/crystals/dilithium/Symmetric.cs
+++ b/crypto/src/pqc/crypto/crystals/dilithium/Symmetric.cs
@@ -1,4 +1,5 @@
-using Org.BouncyCastle.Crypto.Digests;
+using Org.BouncyCastle.Crypto;
+using Org.BouncyCastle.Crypto.Digests;
 using Org.BouncyCastle.Crypto.Engines;
 using Org.BouncyCastle.Crypto.Modes;
 using Org.BouncyCastle.Crypto.Parameters;
@@ -34,7 +35,7 @@ namespace Org.BouncyCastle.Pqc.Crypto.Crystals.Dilithium
             public AesSymmetric()
                 : base(64, 64)
             {
-                cipher = new SicBlockCipher(new AesEngine());
+                cipher = new SicBlockCipher(AesUtilities.CreateEngine());
             }
 
             private void Aes128(byte[] output, int offset, int size)
diff --git a/crypto/src/pqc/crypto/crystals/kyber/Symmetric.cs b/crypto/src/pqc/crypto/crystals/kyber/Symmetric.cs
index 1ceb76b98..b618d7bce 100644
--- a/crypto/src/pqc/crypto/crystals/kyber/Symmetric.cs
+++ b/crypto/src/pqc/crypto/crystals/kyber/Symmetric.cs
@@ -1,7 +1,7 @@
-using Org.BouncyCastle.Crypto.Digests;
-using System;
+using System;
+
 using Org.BouncyCastle.Crypto;
-using Org.BouncyCastle.Crypto.Engines;
+using Org.BouncyCastle.Crypto.Digests;
 using Org.BouncyCastle.Crypto.Modes;
 using Org.BouncyCastle.Crypto.Parameters;
 using Org.BouncyCastle.Utilities;
@@ -102,7 +102,7 @@ namespace Org.BouncyCastle.Pqc.Crypto.Crystals.Kyber
             {
                 this.sha256Digest = new Sha256Digest();
                 this.sha512Digest = new Sha512Digest();
-                this.cipher = new SicBlockCipher(new AesEngine());
+                this.cipher = new SicBlockCipher(AesUtilities.CreateEngine());
             }
             private void DoDigest(IDigest digest, byte[] output, byte[] input, int outOffset)
             {
diff --git a/crypto/src/pqc/crypto/sphincsplus/SPHINCSPlusEngine.cs b/crypto/src/pqc/crypto/sphincsplus/SPHINCSPlusEngine.cs
index e7455d253..85c50f3c4 100644
--- a/crypto/src/pqc/crypto/sphincsplus/SPHINCSPlusEngine.cs
+++ b/crypto/src/pqc/crypto/sphincsplus/SPHINCSPlusEngine.cs
@@ -107,7 +107,6 @@ namespace Org.BouncyCastle.Pqc.Crypto.SphincsPlus
         internal class Sha2Engine
             : SPHINCSPlusEngine
         {
-            private byte[] padding = new byte[128];
             private HMac treeHMac;
             private Mgf1BytesGenerator mgf1;
             private byte[] hmacBuf;