From a7eef06134bef0861e43261640d61153ebb2a6e5 Mon Sep 17 00:00:00 2001 From: J08nY Date: Wed, 19 Apr 2017 01:10:17 +0200 Subject: 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. --- src/cz/crcs/ectester/reader/ec/EC_Curve.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/cz/crcs/ectester/reader/ec/EC_Curve.java') diff --git a/src/cz/crcs/ectester/reader/ec/EC_Curve.java b/src/cz/crcs/ectester/reader/ec/EC_Curve.java index 9b783ec..7d056a5 100644 --- a/src/cz/crcs/ectester/reader/ec/EC_Curve.java +++ b/src/cz/crcs/ectester/reader/ec/EC_Curve.java @@ -7,25 +7,27 @@ import javacard.security.KeyPair; * @author Jan Jancar johny@neuromancer.sk */ public class EC_Curve extends EC_Params { - private short bits; private byte field; private String desc; /** - * * @param bits * @param field KeyPair.ALG_EC_FP or KeyPair.ALG_EC_F2M */ public EC_Curve(short bits, byte field) { super(field == KeyPair.ALG_EC_FP ? EC_Consts.PARAMETERS_DOMAIN_FP : EC_Consts.PARAMETERS_DOMAIN_F2M); this.bits = bits; - this.field = field; } - public EC_Curve(short bits, byte field, String desc) { + public EC_Curve(String id, short bits, byte field) { this(bits, field); + this.id = id; + } + + public EC_Curve(String id, short bits, byte field, String desc) { + this(id, bits, field); this.desc = desc; } -- cgit v1.3.1