diff options
| author | davidhofman | 2021-08-22 12:21:57 +0200 |
|---|---|---|
| committer | GitHub | 2021-08-22 12:21:57 +0200 |
| commit | 63161d5916c772667ed6482b7d7e16973ed2ea74 (patch) | |
| tree | 85c49a52266ae9f022bae323691f06538cdde293 /src/cz/crcs/ectester/standalone/test/base | |
| parent | 6f397b26eef8906c46878cd207492da59adff29b (diff) | |
| download | ECTester-63161d5916c772667ed6482b7d7e16973ed2ea74.tar.gz ECTester-63161d5916c772667ed6482b7d7e16973ed2ea74.tar.zst ECTester-63161d5916c772667ed6482b7d7e16973ed2ea74.zip | |
Implement Twist, Invalid, Cofactor and Degenerate standalone suites. (#7)
* add empty StandaloneTwistSuite
* implemented StandaloneTwistSuite
* add expectError method to KeyAgreementTest and KeyGeneratorTest
* utilize new expectError methods, general cleanup of StandaloneTwistSuite
* changed KeyAgreement to ECDH in the description
* Add StandaloneCofactorSuite class.
* Implement StandaloneCofactorSuite.
* Add StandaloneDegenerateSuite.
* Add StandaloneInvalidSuite.
* Implement StandaloneInvalidSuite.
* Implement StandaloneDegenerateSuite.
* Small cosmetic change to some constructors.
* More small cosmetic changes.
Co-authored-by: davidhofman <davidhofman@github.com>
Diffstat (limited to 'src/cz/crcs/ectester/standalone/test/base')
| -rw-r--r-- | src/cz/crcs/ectester/standalone/test/base/KeyAgreementTest.java | 10 | ||||
| -rw-r--r-- | src/cz/crcs/ectester/standalone/test/base/KeyGeneratorTest.java | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/cz/crcs/ectester/standalone/test/base/KeyAgreementTest.java b/src/cz/crcs/ectester/standalone/test/base/KeyAgreementTest.java index bfd39fc..fd48212 100644 --- a/src/cz/crcs/ectester/standalone/test/base/KeyAgreementTest.java +++ b/src/cz/crcs/ectester/standalone/test/base/KeyAgreementTest.java @@ -37,6 +37,16 @@ public class KeyAgreementTest extends SimpleTest<KeyAgreementTestable> { }); } + public static KeyAgreementTest expectError(KeyAgreementTestable ka, Result.ExpectedValue expected) { + return new KeyAgreementTest(ka, new TestCallback<KeyAgreementTestable>() { + @Override + public Result apply(KeyAgreementTestable keyAgreementTestable) { + Result.Value value = Result.Value.fromExpected(expected, keyAgreementTestable.ok(), false); + return new Result(value, value.description()); + } + }); + } + public static KeyAgreementTest function(KeyAgreementTestable ka, TestCallback<KeyAgreementTestable> callback) { return new KeyAgreementTest(ka, callback); } diff --git a/src/cz/crcs/ectester/standalone/test/base/KeyGeneratorTest.java b/src/cz/crcs/ectester/standalone/test/base/KeyGeneratorTest.java index b232456..32f82cb 100644 --- a/src/cz/crcs/ectester/standalone/test/base/KeyGeneratorTest.java +++ b/src/cz/crcs/ectester/standalone/test/base/KeyGeneratorTest.java @@ -22,6 +22,16 @@ public class KeyGeneratorTest extends SimpleTest<KeyGeneratorTestable> { }); } + public static KeyGeneratorTest expectError(KeyGeneratorTestable kg, Result.ExpectedValue expected) { + return new KeyGeneratorTest(kg, new TestCallback<KeyGeneratorTestable>() { + @Override + public Result apply(KeyGeneratorTestable keyGenerationTestable) { + Result.Value value = Result.Value.fromExpected(expected, keyGenerationTestable.ok(), false); + return new Result(value, value.description()); + } + }); + } + public static KeyGeneratorTest function(KeyGeneratorTestable ka, TestCallback<KeyGeneratorTestable> callback) { return new KeyGeneratorTest(ka, callback); } |
