diff options
| author | J08nY | 2017-04-19 01:10:17 +0200 |
|---|---|---|
| committer | J08nY | 2017-04-19 01:10:17 +0200 |
| commit | a7eef06134bef0861e43261640d61153ebb2a6e5 (patch) | |
| tree | 2ef308843b4e8b1770be6681c15b98dcd78d40ff /src/cz/crcs/ectester/reader/ec/EC_KAResult.java | |
| parent | f4a66768ed6dfcfd7156ad0c8c364cdbf6e45e9c (diff) | |
| download | ECTester-a7eef06134bef0861e43261640d61153ebb2a6e5.tar.gz ECTester-a7eef06134bef0861e43261640d61153ebb2a6e5.tar.zst ECTester-a7eef06134bef0861e43261640d61153ebb2a6e5.zip | |
Refactor testing, add Config class, make EC_Data read bytes
- The ECTester.Config class now stores and reads all CLI options
- Testing with the -t / --test option was partially refactored
into:
- Test:
Encapsulates one Command and Response pair with expected result,
a real result and a callback to dynamically assign result
- TestSuite:
Encapsulates a bunch of tests, represents a whole category of
tests either that can be run on any curve or only on some.
Diffstat (limited to 'src/cz/crcs/ectester/reader/ec/EC_KAResult.java')
| -rw-r--r-- | src/cz/crcs/ectester/reader/ec/EC_KAResult.java | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/cz/crcs/ectester/reader/ec/EC_KAResult.java b/src/cz/crcs/ectester/reader/ec/EC_KAResult.java index 1385f12..9e92fd9 100644 --- a/src/cz/crcs/ectester/reader/ec/EC_KAResult.java +++ b/src/cz/crcs/ectester/reader/ec/EC_KAResult.java @@ -1,6 +1,6 @@ package cz.crcs.ectester.reader.ec; -import cz.crcs.ectester.applet.EC_Consts; +import cz.crcs.ectester.reader.Util; /** * @author Jan Jancar johny@neuromancer.sk @@ -22,8 +22,13 @@ public class EC_KAResult extends EC_Data { this.otherKey = otherKey; } - public EC_KAResult(byte ka, String curve, String oneKey, String otherKey, String desc) { + public EC_KAResult(String id, byte ka, String curve, String oneKey, String otherKey) { this(ka, curve, oneKey, otherKey); + this.id = id; + } + + public EC_KAResult(String id, byte ka, String curve, String oneKey, String otherKey, String desc) { + this(id, ka, curve, oneKey, otherKey); this.desc = desc; } @@ -49,8 +54,8 @@ public class EC_KAResult extends EC_Data { @Override public String toString() { - String agreement = ka == EC_Consts.KA_ECDH ? "ECDH" : "ECDHC"; - return agreement + " result over " + curve + ", " + oneKey + " + " + otherKey + (desc == null ? "" : ": " + desc); + String algo = Util.getKA(ka); + return algo + " result over " + curve + ", " + oneKey + " + " + otherKey + (desc == null ? "" : ": " + desc); } } |
