Skip to content

Commit d24630d

Browse files
committed
Merge branch 'devel'
2 parents cb6c6b8 + 07d0c89 commit d24630d

File tree

386 files changed

+14357
-4290
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

386 files changed

+14357
-4290
lines changed

Diff for: .appveyor.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: '{build}'
2+
image: Visual Studio 2017
3+
4+
branches:
5+
except:
6+
- gh-pages
7+
8+
environment:
9+
JAVA_HOME: C:\Program Files\Java\jdk1.8.0
10+
11+
install:
12+
- cinst ant
13+
- git submodule update --init --recursive
14+
15+
build_script:
16+
- ant -f build-applet.xml build
17+
- ant -f build-reader.xml package
18+
- ant -f build-standalone.xml package

Diff for: .gitignore

+20
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Built artifacts in /dist and /applet.
2+
/build/
23
/dist/lib/
34
/dist/ECTesterReader.jar
45
/dist/ECTesterReader-dist.jar
@@ -8,7 +9,26 @@
89
/dist/ECTesterStandalone-dist.jar
910
/applet/ectester.cap
1011

12+
# Test runs in /dist
13+
/dist/*.default
14+
/dist/*.test-vectors
15+
/dist/*.compression
16+
/dist/*.cofactor
17+
/dist/*.composite
18+
/dist/*.wrong
19+
/dist/*.invalid
20+
/dist/*.twist
21+
/dist/*.miscellaneous
22+
/dist/*.degenerate
23+
/dist/*.edge-cases
24+
/dist/*.xml
25+
1126
# Built binaries in /src.
1227
/src/**/*.a
1328
/src/**/*.o
29+
/src/**/*.obj
1430
/src/**/*.so
31+
/src/**/*.dll
32+
/src/**/*.exp
33+
/src/**/*.lib
34+
/src/**/*.pdb

Diff for: .gitmodules

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[submodule "ext/sdks"]
2+
path = ext/sdks
3+
url = https://github.com/martinpaljak/oracle_javacard_sdks
4+
[submodule "ext/libs"]
5+
path = ext/libs
6+
url = https://github.com/J08nY/javacard-libs
7+
[submodule "ext/mscng"]
8+
path = ext/mscng
9+
url = https://github.com/J08nY/mscng-dev-kit

Diff for: .travis.yml

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ addons:
55
packages:
66
- libtomcrypt-dev
77
- libtommath-dev
8+
- libssl-dev
9+
- libcrypto++-dev
810
- gcc-6
911
- g++-6
1012
language: java
@@ -18,6 +20,9 @@ script:
1820
- ant -f build-reader.xml package
1921
- ant -f build-standalone.xml package
2022

23+
before_deploy:
24+
- zip "dist/ECTester.zip" "dist/ECTesterReader-dist.jar" "dist/ECTesterReader.jar" "applet/ectester.cap" "dist/ECTesterStandalone-dist.jar" "dist/ECTesterStandalone.jar"
25+
2126
deploy:
2227
provider: releases
2328
api_key:
@@ -28,6 +33,7 @@ deploy:
2833
- "applet/ectester.cap"
2934
- "dist/ECTesterStandalone-dist.jar"
3035
- "dist/ECTesterStandalone.jar"
36+
- "dist/ECTester.zip"
3137
skip_cleanup: true
3238
on:
3339
tags: true

Diff for: LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2016-2017
3+
Copyright (c) 2016-2018
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Diff for: README.md

+141-58
Large diffs are not rendered by default.

Diff for: applet/gppro_upload.bat

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
gp.exe -delete 4543546573746572 -deletedeps -verbose
2-
gp.exe -deletedeps -verbose -delete 4A43416C6754657374
1+
gp.exe -deletedeps -verbose -delete 4C6162616B417070
2+
gp.exe -deletedeps -verbose -delete 4A43416C6754657374
3+
gp.exe -deletedeps -verbose -delete 4543546573746572
34

4-
gp.exe -install ectester.cap -verbose
5+
gp.exe -install ectester.cap -verbose -d
56

67

Diff for: applet/gppro_upload.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/usr/bin/env bash
2-
java -jar gp.jar -delete 4543546573746572 -deletedeps -verbose
2+
java -jar gp.jar -deletedeps -verbose -delete 4C6162616B417070
33
java -jar gp.jar -deletedeps -verbose -delete 4A43416C6754657374
4+
java -jar gp.jar -deletedeps -verbose -delete 4543546573746572
45

5-
java -jar gp.jar -install ectester.cap -verbose
6+
java -jar gp.jar -install ectester.cap -verbose -d
67

78

Diff for: applet/gppro_upload_emv.bat

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ gp.exe -deletedeps -verbose -emv -delete 4C6162616B417070
22
gp.exe -deletedeps -verbose -emv -delete 4A43416C6754657374
33
gp.exe -deletedeps -verbose -emv -delete 4543546573746572
44

5-
65
gp.exe -install ectester.cap -verbose -emv -d
76

87

Diff for: applet/gppro_upload_emv.sh

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ java -jar gp.jar --deletedeps --verbose -emv --delete 4C6162616B417070
33
java -jar gp.jar --deletedeps --verbose -emv --delete 4A43416C6754657374
44
java -jar gp.jar --deletedeps --verbose -emv --delete 4543546573746572
55

6-
76
java -jar gp.jar --install ectester.cap --verbose --emv -d
87

98

Diff for: build-applet.xml

+12-5
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22
<project basedir="." default="build" name="ECTesterApplet">
33
<!-- Based on Martin Paljak's applets playground -->
44
<!-- Applet building dependencies -->
5-
<property name="JC222" value="ext/java_card_kit-2_2_2"/>
6-
<property name="JC221" value="ext/java_card_kit-2_2_1"/>
7-
<property name="JC303" value="ext/java_card_kit-3_0_3"/>
8-
<property name="OP20" value="ext/visa_openplatform-2_0"/>
9-
<property name="GP211" value="ext/globalplatform-2_1_1"/>
5+
<property name="SDK_PATH" value="ext/sdks"/>
6+
7+
<property name="JC212" value="${SDK_PATH}/jc212_kit"/>
8+
<property name="JC221" value="${SDK_PATH}/jc221_kit"/>
9+
<property name="JC222" value="${SDK_PATH}/jc222_kit"/>
10+
<property name="JC303" value="${SDK_PATH}/jc303_kit"/>
11+
<property name="JC304" value="${SDK_PATH}/jc304_kit"/>
12+
<property name="JC305u1" value="${SDK_PATH}/jc305u1_kit"/>
1013

1114
<!-- ant-javacard task from javacard.pro -->
1215
<taskdef name="javacard" classname="pro.javacard.ant.JavaCard" classpath="ext/ant-javacard.jar"/>
@@ -29,4 +32,8 @@
2932
<exec dir="applet" executable="./gppro_upload_emv.sh" osfamily="unix"/>
3033
<exec dir="applet" executable="./gppro_upload_emv.bat" osfamily="windows"/>
3134
</target>
35+
36+
<target name="clean" description="Clean the built CAP file.">
37+
<delete file="applet/ectester.cap" quiet="true"/>
38+
</target>
3239
</project>

Diff for: build-standalone.xml

+42
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,31 @@
8080
<antcall target="dist-build.package"/>
8181
</target>
8282

83+
<target name="sign" depends="package">
84+
<signjar keystore="nbproject/keystore" alias="ectester" storepass="ectester">
85+
<path>
86+
<fileset dir="dist" includes="*.jar"/>
87+
</path>
88+
</signjar>
89+
</target>
90+
8391
<target name="libs-try">
8492
<exec dir="src/cz/crcs/ectester/standalone/libs/jni" executable="make" osfamily="unix">
8593
<arg value="-k"/>
8694
</exec>
95+
<exec dir="src/cz/crcs/ectester/standalone/libs/jni" executable="cmd" osfamily="windows">
96+
<arg value="/c"/>
97+
<arg value="Makefile.bat"/>
98+
</exec>
8799
</target>
88100
<target name="libs">
89101
<exec dir="src/cz/crcs/ectester/standalone/libs/jni" failonerror="true" executable="make" osfamily="unix">
90102
<arg value="-k"/>
91103
</exec>
104+
<exec dir="src/cz/crcs/ectester/standalone/libs/jni" failonerror="true" executable="cmd" osfamily="windows">
105+
<arg value="/c"/>
106+
<arg value="Makefile.bat"/>
107+
</exec>
92108
</target>
93109

94110
<target name="-post-compile" depends="libs-try"/>
@@ -97,6 +113,11 @@
97113
osfamily="unix">
98114
<arg value="clean"/>
99115
</exec>
116+
<exec dir="src/cz/crcs/ectester/standalone/libs/jni" failonerror="true" executable="cmd" osfamily="windows">
117+
<arg value="/c"/>
118+
<arg value="Makefile.bat"/>
119+
<arg value="clean"/>
120+
</exec>
100121
</target>
101122

102123
<target name="headers" depends="compile">
@@ -115,6 +136,27 @@
115136
<class name="cz.crcs.ectester.standalone.libs.jni.NativeECPrivateKey$Botan"/>
116137
<class name="cz.crcs.ectester.standalone.libs.jni.NativeKeyAgreementSpi$Botan"/>
117138
<class name="cz.crcs.ectester.standalone.libs.jni.NativeSignatureSpi$Botan"/>
139+
<class name="cz.crcs.ectester.standalone.libs.CryptoppLib"/>
140+
<class name="cz.crcs.ectester.standalone.libs.jni.NativeProvider$Cryptopp"/>
141+
<class name="cz.crcs.ectester.standalone.libs.jni.NativeKeyPairGeneratorSpi$Cryptopp"/>
142+
<class name="cz.crcs.ectester.standalone.libs.jni.NativeECPublicKey$Cryptopp"/>
143+
<class name="cz.crcs.ectester.standalone.libs.jni.NativeECPrivateKey$Cryptopp"/>
144+
<class name="cz.crcs.ectester.standalone.libs.jni.NativeKeyAgreementSpi$Cryptopp"/>
145+
<class name="cz.crcs.ectester.standalone.libs.jni.NativeSignatureSpi$Cryptopp"/>
146+
<class name="cz.crcs.ectester.standalone.libs.OpensslLib"/>
147+
<class name="cz.crcs.ectester.standalone.libs.jni.NativeProvider$Openssl"/>
148+
<class name="cz.crcs.ectester.standalone.libs.jni.NativeKeyPairGeneratorSpi$Openssl"/>
149+
<class name="cz.crcs.ectester.standalone.libs.jni.NativeECPublicKey$Openssl"/>
150+
<class name="cz.crcs.ectester.standalone.libs.jni.NativeECPrivateKey$Openssl"/>
151+
<class name="cz.crcs.ectester.standalone.libs.jni.NativeKeyAgreementSpi$Openssl"/>
152+
<class name="cz.crcs.ectester.standalone.libs.jni.NativeSignatureSpi$Openssl"/>
153+
<class name="cz.crcs.ectester.standalone.libs.MscngLib"/>
154+
<class name="cz.crcs.ectester.standalone.libs.jni.NativeProvider$Mscng"/>
155+
<class name="cz.crcs.ectester.standalone.libs.jni.NativeKeyPairGeneratorSpi$Mscng"/>
156+
<class name="cz.crcs.ectester.standalone.libs.jni.NativeECPublicKey$Mscng"/>
157+
<class name="cz.crcs.ectester.standalone.libs.jni.NativeECPrivateKey$Mscng"/>
158+
<class name="cz.crcs.ectester.standalone.libs.jni.NativeKeyAgreementSpi$Mscng"/>
159+
<class name="cz.crcs.ectester.standalone.libs.jni.NativeSignatureSpi$Mscng"/>
118160
</javah>
119161
</target>
120162
</project>

Diff for: docs/CURVES.md

+62-14
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,95 @@
11
# Curves
2+
ECTester contains a collection of elliptic curve/point parameters, these parameters either come from standards or
3+
were generated manually or using [ecgen](https://github.com/J08nY/ecgen).
24

3-
## SECG
5+
These parameters can be found in the [cz.crcs.ectester.data](/src/cz/ectester/data/) package.
6+
7+
8+
## Standard
9+
10+
### SECG
411
SEC 2: Recommended Elliptic Curve Domain Parameters version 2.0 January 27, 2010
512

613
[Source](http://www.secg.org/sec2-v2.pdf)
714

8-
## NIST
15+
### NIST
916
RECOMMENDED ELLIPTIC CURVES FOR FEDERAL GOVERNMENT USE July 1999
1017

1118
[Source](http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-4.pdf)
1219

13-
## x962
20+
### x962
1421
ANSI X9.62 example curves.
1522

16-
## Brainpool
23+
### Brainpool
1724
ECC Brainpool Standard Curves and Curve Generation v. 1.0 19.10.2005
1825

1926
[Source](http://www.ecc-brainpool.org/download/Domain-parameters.pdf)
2027

21-
## anssi
28+
### anssi
2229
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
2330

24-
## GOST
31+
### GOST
2532
GOST R 34.10-2001: RFC5832 curves.
2633

2734
[Source](https://tools.ietf.org/html/rfc5832)
2835

29-
## anomalous
36+
### Barreto-Naehrig
37+
Barreto-Naehrig curves from: A Family of Implementation-Friendly BN Elliptic Curves
38+
39+
[Source](https://eprint.iacr.org/2010/429.pdf)
40+
41+
### Other
42+
An assortment of some other curves.
43+
Montgomery curves transformed into short Weierstrass form from <https://eprint.iacr.org/2013/647.pdf>
44+
45+
Curve25519 transformed into short Weierstrass form.
46+
47+
48+
## Generated
49+
50+
### anomalous
3051
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).
3152

3253
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).
3354

34-
## invalid
55+
### invalid
3556
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).
3657

37-
Generated using [ecgen](https://github.com/J08nY/ecgen)
58+
Generated using [ecgen](https://github.com/J08nY/ecgen).
3859

39-
## composite
60+
### composite
4061
Contains curves of composite order, with small order points.
4162

42-
Generated using [ecgen](https://github.com/J08nY/ecgen)
63+
Generated using [ecgen](https://github.com/J08nY/ecgen).
64+
65+
### wrong
66+
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.
67+
68+
Generated manually.
69+
70+
### twist
71+
Contains pre-generated points on twists of known named curves from NIST, SECG.
72+
These points can be used to attack some implementations.
73+
74+
Generated using [ecgen](https://github.com/J08nY/ecgen).
75+
76+
### degenerate
77+
Contains pre-generated points on the line `Y: x = 0`. These points are constructed from elements of prime
78+
order in the multiplicative group F_p given a curve over it.
79+
80+
Generate manually using [PARI/GP](http://pari.math.u-bordeaux.fr/).
81+
82+
### cofactor
83+
Contains curves that are composite order, with points not on the subgroup generated by the generator.
84+
85+
Generated using [ecgen](https://github.com/J08nY/ecgen).
86+
87+
### supersingular
88+
Contains supersingular curves, over F_p with order equal to p + 1. These have embedding degree equal to 2.
89+
90+
Generated using [ecgen](https://github.com/J08nY/ecgen).
4391

44-
## wrong
45-
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.
92+
## Other
4693

47-
Generated manually.
94+
### Wycheproof
95+
Contains some test vectors from the [google/Wycheproof](https://github.com/google/wycheproof) project.

Diff for: docs/FORMAT.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,8 @@ Output of the `-dsa/--ecdsa` option.
5656

5757
## Test runs
5858
By default test runs are output in a human readable format, however YAML and XML is also supported and can be selected
59-
by using the `-o/--output` option.
59+
by using the `--format` option. Also, prefixing the output file name when using the `-o/--output` option allows to output
60+
the same test run in different formats to different files.
61+
62+
For example:
63+
`--format yaml -o default_output.yaml -o xml:output_file.xml -o text:readable_text_file.txt `

0 commit comments

Comments
 (0)