diff options
| author | J08nY | 2017-04-19 20:01:53 +0200 |
|---|---|---|
| committer | J08nY | 2017-04-19 20:01:53 +0200 |
| commit | 5e46fb3406b99b9d7f1e1be000a3e87abca6ad8a (patch) | |
| tree | 70bf5be19caf31d06f8b045e4034db1bca00e6fd /src/cz/crcs/ectester/reader/ec/EC_Params.java | |
| parent | a7eef06134bef0861e43261640d61153ebb2a6e5 (diff) | |
| download | ECTester-5e46fb3406b99b9d7f1e1be000a3e87abca6ad8a.tar.gz ECTester-5e46fb3406b99b9d7f1e1be000a3e87abca6ad8a.tar.zst ECTester-5e46fb3406b99b9d7f1e1be000a3e87abca6ad8a.zip | |
Add id to EC_Params subclasses toString, fix EC_Params.expand
Diffstat (limited to 'src/cz/crcs/ectester/reader/ec/EC_Params.java')
| -rw-r--r-- | src/cz/crcs/ectester/reader/ec/EC_Params.java | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/src/cz/crcs/ectester/reader/ec/EC_Params.java b/src/cz/crcs/ectester/reader/ec/EC_Params.java index cee9c16..7192b61 100644 --- a/src/cz/crcs/ectester/reader/ec/EC_Params.java +++ b/src/cz/crcs/ectester/reader/ec/EC_Params.java @@ -126,32 +126,22 @@ public class EC_Params extends EC_Data { short masked = (short) (params & paramMask); if (masked != 0) { byte[] param = data[index]; - if (masked == EC_Consts.PARAMETER_F2M) { - //split into m, e1, e2, e3 for (int i = 0; i < 4; ++i) { - out.add(String.format("%04x", Util.getShort(param, i * 2))); + out.add(Util.bytesToHex(data[index + i], false)); } - + index += 4; } else if (masked == EC_Consts.PARAMETER_G || masked == EC_Consts.PARAMETER_W) { - //split from X962 format into X and Y - //disregard the first 04 and then split into half(uncompress) - int half = (param.length - 1) / 2; - out.add(Util.bytesToHex(param, 1, half, false)); - out.add(Util.bytesToHex(param, half + 1, half, false)); + out.add(Util.bytesToHex(param, false)); + out.add(Util.bytesToHex(data[index + 1], false)); + index += 2; } else { - //read raw - out.add(Util.bytesToHex(data[index], false)); + out.add(Util.bytesToHex(param, false)); + index++; } - index++; } paramMask = (short) (paramMask << 1); } return out.toArray(new String[out.size()]); } - - @Override - public String toString() { - return String.join(",", expand()); - } } |
