summary refs log tree commit diff
path: root/crypto/test
diff options
context:
space:
mode:
authorDavid Hook <david.hook@keyfactor.com>2023-08-14 13:57:40 +1000
committerDavid Hook <david.hook@keyfactor.com>2023-08-14 13:57:40 +1000
commit0a1854d2f669669a1a375afbc15f1858a885af06 (patch)
tree6332f7dec31c51eb8b53f5a0800199a2df536dab /crypto/test
parentMerge remote-tracking branch 'refs/remotes/origin/master' (diff)
downloadBouncyCastle.NET-ed25519-0a1854d2f669669a1a375afbc15f1858a885af06.tar.xz
removed AES parameters from Dilithium
Diffstat (limited to 'crypto/test')
-rw-r--r--crypto/test/src/pqc/crypto/test/CrystalsDilithiumTest.cs41
1 files changed, 0 insertions, 41 deletions
diff --git a/crypto/test/src/pqc/crypto/test/CrystalsDilithiumTest.cs b/crypto/test/src/pqc/crypto/test/CrystalsDilithiumTest.cs
index bb6da3ffb..85133cb22 100644
--- a/crypto/test/src/pqc/crypto/test/CrystalsDilithiumTest.cs
+++ b/crypto/test/src/pqc/crypto/test/CrystalsDilithiumTest.cs
@@ -21,9 +21,6 @@ namespace Org.BouncyCastle.Pqc.Crypto.Tests
             { "PQCsignKAT_Dilithium2.rsp", DilithiumParameters.Dilithium2 },
             { "PQCsignKAT_Dilithium3.rsp", DilithiumParameters.Dilithium3 },
             { "PQCsignKAT_Dilithium5.rsp", DilithiumParameters.Dilithium5 },
-            { "PQCsignKAT_Dilithium2-AES.rsp", DilithiumParameters.Dilithium2Aes },
-            { "PQCsignKAT_Dilithium3-AES.rsp", DilithiumParameters.Dilithium3Aes },
-            { "PQCsignKAT_Dilithium5-AES.rsp", DilithiumParameters.Dilithium5Aes },
         };
 
         private static readonly string[] TestVectorFiles =
@@ -33,12 +30,6 @@ namespace Org.BouncyCastle.Pqc.Crypto.Tests
             "PQCsignKAT_Dilithium5.rsp",
         };
 
-        private static readonly string[] TestVectorFilesAes =
-        {
-            "PQCsignKAT_Dilithium2-AES.rsp",
-            "PQCsignKAT_Dilithium3-AES.rsp",
-            "PQCsignKAT_Dilithium5-AES.rsp",
-        };
 
         [TestCaseSource(nameof(TestVectorFiles))]
         [Parallelizable(ParallelScope.All)]
@@ -47,13 +38,6 @@ namespace Org.BouncyCastle.Pqc.Crypto.Tests
             RunTestVectorFile(testVectorFile);
         }
 
-        [TestCaseSource(nameof(TestVectorFilesAes))]
-        [Parallelizable(ParallelScope.All)]
-        public void TVAes(string testVectorFile)
-        {
-            RunTestVectorFile(testVectorFile);
-        }
-
         [Test]
         public void TestKeyEncodingDilithium2()
         {
@@ -81,31 +65,6 @@ namespace Org.BouncyCastle.Pqc.Crypto.Tests
             Assert.AreEqual(((DilithiumPrivateKeyParameters)priv).GetEncoded(), ((DilithiumPrivateKeyParameters)privDec).GetEncoded());
         }
 
-        [Test]
-        public void TestKeyEncodingDilithium2Aes()
-        {
-            byte[] altEncKey = Base64.Decode("CKJBWPvTOpeLU/2y0fhlWLc9HKYgH2pAARm2IzwF927Nnnugbw4T7cmjtSfbD/e4CamjVdehDBPqYBWfbZumLD+EuPQUqWaCYDS9JcezFmFXACFHRQPwWDqwqvfuy7zeN4HVb/ygiNJI/mWNoqRn3Ffz59J2iPLr9xe8TUNgQ6VK3tVwIqkxAXv1GVX5MCJI0U2v7d00RnfEDnYL2AVZjSGe0fboKN74OrMTLlx2qN9a8uw21mcgvULBIItsppN7w+gSjOnqSg22wA2RojBNZRuQm4AVeZR6mPw0cYVSyBD3DSjPCWhwseJOACfxdaKgPUQOYlYvQLTTQ1O8fYsrmdF/8aisZ9oo7HVz5xC46AEIL2mp5eVGZJxFpvYyUet0JMFmDgv1PUtoja/EfORNM2T1+pHkv6InfyIDXS3+SMuH0S4qUCmhNtKV47L5uVUl0dfgzDdvsooEZ8iCT1z3nAWiaDNKbMEdYvY7/Qm2HtJIMzLyyXfD9kkwAGr/rzU4IyqK0cS97cVeeT86Zt0e4OtLXJnjhNpD4v+qukjnRVeov/tGzDUtohcAghTTArx3/E3ZEOrDzgagyHKu/3IefhVqndYMle8+NuYIjbN0J/CFOgI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Vep/Y7seT6FtYiZsaONEbKN30tOG4YGcUW0M3BCDxtosHaWuaohQ9ewAvKOi0lo4caDYEcB6gu7wnVici7AnbzepJCo3RtAxSacpa/34gYAY/KZv13U0m6CHa3Cr5iE3ER15QtNl83cyHoRRng6ww59P5gszB6hp2CIW2NcDMsD/ATM3rL/4oG0xIZP7SlWt//wmlQhEjtDGuB1VUsbrjb5YBkn+wH9J+X3KgP80iXvYihI9DzxK9VTG2rc206gR+40KkBIDhLBvxNrwrTiVN+N39aT57XVsJ4+pNObPiK6EUXhjPWRAwsPq/0DBjkBGzJY4q8LTP9sJAP8s2XKdVKsy00J2N/I3CVqQ/s9JXfcDxUX9BMyRehxOUoZYzUu+qgb5XCCXXpvJiDuMLQwWOnDTEXOExXBE8+KgtMLO281zeO8+wqulbbrTqYfkdHXhjL0tU+kcp+zM5jHn3bgx77FFj4gXg+LIgj6sYMuUNgcOZcZQEuyUPLbsZEiEkbOsCQr/JqKxeAjNmeCKUOlVpxZuHfj8mCMT5h2fXeByDj1Ie5szCdjhuqLjnSvWu1uXAQrdtyjCTMolNWKhBsUa+L8s5agh37qhk7ZHu5B1IrzDLUxyZ89aXda+6Rp/AC/F3EDZKEreruBqzVzIgOEo92RbyGXju2I2ekSr/AqUT2JBO6rdE6OWSt/ibdXFRkRv/f7XASwqwVsFkBgnNBmioZLSOdIYw12ZcvotlFtNKfi2BMe6lj2ZY2DqA/rnnekaIPh2dBIrevzWQgLStqrn/2g59F2saBH6bg=");
-           
-            AsymmetricKeyParameter altPubDec = PqcPublicKeyFactory.CreateKey(SubjectPublicKeyInfo.GetInstance(altSubPubEnc));
-            Assert.AreEqual(altEncKey, ((DilithiumPublicKeyParameters)altPubDec).GetEncoded());
-
-            Security.SecureRandom random = new Security.SecureRandom();
-            DilithiumKeyGenerationParameters kparam = new DilithiumKeyGenerationParameters(random, DilithiumParameters.Dilithium2Aes);
-            DilithiumKeyPairGenerator kpg = new DilithiumKeyPairGenerator();
-            kpg.Init(kparam);
-            AsymmetricCipherKeyPair ackp = kpg.GenerateKeyPair();
-
-            AsymmetricKeyParameter pub = ackp.Public;
-            AsymmetricKeyParameter priv = ackp.Private;
-
-            AsymmetricKeyParameter pubDec = PqcPublicKeyFactory.CreateKey(PqcSubjectPublicKeyInfoFactory.CreateSubjectPublicKeyInfo(pub));
-            AsymmetricKeyParameter privDec = PqcPrivateKeyFactory.CreateKey(PqcPrivateKeyInfoFactory.CreatePrivateKeyInfo(priv));
-
-            Assert.AreEqual(((DilithiumPublicKeyParameters)pub).GetEncoded(), ((DilithiumPublicKeyParameters)pubDec).GetEncoded());
-            Assert.AreEqual(((DilithiumPrivateKeyParameters)priv).GetEncoded(), ((DilithiumPrivateKeyParameters)privDec).GetEncoded());
-        }
-
         private static void RunTestVector(string name, IDictionary<string, string> buf)
         {
             string count = buf["count"];