From 5ac18844a134c51d71c5f5ee52103651c3e35aef Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Thu, 13 Oct 2022 00:30:40 +0700 Subject: Minor fixes in PQC tests --- crypto/test/src/pqc/crypto/test/FrodoVectorTest.cs | 2 +- crypto/test/src/pqc/crypto/test/PicnicVectorTest.cs | 2 +- crypto/test/src/pqc/crypto/test/SikeVectorTest.cs | 2 +- crypto/test/src/pqc/crypto/test/SphincsPlusTest.cs | 10 +++++----- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'crypto') 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); } -- cgit 1.4.1