aboutsummaryrefslogtreecommitdiff
path: root/src/cz/crcs/ectester/applet/ECTesterApplet.java
diff options
context:
space:
mode:
authorJ08nY2018-02-04 18:03:54 +0100
committerJ08nY2018-02-04 18:03:54 +0100
commit18bfe2cdac09ff9faed5c92971a7e63d56570ac2 (patch)
treef356373dafd95a04c72de9e222280db2796b7ab1 /src/cz/crcs/ectester/applet/ECTesterApplet.java
parentd940ed695fc36d2782d27c50e398fc185cf6fed3 (diff)
downloadECTester-18bfe2cdac09ff9faed5c92971a7e63d56570ac2.tar.gz
ECTester-18bfe2cdac09ff9faed5c92971a7e63d56570ac2.tar.zst
ECTester-18bfe2cdac09ff9faed5c92971a7e63d56570ac2.zip
Add more tests to the Wrong test suite.
- Now tests also for: - Fp: - p = 0 - p = 1 - p = q^2; q prime - p = q * s; q and s primes - F2m: - e1 = e2 = e3 = 0 - m < e1 < e2 < e3
Diffstat (limited to 'src/cz/crcs/ectester/applet/ECTesterApplet.java')
-rw-r--r--src/cz/crcs/ectester/applet/ECTesterApplet.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cz/crcs/ectester/applet/ECTesterApplet.java b/src/cz/crcs/ectester/applet/ECTesterApplet.java
index 20e3f05..210b3e7 100644
--- a/src/cz/crcs/ectester/applet/ECTesterApplet.java
+++ b/src/cz/crcs/ectester/applet/ECTesterApplet.java
@@ -310,7 +310,7 @@ public class ECTesterApplet extends Applet implements ExtendedLength {
* @param apdu P1 = byte keyPair (KEYPAIR_* | ...)
* P2 = byte key (EC_Consts.KEY_* | ...)
* DATA = short params (EC_Consts.PARAMETER_* | ...)
- * byte corruption (EC_Consts.CORRUPTION_* || ...)
+ * short corruption (EC_Consts.CORRUPTION_* || ...)
* @return length of response
*/
private short insCorrupt(APDU apdu) {
@@ -318,7 +318,7 @@ public class ECTesterApplet extends Applet implements ExtendedLength {
byte key = apduArray[ISO7816.OFFSET_P2];
short cdata = apdu.getOffsetCdata();
short params = Util.getShort(apduArray, cdata);
- byte corruption = apduArray[(short) (cdata + 2)];
+ short corruption = Util.getShort(apduArray, (short) (cdata + 2));
short len = 0;
if ((keyPair & KEYPAIR_LOCAL) != 0) {
@@ -544,7 +544,7 @@ public class ECTesterApplet extends Applet implements ExtendedLength {
* @param outOffset output offset in buffer
* @return length of data written to the buffer
*/
- private short corrupt(KeyPair keyPair, byte key, short params, byte corruption, byte[] outBuffer, short outOffset) {
+ private short corrupt(KeyPair keyPair, byte key, short params, short corruption, byte[] outBuffer, short outOffset) {
short sw = keyGenerator.corruptCurve(keyPair, key, params, corruption, ramArray, (short) 0);
Util.setShort(outBuffer, outOffset, sw);
return 2;