aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md29
-rw-r--r--docs/CURVES.md44
-rw-r--r--docs/LIBS.md4
-rw-r--r--docs/TESTS.md68
-rw-r--r--src/cz/crcs/ectester/reader/ECTesterReader.java10
-rw-r--r--src/cz/crcs/ectester/reader/test/CardCompositeCurvesSuite.java18
-rw-r--r--src/cz/crcs/ectester/reader/test/CardInvalidCurvesSuite.java6
-rw-r--r--src/cz/crcs/ectester/reader/test/CardTestVectorSuite.java6
-rw-r--r--src/cz/crcs/ectester/reader/test/CardTwistTestSuite.java6
-rw-r--r--src/cz/crcs/ectester/reader/test/CardWrongCurvesSuite.java6
-rw-r--r--src/cz/crcs/ectester/standalone/ECTesterStandalone.java8
11 files changed, 113 insertions, 92 deletions
diff --git a/README.md b/README.md
index 6184b84..1af8a21 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,8 @@
# ECTester
-[![Build status](https://api.travis-ci.org/crocs-muni/ECTester.svg?branch=master)](https://travis-ci.org/crocs-muni/ECTester) [![GitHub release](https://img.shields.io/github/release/crocs-muni/ECTEster.svg)](https://github.com/crocs-muni/ECTester/releases) [![license](https://img.shields.io/github/license/crocs-muni/ECTester.svg)](https://github.com/crocs-muni/ECTester/blob/master/LICENSE)
+[![Build status](https://api.travis-ci.org/crocs-muni/ECTester.svg?branch=master)](https://travis-ci.org/crocs-muni/ECTester) [![GitHub release](https://img.shields.io/github/release/crocs-muni/ECTEster.svg)](https://github.com/crocs-muni/ECTester/releases) [![license](https://img.shields.io/github/license/crocs-muni/ECTester.svg)](https://github.com/crocs-muni/ECTester/blob/master/LICENSE) [![docs](https://img.shields.io/badge/docs-github.io-brightgreen.svg)](https://crocs-muni.github.io/ECTester/)
Tests support and behavior of elliptic curve cryptography implementations on JavaCards (`TYPE_EC_FP` and `TYPE_EC_F2M`) and on selected software libraries.
+For more information on ECC support on JavaCards see the [github page](https://crocs-muni.github.io/ECTester/).
## Build
@@ -17,7 +18,7 @@ The standalone build tries building test binaries for all the supported librarie
## JavaCard testing
1. Upload `!uploader/ectester.cap` using your favorite tool (e.g., [GlobalPlatformPro tool](https://github.com/martinpaljak/GlobalPlatform))
-2. Run `java -jar dist/ECTesterReader.jar -t -a`
+2. Run `java -jar dist/ECTesterReader.jar -t`
3. Inspect output log with annotated results
Following operations are tested:
@@ -112,20 +113,24 @@ For more info about the test suites see [TESTS](docs/TESTS.md).
Generates batches of EC keypairs and exports them.
Use with `-o / --output [out_file]` to output the generated keys to a file.
+For format of this file see [FORMAT](docs/FORMAT.md).
#### ECDH
`-dh / --ecdh [count]`
Performs ECDH.
Use with `-o / --output [out_file]` to output into a file.
+For format of this file see [FORMAT](docs/FORMAT.md).
Respects the KeyAgreement type specified in `-ka / --ka-type [type]`.
+
#### ECDSA
`-dsa / --ecdsa [count]`
Performs ECDSA.
Useful with `-i / --input [in_file]` to sign the contents of a file.
Use with `-o / --output [out_file]` to output into a file.
+For format of these files see [FORMAT](docs/FORMAT.md).
Respects the Signature type specified in `-sig / --sig-type [type]`.
#### List named curves
@@ -139,11 +144,14 @@ With the format: `category/name`.
For example:
`secg/secp192r1` identifies the SECG 192 bit prime field curve known as `secp192r1`.
-For more info about the curves see [CURVES](docs/CURVES.md).
+For more info about the curves and curve categories see [CURVES](docs/CURVES.md).
### Example
- > java -jar ECTesterReader.jar -t -a -s
+Snippet below shows running the default test suite while simulating(`-s`), so using JCardSim.
+This shows that JCardsim simulates 112b Fp support with default curve present and supports ECDH, ECDHC and ECDSA.
+
+ > java -jar ECTesterReader.jar -t -s
═══ Running test suite: default ═══
═══ The default test suite run basic support of ECDH and ECDSA.
═══ Card ATR: 3bfa1800008131fe454a434f5033315632333298
@@ -172,6 +180,18 @@ For more info about the curves see [CURVES](docs/CURVES.md).
┣ NOK ━ Allocated Signature(ALG_ECDSA_SHA_384) object ┃ FAILURE ┃ 0 ms ┃ fail (NO_SUCH_ALG, 0x0003)
┗ NOK ━ Allocated Signature(ALG_ECDSA_SHA_512) object ┃ FAILURE ┃ 0 ms ┃ fail (NO_SUCH_ALG, 0x0003)
+#### Legend
+ - Some general information about the test suite and card is output first, test data follows after.
+ - The **OK**/**NOK** values on the left represent the complete evaluated result of a test, as a test can be expected
+ to succeed or fail, this is different than the values on the right:
+ - **SUCCESS**: Is **OK**, the test was expected to pass and it did.
+ - **FAILURE**: Is **NOK**, the test was expected to pass, but it did not.
+ - **UXSUCCESS**: Is **NOK**, the test was expected to fail, but it did not.
+ - **XFAILURE**: Is **OK**, the test was expected to fail, and it did.
+ - **ERROR**: Is **NOK** an unexpected error during testing arose.
+ - The tests can be compounded into compound tests, which are visible as a tree of tests and sub-tests.
+ - The duration of non-compound tests is shown in the third column, this is a rough estimate, measured from before the APDU is sent, to just after the response is received.
+ - The cause of the test result, is shown in the last column, for non-compound tests, these are JavaCard(or custom) status words, from operations done on the card.
If you are interested in testing support for other JavaCard algorithms, please visit JCAlgTester project: https://github.com/crocs-muni/JCAlgTest
@@ -184,6 +204,7 @@ Currently supported libraries include:
- libtomcrypt
- botan
+For more information on ECC libraries see [LIBS](docs/LIBS.md).
```
usage: ECTesterStandalone.jar [-V] [-h] [ (ecdh [-t <type>] [-n <amount>] [-b <n>] [-nc <cat/id>]) |
diff --git a/docs/CURVES.md b/docs/CURVES.md
index 4a80d49..a04e82f 100644
--- a/docs/CURVES.md
+++ b/docs/CURVES.md
@@ -1,47 +1,63 @@
# Curves
+ECTester contains a collection of elliptic curve/point parameters, these parameters either come from standards or
+were generated manually or using [ecgen](https://github.com/J08nY/ecgen).
-## SECG
+These parameters can be found in the [cz.crcs.ectester.data](/src/cz/ectester/data/) package.
+
+
+## Standard
+
+### SECG
SEC 2: Recommended Elliptic Curve Domain Parameters version 2.0 January 27, 2010
[Source](http://www.secg.org/sec2-v2.pdf)
-## NIST
+### NIST
RECOMMENDED ELLIPTIC CURVES FOR FEDERAL GOVERNMENT USE July 1999
[Source](http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-4.pdf)
-## x962
+### x962
ANSI X9.62 example curves.
-## Brainpool
+### Brainpool
ECC Brainpool Standard Curves and Curve Generation v. 1.0 19.10.2005
[Source](http://www.ecc-brainpool.org/download/Domain-parameters.pdf)
-## anssi
+### anssi
Agence nationale de la sécurité des systèmes d'information: Publication d'un paramétrage de courbe elliptique visant des applications de passeport électronique et de l'administration électronique française. 21 November 2011
-## GOST
+### GOST
GOST R 34.10-2001: RFC5832 curves.
[Source](https://tools.ietf.org/html/rfc5832)
-## anomalous
+
+## Generated
+
+### anomalous
These prime field curves have the same order as the field order, and are susceptible to attacks reducing ECDLP over a multiplicative group of the curve, to DLP over an additive group of the underlying field, which is easy (linear time).
Some of these are from Atsuko Miyaji's [paper](https://dspace.jaist.ac.jp/dspace/bitstream/10119/4464/1/73-61.pdf), others were generated using [ecgen](htps://github.com/J08nY/ecgen).
-## invalid
+### invalid
This category contains pre-generated invalid curves for a large subset of NIST, SECG and Brainpool curves. Invalid curves for a given curve, are short Weierstrass curves with all parameters equal to the given curve except the `b` parameter. These curves can be used to [attack some implementations](https://www.nds.rub.de/media/nds/veroeffentlichungen/2015/09/14/main-full.pdf).
-Generated using [ecgen](https://github.com/J08nY/ecgen)
+Generated using [ecgen](https://github.com/J08nY/ecgen).
-## composite
+### composite
Contains curves of composite order, with small order points.
-Generated using [ecgen](https://github.com/J08nY/ecgen)
+Generated using [ecgen](https://github.com/J08nY/ecgen).
+
+### wrong
+Contains parameters that are not elliptic curves(over Fp and F2m), such as `p` parameter that is not prime or an irreducible polynomial that is not irreducible.
+
+Generated manually.
-## wrong
-Contains parameters that are not elliptic curves(over Fp and F2m), such as `p` parameter that is not prime, irreducible polynomial that is not irreducible and similar.
+### twist
+Contains pre-generated points on twists of known named curves from NIST, SECG.
+These points can be used to attack some implementations.
-Generated manually. \ No newline at end of file
+Generated using [ecgen](https://github.com/J08nY/ecgen). \ No newline at end of file
diff --git a/docs/LIBS.md b/docs/LIBS.md
index 4fac57b..1f1f92c 100644
--- a/docs/LIBS.md
+++ b/docs/LIBS.md
@@ -1,15 +1,13 @@
-# Libraries with ECC
+# Libraries with ECC support
Libraries with at least some ECC support:
- [Crypto++](https://cryptopp.com/)
- [libgcrypt](https://www.gnupg.org/related_software/libgcrypt/)
-
- [mbedTLS](https://tls.mbed.org/)
- [Nettle](http://www.lysator.liu.se/~nisse/nettle/)
- [OpenSSL](https://www.openssl.org/)
- [OpenSSL (FIPS mode)](https://www.openssl.org/docs/fipsnotes.html)
-
- [Microsoft CNG](https://msdn.microsoft.com/en-us/library/windows/desktop/aa376210(v=vs.85).aspx)
- [Microsoft .NET crypto](https://docs.microsoft.com/en-us/dotnet/standard/security/cryptography-model)
diff --git a/docs/TESTS.md b/docs/TESTS.md
index c4f38dc..72c328d 100644
--- a/docs/TESTS.md
+++ b/docs/TESTS.md
@@ -1,12 +1,13 @@
-# Tests
+# Test suites
- `default`
- `test-vectors`
- `wrong`
- `composite`
- `invalid`
+ - `twist`
-**NOTE: The `wrong`, `composite` and `invalid` test suites caused temporary DoS of some cards. These test suites prompt you for
+**NOTE: The `wrong`, `composite`, `invalid` and `twist` test suites caused temporary/permanent DoS of some cards. These test suites prompt you for
confirmation before running, be cautious.**
## Default
@@ -18,14 +19,10 @@ This test suite is run if no argument is provided to `-t / --test`.
For example:
```bash
-java -jar ECTester.jar -a -fp -t
+java -jar ECTester.jar -t
```
-tests all(`-a`), prime field(`-fp`), using the default test suite.
+tests prime field and binary field curves, using the default test suite.
-```bash
-java -jar ECTester.jar-a -f2m -t
-```
-tests all(`-a`), binary field(`-f2m`), curves.
## Test-Vectors
Tests using known test vectors provided by NIST/SECG/Brainpool:
@@ -40,25 +37,33 @@ Tests using known test vectors provided by NIST/SECG/Brainpool:
For example:
```bash
-java -jar ECTester.jar -t test-vectors -nc nist -a -f2m
-```
-tests all(`-a`), binary field(`-f2m`) NIST curves for which test-vectors are provided. Although this test suite is better for general testing:
-```bash
-java -jar ECTester.jar -t test-vectors -a
+java -jar ECTester.jar -t test-vectors
```
+tests all curves for which test-vectors are provided.
+
+
## Wrong
-Tests using the default tests on a category of wrong curves. These curves are not really curves as they have:
+Tests on a category of wrong curves. These curves are not really curves as they have:
- non-prime field in the prime-field case
- reducible polynomial as the field polynomial in the binary case
+This test suite also does some additional tests with corrupting the field parameter:
+ - Fp:
+ - p = 0
+ - p = 1
+ - p = q^2; q prime
+ - p = q * s; q and s prime
+ - F2m:
+ - e1 = e2 = e3 = 0
+ - m < e1 < e2 < e3
+
+These tests should fail generally.
-These tests should fail generally. They are equivalent with `java -jar ECTester.jar -nc wrong -t`, the default tests over the `wrong` category
-of curves.
-
For example:
```bash
-java -jar ECTester.jar -t wrong -b 521 -fp
+java -jar ECTester.jar -t wrong
```
-tests a 521 bit(`-b`), prime-field(`-fp`) wrong curve.
+does all wrong curve tests.
+
## Composite
Tests using curves that don't have a prime order/nearly prime order.
@@ -67,16 +72,31 @@ by the applet. Operations over such curves are susceptible to small-subgroup att
For example:
```bash
-java -jar ECTester.jar -t composite -b 160 -fp
+java -jar ECTester.jar -t composite
```
+
## Invalid
-Tests using known named curves from several categories(SECG/NIST/Brainpool) against pregenerated *invalid* public keys.
-These tests should definitely fail, a success here implies the card is susceptible to invalid curve attacks.
+Tests using known named curves from several categories(SECG/NIST/Brainpool) against pre-generated *invalid* public keys.
+ECDH should definitely fail, a success here implies the card is susceptible to invalid curve attacks.
+See [Practical Invalid Curve Attacks on TLS-ECDH](https://www.nds.rub.de/media/nds/veroeffentlichungen/2015/09/14/main-full.pdf) for more information.
For example:
```bash
-java -jar ECTester.jar -t invalid -nc nist -a -fp
+java -jar ECTester.jar -t invalid
```
-tests using all(`-a`), prime-field(`-fp`) NIST curves and pregenerated *invalid* public keys for these curves. \ No newline at end of file
+tests using all curves with pregenerated *invalid* public keys for these curves.
+
+
+## Twist
+Tests using known named curves froms several categories(SECG/NIST) against pre-generated points on twists of said curves.
+ECDH should fail, a success here implies the card is not twist secure, if a curve with an unsecure twist is used,
+the card might compute on the twist, if a point on the twist is supplied.
+
+See [SafeCurves on twist security](https://safecurves.cr.yp.to/twist.html) for more information.
+
+For example:
+```bash
+java -jar ECTester.jar -t twist
+``` \ No newline at end of file
diff --git a/src/cz/crcs/ectester/reader/ECTesterReader.java b/src/cz/crcs/ectester/reader/ECTesterReader.java
index 5e3a3fe..087ec7b 100644
--- a/src/cz/crcs/ectester/reader/ECTesterReader.java
+++ b/src/cz/crcs/ectester/reader/ECTesterReader.java
@@ -58,7 +58,7 @@ import static cz.crcs.ectester.applet.ECTesterApplet.Signature_ALG_ECDSA_SHA;
*
* @author Petr Svenda petr@svenda.com
* @author Jan Jancar johny@neuromancer.sk
- * @version v0.1.0
+ * @version v0.2.0
*/
public class ECTesterReader {
private CardMngr cardManager;
@@ -67,7 +67,7 @@ public class ECTesterReader {
private Config cfg;
private Options opts = new Options();
- private static final String VERSION = "v0.1.0";
+ private static final String VERSION = "v0.2.0";
private static final String DESCRIPTION = "ECTesterReader " + VERSION + ", a javacard Elliptic Curve Cryptography support tester/utility.";
private static final String LICENSE = "MIT Licensed\nCopyright (c) 2016-2017 Petr Svenda <petr@svenda.com>";
private static final String CLI_HEADER = "\n" + DESCRIPTION + "\n\n";
@@ -427,7 +427,7 @@ public class ECTesterReader {
default:
// These run are dangerous, prompt before them.
System.out.println("The test you selected (" + cfg.testSuite + ") is potentially dangerous.");
- System.out.println("Some of these run have caused temporary DoS of some cards.");
+ System.out.println("Some of these run have caused temporary(or even permanent) DoS of some cards.");
if (!cfg.yes) {
System.out.print("Do you want to proceed? (y/n): ");
Scanner in = new Scanner(System.in);
@@ -723,10 +723,6 @@ public class ECTesterReader {
System.err.println("Bit-size must not be negative.");
return false;
}
- if (bits == 0 && !all) {
- System.err.println("You must specify either bit-size with -b or all bit-sizes with -a.");
- return false;
- }
if (key != null && namedKey != null || publicKey != null && namedPublicKey != null || privateKey != null && namedPrivateKey != null) {
System.err.println("You cannot specify both a named key and a key file.");
diff --git a/src/cz/crcs/ectester/reader/test/CardCompositeCurvesSuite.java b/src/cz/crcs/ectester/reader/test/CardCompositeCurvesSuite.java
index a53806c..5bedce5 100644
--- a/src/cz/crcs/ectester/reader/test/CardCompositeCurvesSuite.java
+++ b/src/cz/crcs/ectester/reader/test/CardCompositeCurvesSuite.java
@@ -9,7 +9,6 @@ import cz.crcs.ectester.data.EC_Store;
import cz.crcs.ectester.reader.CardMngr;
import cz.crcs.ectester.reader.ECTesterReader;
import cz.crcs.ectester.reader.command.Command;
-import javacard.security.KeyPair;
import java.util.Map;
@@ -35,17 +34,12 @@ public class CardCompositeCurvesSuite extends CardTestSuite {
Map<String, EC_Key> keys = EC_Store.getInstance().getObjects(EC_Key.class, "composite");
for (EC_Key key : keys.values()) {
EC_Curve curve = EC_Store.getInstance().getObject(EC_Curve.class, key.getCurve());
- if (curve.getField() == KeyPair.ALG_EC_FP && !cfg.primeField || curve.getField() == KeyPair.ALG_EC_F2M && !cfg.binaryField) {
- continue;
- }
- if ((curve.getBits() == cfg.bits || cfg.all)) {
- doTest(CommandTest.expect(new Command.Allocate(this.card, ECTesterApplet.KEYPAIR_BOTH, curve.getBits(), curve.getField()), ExpectedValue.SUCCESS));
- doTest(CommandTest.expect(new Command.Set(this.card, ECTesterApplet.KEYPAIR_BOTH, EC_Consts.CURVE_external, curve.getParams(), curve.flatten()), ExpectedValue.ANY));
- doTest(CommandTest.expect(new Command.Generate(this.card, ECTesterApplet.KEYPAIR_LOCAL), ExpectedValue.ANY));
- Command ecdhCommand = new Command.ECDH_direct(this.card, ECTesterApplet.KEYPAIR_LOCAL, ECTesterApplet.EXPORT_FALSE, EC_Consts.CORRUPTION_NONE, ECTesterApplet.KeyAgreement_ALG_EC_SVDP_DH, key.flatten());
- doTest(CommandTest.expect(ecdhCommand, ExpectedValue.FAILURE, "Card correctly rejected to do ECDH over a composite order curve.", "Card incorrectly does ECDH over a composite order curve, leaks bits of private key."));
- new Command.Cleanup(this.card).send();
- }
+ doTest(CommandTest.expect(new Command.Allocate(this.card, ECTesterApplet.KEYPAIR_BOTH, curve.getBits(), curve.getField()), ExpectedValue.SUCCESS));
+ doTest(CommandTest.expect(new Command.Set(this.card, ECTesterApplet.KEYPAIR_BOTH, EC_Consts.CURVE_external, curve.getParams(), curve.flatten()), ExpectedValue.ANY));
+ doTest(CommandTest.expect(new Command.Generate(this.card, ECTesterApplet.KEYPAIR_LOCAL), ExpectedValue.ANY));
+ Command ecdhCommand = new Command.ECDH_direct(this.card, ECTesterApplet.KEYPAIR_LOCAL, ECTesterApplet.EXPORT_FALSE, EC_Consts.CORRUPTION_NONE, ECTesterApplet.KeyAgreement_ALG_EC_SVDP_DH, key.flatten());
+ doTest(CommandTest.expect(ecdhCommand, ExpectedValue.FAILURE, "Card correctly rejected to do ECDH over a composite order curve.", "Card incorrectly does ECDH over a composite order curve, leaks bits of private key."));
+ new Command.Cleanup(this.card).send();
}
}
}
diff --git a/src/cz/crcs/ectester/reader/test/CardInvalidCurvesSuite.java b/src/cz/crcs/ectester/reader/test/CardInvalidCurvesSuite.java
index 8424d45..acbb910 100644
--- a/src/cz/crcs/ectester/reader/test/CardInvalidCurvesSuite.java
+++ b/src/cz/crcs/ectester/reader/test/CardInvalidCurvesSuite.java
@@ -38,12 +38,6 @@ public class CardInvalidCurvesSuite extends CardTestSuite {
Map<EC_Curve, List<EC_Key.Public>> curves = new HashMap<>();
for (EC_Key.Public key : pubkeys.values()) {
EC_Curve curve = EC_Store.getInstance().getObject(EC_Curve.class, key.getCurve());
- if (curve.getBits() != cfg.bits && !cfg.all) {
- continue;
- }
- if (curve.getField() == KeyPair.ALG_EC_FP && !cfg.primeField || curve.getField() == KeyPair.ALG_EC_F2M && !cfg.binaryField) {
- continue;
- }
List<EC_Key.Public> keys = curves.getOrDefault(curve, new LinkedList<>());
keys.add(key);
curves.putIfAbsent(curve, keys);
diff --git a/src/cz/crcs/ectester/reader/test/CardTestVectorSuite.java b/src/cz/crcs/ectester/reader/test/CardTestVectorSuite.java
index 73c6621..384969c 100644
--- a/src/cz/crcs/ectester/reader/test/CardTestVectorSuite.java
+++ b/src/cz/crcs/ectester/reader/test/CardTestVectorSuite.java
@@ -38,12 +38,6 @@ public class CardTestVectorSuite extends CardTestSuite {
Map<String, EC_KAResult> results = EC_Store.getInstance().getObjects(EC_KAResult.class, "test");
for (EC_KAResult result : results.values()) {
EC_Curve curve = EC_Store.getInstance().getObject(EC_Curve.class, result.getCurve());
- if (curve.getBits() != cfg.bits && !cfg.all) {
- continue;
- }
- if (curve.getField() == KeyPair.ALG_EC_FP && !cfg.primeField || curve.getField() == KeyPair.ALG_EC_F2M && !cfg.binaryField) {
- continue;
- }
EC_Params onekey = EC_Store.getInstance().getObject(EC_Keypair.class, result.getOneKey());
if (onekey == null) {
onekey = EC_Store.getInstance().getObject(EC_Key.Private.class, result.getOneKey());
diff --git a/src/cz/crcs/ectester/reader/test/CardTwistTestSuite.java b/src/cz/crcs/ectester/reader/test/CardTwistTestSuite.java
index c43b234..5fe48db 100644
--- a/src/cz/crcs/ectester/reader/test/CardTwistTestSuite.java
+++ b/src/cz/crcs/ectester/reader/test/CardTwistTestSuite.java
@@ -33,12 +33,6 @@ public class CardTwistTestSuite extends CardTestSuite {
Map<EC_Curve, List<EC_Key.Public>> curves = new HashMap<>();
for (EC_Key.Public key : pubkeys.values()) {
EC_Curve curve = EC_Store.getInstance().getObject(EC_Curve.class, key.getCurve());
- if (curve.getBits() != cfg.bits && !cfg.all) {
- continue;
- }
- if (curve.getField() == KeyPair.ALG_EC_FP && !cfg.primeField || curve.getField() == KeyPair.ALG_EC_F2M && !cfg.binaryField) {
- continue;
- }
List<EC_Key.Public> keys = curves.getOrDefault(curve, new LinkedList<>());
keys.add(key);
curves.putIfAbsent(curve, keys);
diff --git a/src/cz/crcs/ectester/reader/test/CardWrongCurvesSuite.java b/src/cz/crcs/ectester/reader/test/CardWrongCurvesSuite.java
index 1de0723..e00cf55 100644
--- a/src/cz/crcs/ectester/reader/test/CardWrongCurvesSuite.java
+++ b/src/cz/crcs/ectester/reader/test/CardWrongCurvesSuite.java
@@ -39,12 +39,6 @@ public class CardWrongCurvesSuite extends CardTestSuite {
Map<String, EC_Curve> curves = EC_Store.getInstance().getObjects(EC_Curve.class, "wrong");
for (Map.Entry<String, EC_Curve> e : curves.entrySet()) {
EC_Curve curve = e.getValue();
- if (curve.getBits() != cfg.bits && !cfg.all) {
- continue;
- }
- if (curve.getField() == KeyPair.ALG_EC_FP && !cfg.primeField || curve.getField() == KeyPair.ALG_EC_F2M && !cfg.binaryField) {
- continue;
- }
Test key = doTest(CommandTest.expect(new Command.Allocate(this.card, ECTesterApplet.KEYPAIR_BOTH, curve.getBits(), curve.getField()), Result.ExpectedValue.SUCCESS));
if (!key.ok()) {
continue;
diff --git a/src/cz/crcs/ectester/standalone/ECTesterStandalone.java b/src/cz/crcs/ectester/standalone/ECTesterStandalone.java
index f5361c3..1429826 100644
--- a/src/cz/crcs/ectester/standalone/ECTesterStandalone.java
+++ b/src/cz/crcs/ectester/standalone/ECTesterStandalone.java
@@ -39,7 +39,7 @@ import java.util.stream.Collectors;
* Standalone part of ECTester, a tool for testing Elliptic curve implementations in software libraries.
*
* @author Jan Jancar johny@neuromancer.sk
- * @version v0.1.0
+ * @version v0.2.0
*/
public class ECTesterStandalone {
private ProviderECLibrary[] libs = new ProviderECLibrary[]{new SunECLib(), new BouncyCastleLib(), new TomcryptLib(), new BotanLib()};
@@ -48,7 +48,7 @@ public class ECTesterStandalone {
private Options opts = new Options();
private TreeParser optParser;
private TreeCommandLine cli;
- private static final String VERSION = "v0.1.0";
+ private static final String VERSION = "v0.2.0";
private static final String DESCRIPTION = "ECTesterStandalone " + VERSION + ", an Elliptic Curve Cryptography support tester/utility.";
private static final String LICENSE = "MIT Licensed\nCopyright (c) 2016-2017 Petr Svenda <petr@svenda.com>";
private static final String CLI_HEADER = "\n" + DESCRIPTION + "\n\n";
@@ -410,7 +410,7 @@ public class ECTesterStandalone {
/**
*
*/
- private void test() throws NoSuchAlgorithmException, TestException, ParserConfigurationException {
+ private void test() throws TestException, ParserConfigurationException {
TestWriter writer;
switch (cli.getOptionValue("test.format", "text").toLowerCase()) {
case "yaml":
@@ -434,7 +434,7 @@ public class ECTesterStandalone {
*
*/
private void export() throws NoSuchAlgorithmException, IOException {
- ProviderECLibrary lib = (ProviderECLibrary) cfg.selected;
+ ProviderECLibrary lib = cfg.selected;
KeyPairGeneratorIdent ident = null;
String algo = cli.getOptionValue("export.type", "EC");
for (KeyPairGeneratorIdent kpIdent : lib.getKPGs()) {