diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-10-13 00:30:40 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-10-13 00:30:40 +0700 |
commit | 5ac18844a134c51d71c5f5ee52103651c3e35aef (patch) | |
tree | 2a1f3acdab7419bc5648724321dac1c124f6059b /crypto/test | |
parent | Refactor FrodoMatrixGenerator (performance) (diff) | |
download | BouncyCastle.NET-ed25519-5ac18844a134c51d71c5f5ee52103651c3e35aef.tar.xz |
Minor fixes in PQC tests
Diffstat (limited to 'crypto/test')
4 files changed, 8 insertions, 8 deletions
diff --git a/crypto/test/src/pqc/crypto/test/FrodoVectorTest.cs b/crypto/test/src/pqc/crypto/test/FrodoVectorTest.cs index e969a6407..ea3897b65 100644 --- a/crypto/test/src/pqc/crypto/test/FrodoVectorTest.cs +++ b/crypto/test/src/pqc/crypto/test/FrodoVectorTest.cs @@ -138,7 +138,7 @@ namespace Org.BouncyCastle.Pqc.Crypto.Tests } } - if (buf.Count > 0) + if (buf.Count > 0 && !sampler.SkipTest(buf["count"])) { RunTestVector(name, buf); } diff --git a/crypto/test/src/pqc/crypto/test/PicnicVectorTest.cs b/crypto/test/src/pqc/crypto/test/PicnicVectorTest.cs index 57eff0f13..8a4972048 100644 --- a/crypto/test/src/pqc/crypto/test/PicnicVectorTest.cs +++ b/crypto/test/src/pqc/crypto/test/PicnicVectorTest.cs @@ -152,7 +152,7 @@ namespace Org.BouncyCastle.Pqc.Crypto.Tests } } - if (buf.Count > 0) + if (buf.Count > 0 && !sampler.SkipTest(buf["count"])) { RunTestVector(name, buf); } diff --git a/crypto/test/src/pqc/crypto/test/SikeVectorTest.cs b/crypto/test/src/pqc/crypto/test/SikeVectorTest.cs index 8b7707bd4..cc20b2269 100644 --- a/crypto/test/src/pqc/crypto/test/SikeVectorTest.cs +++ b/crypto/test/src/pqc/crypto/test/SikeVectorTest.cs @@ -153,7 +153,7 @@ namespace Org.BouncyCastle.Pqc.Crypto.Tests } } - if (buf.Count > 0) + if (buf.Count > 0 && !sampler.SkipTest(buf["count"])) { RunTestVector(name, buf); } diff --git a/crypto/test/src/pqc/crypto/test/SphincsPlusTest.cs b/crypto/test/src/pqc/crypto/test/SphincsPlusTest.cs index 39c81a700..0c3acf365 100644 --- a/crypto/test/src/pqc/crypto/test/SphincsPlusTest.cs +++ b/crypto/test/src/pqc/crypto/test/SphincsPlusTest.cs @@ -383,13 +383,11 @@ namespace Org.BouncyCastle.Pqc.Crypto.Tests FixedSecureRandom.Source[] source = { new FixedSecureRandom.Source(sk) }; SecureRandom random = new FixedSecureRandom(source); - SphincsPlusParameters parameters; - string[] nameParts = SplitOn(name, '-'); bool sha2 = nameParts[0].Equals("sha2"); bool shake = nameParts[0].Equals("shake"); bool haraka = nameParts[0].Equals("haraka"); - int size = Int32.Parse(nameParts[1].Substring(0, 3)); + int size = int.Parse(nameParts[1].Substring(0, 3)); bool fast = nameParts[1].EndsWith("f"); bool slow = nameParts[1].EndsWith("s"); bool simple = nameParts[2].Equals("simple.rsp"); @@ -442,7 +440,9 @@ namespace Org.BouncyCastle.Pqc.Crypto.Tests throw new ArgumentException("unknown complexity"); } - parameters = (SphincsPlusParameters)typeof(SphincsPlusParameters).GetField(b.ToString()).GetValue(null);//todo unsure + + SphincsPlusParameters parameters = (SphincsPlusParameters) + typeof(SphincsPlusParameters).GetField(b.ToString()).GetValue(null);//todo unsure // // Generate keys and test. @@ -505,7 +505,7 @@ namespace Org.BouncyCastle.Pqc.Crypto.Tests } } - if (buf.Count > 0) + if (buf.Count > 0 && !sampler.SkipTest(buf["count"])) { RunTestVector(name, buf); } |