Skip to content

Commit 784fa1d

Browse files
committed
further test random test pruning.
1 parent a5effe1 commit 784fa1d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

core/src/test/java/org/bouncycastle/pqc/crypto/test/SphincsPlusTest.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import java.util.ArrayList;
99
import java.util.HashMap;
1010
import java.util.List;
11+
import java.util.Random;
1112

1213
import junit.framework.TestCase;
1314
import org.bouncycastle.asn1.pkcs.PrivateKeyInfo;
@@ -46,6 +47,10 @@ public void testVectors()
4647

4748
TestSampler sampler = new TestSampler();
4849

50+
Random rd = new Random(System.currentTimeMillis());
51+
52+
int offSet = rd.nextInt(10);
53+
4954
String[] fileList = splitOn(files, ' ');
5055
//long startTime = System.currentTimeMillis();
5156
for (int i = 0; i != fileList.length; i++)
@@ -75,10 +80,14 @@ public void testVectors()
7580
byte[] sigExpected = Hex.decode((String)buf.get("sm"));
7681
byte[] oprR = Hex.decode((String)buf.get("optrand"));
7782

78-
if (sampler.skipTest(count))
83+
if (Integer.parseInt(count) != offSet)
7984
{
8085
continue;
8186
}
87+
// if (sampler.skipTest(count))
88+
// {
89+
// continue;
90+
// }
8291

8392
SPHINCSPlusKeyPairGenerator kpGen = new SPHINCSPlusKeyPairGenerator();
8493
SecureRandom random = new FixedSecureRandom(sk);

0 commit comments

Comments
 (0)