aboutsummaryrefslogtreecommitdiff
path: root/standalone/src
diff options
context:
space:
mode:
authorJ08nY2025-02-27 19:10:40 +0100
committerJ08nY2025-02-27 19:10:40 +0100
commita3883795d1261a9679e829355bd584ee1ca6e1ec (patch)
tree309df1eb45da952bd4d4760272259531509f5778 /standalone/src
parent51f118610d4d6b383b7b7b75201998b47ea5f972 (diff)
downloadECTester-a3883795d1261a9679e829355bd584ee1ca6e1ec.tar.gz
ECTester-a3883795d1261a9679e829355bd584ee1ca6e1ec.tar.zst
ECTester-a3883795d1261a9679e829355bd584ee1ca6e1ec.zip
Diffstat (limited to 'standalone/src')
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneCofactorSuite.java3
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneCompositeSuite.java3
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneEdgeCasesSuite.java9
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneForeignSuite.java3
4 files changed, 11 insertions, 7 deletions
diff --git a/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneCofactorSuite.java b/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneCofactorSuite.java
index ec11116..ae9e53b 100644
--- a/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneCofactorSuite.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneCofactorSuite.java
@@ -71,8 +71,9 @@ public class StandaloneCofactorSuite extends StandaloneTestSuite {
Test keyAgreement = KeyAgreementTest.expectError(testable, Result.ExpectedValue.FAILURE);
specificKaTests.add(CompoundTest.all(Result.ExpectedValue.SUCCESS, pub.getId() + " cofactor key test (" + pub.getDesc() + ").", keyAgreement));
}
+ Test test = CompoundTest.all(Result.ExpectedValue.SUCCESS, "Perform " + kaIdent.getName() + " with public points on non-generator subgroup.", specificKaTests.toArray(new Test[0]));
for (int i = 0; i < getNumRepeats(); i++) {
- allKaTests.add(CompoundTest.all(Result.ExpectedValue.SUCCESS, "Perform " + kaIdent.getName() + " with public points on non-generator subgroup.", specificKaTests.toArray(new Test[0])));
+ allKaTests.add(test.clone());
}
}
}
diff --git a/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneCompositeSuite.java b/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneCompositeSuite.java
index 2385cd3..001f981 100644
--- a/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneCompositeSuite.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneCompositeSuite.java
@@ -75,8 +75,9 @@ public class StandaloneCompositeSuite extends StandaloneTestSuite {
Test keyAgreement = KeyAgreementTest.expectError(testable, Result.ExpectedValue.FAILURE);
specificKaTests.add(CompoundTest.all(Result.ExpectedValue.SUCCESS, "Composite test of " + curve.getId() + ", with generated private key, " + pub.getDesc(), keyAgreement));
}
+ Test test = CompoundTest.all(Result.ExpectedValue.SUCCESS, "Perform " + kaIdent.getName() + " with various public points.", specificKaTests.toArray(new Test[0]));
for (int i = 0; i < getNumRepeats(); i++) {
- allKaTests.add(CompoundTest.all(Result.ExpectedValue.SUCCESS, "Perform " + kaIdent.getName() + " with various public points.", specificKaTests.toArray(new Test[0])));
+ allKaTests.add(test.clone());
}
}
}
diff --git a/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneEdgeCasesSuite.java b/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneEdgeCasesSuite.java
index c8841d0..1c42650 100644
--- a/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneEdgeCasesSuite.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneEdgeCasesSuite.java
@@ -181,13 +181,14 @@ public class StandaloneEdgeCasesSuite extends StandaloneTestSuite {
List<Test> tests = new LinkedList<>();
for (int i = 0; i < getNumRepeats(); ++i) {
- tests.addAll(Arrays.asList(zeroS, oneS, alternateS, alternateOtherS, fullS, smallerS, exactS, largerS, rm1S, rp1S, krS, krm1S, krp1S));
+ tests.addAll(Arrays.asList(zeroS.clone(), oneS.clone(), alternateS.clone(), alternateOtherS.clone(),
+ fullS.clone(), smallerS.clone(), exactS.clone(), largerS.clone(), rm1S.clone(), rp1S.clone(),
+ krS.clone(), krm1S.clone(), krp1S.clone()));
}
if (cli.hasOption("test.shuffle"))
Collections.shuffle(tests);
tests.add(0, generate);
- doTest(CompoundTest.function(CompoundTest.EXPECT_ALL_SUCCESS, CompoundTest.RUN_ALL_IF_FIRST, "Tests with edge-case private key values over " + curve.getId() + ".",
- generate, zeroS, oneS, alternateS, alternateOtherS, fullS, smallerS, exactS, largerS, rm1S, rp1S, krS, krm1S, krp1S));
+ doTest(CompoundTest.function(CompoundTest.EXPECT_ALL_SUCCESS, CompoundTest.RUN_ALL_IF_FIRST, "Tests with edge-case private key values over " + curve.getId() + ".", tests.toArray(new Test[0])));
}
EC_Curve secp160r1 = EC_Store.getInstance().getObject(EC_Curve.class, "secg/secp160r1");
@@ -251,7 +252,7 @@ public class StandaloneEdgeCasesSuite extends StandaloneTestSuite {
List<Test> tests160 = new LinkedList<>();
for (int j = 0; j < getNumRepeats(); ++j) {
- tests160.addAll(Arrays.asList(zeroTest, pTest, rTest));
+ tests160.addAll(Arrays.asList(zeroTest.clone(), pTest.clone(), rTest.clone()));
}
if (cli.hasOption("test.shuffle"))
Collections.shuffle(tests160);
diff --git a/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneForeignSuite.java b/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneForeignSuite.java
index c533789..1d5c798 100644
--- a/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneForeignSuite.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneForeignSuite.java
@@ -161,8 +161,9 @@ public abstract class StandaloneForeignSuite extends StandaloneTestSuite {
Test keyAgreement = KeyAgreementTest.expectError(testable, Result.ExpectedValue.FAILURE);
specificKaTests.add(CompoundTest.all(Result.ExpectedValue.SUCCESS, pub.getId() + " invalid key test.", keyAgreement));
}
+ Test test = CompoundTest.all(Result.ExpectedValue.SUCCESS, "Perform " + kaIdent.getName() + " with invalid public points.", specificKaTests.toArray(new Test[0]));
for (int i = 0; i < getNumRepeats(); i++) {
- allKaTests.add(CompoundTest.all(Result.ExpectedValue.SUCCESS, "Perform " + kaIdent.getName() + " with invalid public points.", specificKaTests.toArray(new Test[0])));
+ allKaTests.add(test.clone());
}
}
}