aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJán Jančár2024-03-25 20:13:02 +0100
committerGitHub2024-03-25 20:13:02 +0100
commitdc7bb975e1c230f1f0a1937c454b2b90817d18e9 (patch)
tree8b4e3437e489894afcead9a6466050f3611cb38d
parent64b95fa059295e1dc23371c849f2302c1c18f5b4 (diff)
parent591deaece718b7821385ff0069b44adac4e1baf3 (diff)
downloadECTester-dc7bb975e1c230f1f0a1937c454b2b90817d18e9.tar.gz
ECTester-dc7bb975e1c230f1f0a1937c454b2b90817d18e9.tar.zst
ECTester-dc7bb975e1c230f1f0a1937c454b2b90817d18e9.zip
Merge pull request #20 from crocs-muni/feat/gradle
Move to gradle build
-rwxr-xr-x.appveyor.yml18
-rw-r--r--.gitattributes9
-rw-r--r--.github/workflows/build.yml99
-rw-r--r--.gitignore6
-rw-r--r--.travis.yml63
-rw-r--r--README.md66
-rw-r--r--applet/GPPcScConnectionPlugin.dllbin15360 -> 0 bytes
-rw-r--r--applet/GPShell.exebin33280 -> 0 bytes
-rw-r--r--applet/GlobalPlatform.dllbin117248 -> 0 bytes
-rw-r--r--applet/build.gradle.kts156
-rw-r--r--applet/gp.exebin908346 -> 0 bytes
-rw-r--r--applet/gp.jarbin894200 -> 0 bytes
-rw-r--r--applet/gppro_upload.bat14
-rwxr-xr-xapplet/gppro_upload.sh10
-rw-r--r--applet/gppro_upload_emv.bat15
-rwxr-xr-xapplet/gppro_upload_emv.sh10
-rw-r--r--applet/libeay32.dllbin1017344 -> 0 bytes
-rw-r--r--applet/openkms-gp.jarbin78142 -> 0 bytes
-rw-r--r--applet/src/main/java/cz/crcs/ectester/applet/AppletBase.java (renamed from src/cz/crcs/ectester/applet/AppletBase.java)200
-rw-r--r--applet/src/main/java/cz/crcs/ectester/applet/AppletUtil.java (renamed from src/cz/crcs/ectester/applet/AppletUtil.java)8
-rw-r--r--applet/src/main/java/cz/crcs/ectester/applet/CardConsts.java65
-rw-r--r--applet/src/main/java/cz/crcs/ectester/applet/ECKeyGenerator.java (renamed from src/cz/crcs/ectester/applet/ECKeyGenerator.java)0
-rw-r--r--applet/src/main/java/cz/crcs/ectester/applet/ECKeyTester.java (renamed from src/cz/crcs/ectester/applet/ECKeyTester.java)4
-rw-r--r--applet/src/main/java/cz/crcs/ectester/applet/ECTesterApplet.java (renamed from src/cz/crcs/ectester/applet/ECTesterApplet.java)6
-rw-r--r--applet/src/main/java/cz/crcs/ectester/applet/ECTesterAppletExtended.java (renamed from src/cz/crcs/ectester/applet/ECTesterAppletExtended.java)6
-rw-r--r--applet/src/main/java/cz/crcs/ectester/applet/EC_Consts.java (renamed from src/cz/crcs/ectester/applet/EC_Consts.java)1
-rw-r--r--applet/ssleay32.dllbin200704 -> 0 bytes
-rw-r--r--applet/zlib1.dllbin75264 -> 0 bytes
-rw-r--r--build-applet.xml107
-rw-r--r--build-reader.xml89
-rw-r--r--build-standalone.xml224
-rw-r--r--build.xml47
-rw-r--r--common/build.gradle.kts23
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/cli/Argument.java (renamed from src/cz/crcs/ectester/common/cli/Argument.java)0
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/cli/CLITools.java (renamed from src/cz/crcs/ectester/common/cli/CLITools.java)0
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/cli/Colors.java (renamed from src/cz/crcs/ectester/common/cli/Colors.java)0
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/cli/ParserOptions.java (renamed from src/cz/crcs/ectester/common/cli/ParserOptions.java)0
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/cli/TreeCommandLine.java (renamed from src/cz/crcs/ectester/common/cli/TreeCommandLine.java)0
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/cli/TreeParser.java (renamed from src/cz/crcs/ectester/common/cli/TreeParser.java)0
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/ec/CustomECFieldF2m.java (renamed from src/cz/crcs/ectester/common/ec/CustomECFieldF2m.java)0
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/ec/CustomECFieldFp.java (renamed from src/cz/crcs/ectester/common/ec/CustomECFieldFp.java)0
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/ec/CustomECParameterSpec.java (renamed from src/cz/crcs/ectester/common/ec/CustomECParameterSpec.java)0
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/ec/CustomEllipticCurve.java (renamed from src/cz/crcs/ectester/common/ec/CustomEllipticCurve.java)0
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/ec/EC_Category.java (renamed from src/cz/crcs/ectester/common/ec/EC_Category.java)0
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/ec/EC_Consts.java1403
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/ec/EC_Curve.java (renamed from src/cz/crcs/ectester/common/ec/EC_Curve.java)16
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/ec/EC_Data.java (renamed from src/cz/crcs/ectester/common/ec/EC_Data.java)0
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/ec/EC_KAResult.java (renamed from src/cz/crcs/ectester/common/ec/EC_KAResult.java)0
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/ec/EC_Key.java (renamed from src/cz/crcs/ectester/common/ec/EC_Key.java)2
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/ec/EC_Keypair.java (renamed from src/cz/crcs/ectester/common/ec/EC_Keypair.java)2
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/ec/EC_Params.java (renamed from src/cz/crcs/ectester/common/ec/EC_Params.java)1
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/ec/EC_SigResult.java (renamed from src/cz/crcs/ectester/common/ec/EC_SigResult.java)0
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/ec/RawECPrivateKey.java (renamed from src/cz/crcs/ectester/common/ec/RawECPrivateKey.java)0
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/ec/RawECPublicKey.java (renamed from src/cz/crcs/ectester/common/ec/RawECPublicKey.java)0
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/output/BaseTextTestWriter.java (renamed from src/cz/crcs/ectester/common/output/BaseTextTestWriter.java)0
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/output/BaseXMLTestWriter.java (renamed from src/cz/crcs/ectester/common/output/BaseXMLTestWriter.java)0
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/output/BaseYAMLTestWriter.java (renamed from src/cz/crcs/ectester/common/output/BaseYAMLTestWriter.java)0
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/output/OutputLogger.java (renamed from src/cz/crcs/ectester/common/output/OutputLogger.java)0
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/output/TeeOutputStream.java (renamed from src/cz/crcs/ectester/common/output/TeeOutputStream.java)0
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/output/TeeTestWriter.java (renamed from src/cz/crcs/ectester/common/output/TeeTestWriter.java)0
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/output/TestWriter.java (renamed from src/cz/crcs/ectester/common/output/TestWriter.java)0
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/test/BaseTestable.java (renamed from src/cz/crcs/ectester/common/test/BaseTestable.java)0
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/test/CompoundTest.java (renamed from src/cz/crcs/ectester/common/test/CompoundTest.java)0
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/test/Result.java (renamed from src/cz/crcs/ectester/common/test/Result.java)0
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/test/SimpleTest.java (renamed from src/cz/crcs/ectester/common/test/SimpleTest.java)0
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/test/Test.java (renamed from src/cz/crcs/ectester/common/test/Test.java)0
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/test/TestCallback.java (renamed from src/cz/crcs/ectester/common/test/TestCallback.java)0
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/test/TestException.java (renamed from src/cz/crcs/ectester/common/test/TestException.java)0
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/test/TestSuite.java (renamed from src/cz/crcs/ectester/common/test/TestSuite.java)0
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/test/TestSuiteException.java (renamed from src/cz/crcs/ectester/common/test/TestSuiteException.java)0
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/test/Testable.java (renamed from src/cz/crcs/ectester/common/test/Testable.java)0
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/util/ByteUtil.java (renamed from src/cz/crcs/ectester/common/util/ByteUtil.java)0
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/util/CardConsts.java65
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/util/CardUtil.java (renamed from src/cz/crcs/ectester/common/util/CardUtil.java)85
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/util/ECUtil.java (renamed from src/cz/crcs/ectester/common/util/ECUtil.java)18
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/util/FileUtil.java (renamed from src/cz/crcs/ectester/common/util/FileUtil.java)0
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/util/Util.java (renamed from src/cz/crcs/ectester/common/util/Util.java)0
-rw-r--r--common/src/main/java/cz/crcs/ectester/data/EC_Store.java (renamed from src/cz/crcs/ectester/data/EC_Store.java)5
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/anomalous/anomalous112.csv (renamed from src/cz/crcs/ectester/data/anomalous/anomalous112.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/anomalous/anomalous128.csv (renamed from src/cz/crcs/ectester/data/anomalous/anomalous128.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/anomalous/anomalous160.csv (renamed from src/cz/crcs/ectester/data/anomalous/anomalous160.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/anomalous/anomalous192.csv (renamed from src/cz/crcs/ectester/data/anomalous/anomalous192.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/anomalous/anomalous224.csv (renamed from src/cz/crcs/ectester/data/anomalous/anomalous224.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/anomalous/anomalous256.csv (renamed from src/cz/crcs/ectester/data/anomalous/anomalous256.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/anomalous/anomalous320.csv (renamed from src/cz/crcs/ectester/data/anomalous/anomalous320.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/anomalous/anomalous384.csv (renamed from src/cz/crcs/ectester/data/anomalous/anomalous384.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/anomalous/anomalous512.csv (renamed from src/cz/crcs/ectester/data/anomalous/anomalous512.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/anomalous/anomalous521.csv (renamed from src/cz/crcs/ectester/data/anomalous/anomalous521.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/anomalous/curves.xml (renamed from src/cz/crcs/ectester/data/anomalous/curves.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/anomalous/miyaji128a1.csv (renamed from src/cz/crcs/ectester/data/anomalous/miyaji128a1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/anomalous/miyaji128a2.csv (renamed from src/cz/crcs/ectester/data/anomalous/miyaji128a2.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/anomalous/miyaji128b1.csv (renamed from src/cz/crcs/ectester/data/anomalous/miyaji128b1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/anomalous/miyaji128b2.csv (renamed from src/cz/crcs/ectester/data/anomalous/miyaji128b2.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/anssi/curves.xml (renamed from src/cz/crcs/ectester/data/anssi/curves.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/anssi/frp256v1.csv (renamed from src/cz/crcs/ectester/data/anssi/frp256v1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/bn/bn158.csv (renamed from src/cz/crcs/ectester/data/bn/bn158.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/bn/bn190.csv (renamed from src/cz/crcs/ectester/data/bn/bn190.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/bn/bn222.csv (renamed from src/cz/crcs/ectester/data/bn/bn222.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/bn/bn254.csv (renamed from src/cz/crcs/ectester/data/bn/bn254.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/bn/bn286.csv (renamed from src/cz/crcs/ectester/data/bn/bn286.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/bn/bn318.csv (renamed from src/cz/crcs/ectester/data/bn/bn318.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/bn/bn350.csv (renamed from src/cz/crcs/ectester/data/bn/bn350.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/bn/bn382.csv (renamed from src/cz/crcs/ectester/data/bn/bn382.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/bn/bn414.csv (renamed from src/cz/crcs/ectester/data/bn/bn414.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/bn/bn446.csv (renamed from src/cz/crcs/ectester/data/bn/bn446.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/bn/bn478.csv (renamed from src/cz/crcs/ectester/data/bn/bn478.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/bn/bn510.csv (renamed from src/cz/crcs/ectester/data/bn/bn510.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/bn/bn542.csv (renamed from src/cz/crcs/ectester/data/bn/bn542.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/bn/bn574.csv (renamed from src/cz/crcs/ectester/data/bn/bn574.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/bn/bn606.csv (renamed from src/cz/crcs/ectester/data/bn/bn606.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/bn/bn638.csv (renamed from src/cz/crcs/ectester/data/bn/bn638.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/bn/curves.xml (renamed from src/cz/crcs/ectester/data/bn/curves.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP160r1.csv (renamed from src/cz/crcs/ectester/data/brainpool/brainpoolP160r1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP160t1.csv (renamed from src/cz/crcs/ectester/data/brainpool/brainpoolP160t1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP192r1.csv (renamed from src/cz/crcs/ectester/data/brainpool/brainpoolP192r1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP192t1.csv (renamed from src/cz/crcs/ectester/data/brainpool/brainpoolP192t1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP224r1.csv (renamed from src/cz/crcs/ectester/data/brainpool/brainpoolP224r1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP224t1.csv (renamed from src/cz/crcs/ectester/data/brainpool/brainpoolP224t1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP256r1.csv (renamed from src/cz/crcs/ectester/data/brainpool/brainpoolP256r1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP256t1.csv (renamed from src/cz/crcs/ectester/data/brainpool/brainpoolP256t1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP320r1.csv (renamed from src/cz/crcs/ectester/data/brainpool/brainpoolP320r1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP320t1.csv (renamed from src/cz/crcs/ectester/data/brainpool/brainpoolP320t1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP384r1.csv (renamed from src/cz/crcs/ectester/data/brainpool/brainpoolP384r1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP384t1.csv (renamed from src/cz/crcs/ectester/data/brainpool/brainpoolP384t1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP512r1.csv (renamed from src/cz/crcs/ectester/data/brainpool/brainpoolP512r1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP512t1.csv (renamed from src/cz/crcs/ectester/data/brainpool/brainpoolP512t1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/brainpool/curves.xml (renamed from src/cz/crcs/ectester/data/brainpool/curves.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/categories.xml (renamed from src/cz/crcs/ectester/data/categories.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor128p128.csv (renamed from src/cz/crcs/ectester/data/cofactor/cofactor128p128.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor128p16.csv (renamed from src/cz/crcs/ectester/data/cofactor/cofactor128p16.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor128p2.csv (renamed from src/cz/crcs/ectester/data/cofactor/cofactor128p2.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor128p32.csv (renamed from src/cz/crcs/ectester/data/cofactor/cofactor128p32.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor128p4.csv (renamed from src/cz/crcs/ectester/data/cofactor/cofactor128p4.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor128p56467.csv (renamed from src/cz/crcs/ectester/data/cofactor/cofactor128p56467.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor128p64.csv (renamed from src/cz/crcs/ectester/data/cofactor/cofactor128p64.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor128p65521.csv (renamed from src/cz/crcs/ectester/data/cofactor/cofactor128p65521.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor128p65535.csv (renamed from src/cz/crcs/ectester/data/cofactor/cofactor128p65535.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor128p8.csv (renamed from src/cz/crcs/ectester/data/cofactor/cofactor128p8.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor160p16.csv (renamed from src/cz/crcs/ectester/data/cofactor/cofactor160p16.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor160p2.csv (renamed from src/cz/crcs/ectester/data/cofactor/cofactor160p2.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor160p32.csv (renamed from src/cz/crcs/ectester/data/cofactor/cofactor160p32.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor160p4.csv (renamed from src/cz/crcs/ectester/data/cofactor/cofactor160p4.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor160p56467.csv (renamed from src/cz/crcs/ectester/data/cofactor/cofactor160p56467.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor160p64.csv (renamed from src/cz/crcs/ectester/data/cofactor/cofactor160p64.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor160p65521.csv (renamed from src/cz/crcs/ectester/data/cofactor/cofactor160p65521.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor160p65535.csv (renamed from src/cz/crcs/ectester/data/cofactor/cofactor160p65535.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor160p8.csv (renamed from src/cz/crcs/ectester/data/cofactor/cofactor160p8.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor163t128.csv (renamed from src/cz/crcs/ectester/data/cofactor/cofactor163t128.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor163t16.csv (renamed from src/cz/crcs/ectester/data/cofactor/cofactor163t16.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor163t2.csv (renamed from src/cz/crcs/ectester/data/cofactor/cofactor163t2.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor163t32.csv (renamed from src/cz/crcs/ectester/data/cofactor/cofactor163t32.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor163t4.csv (renamed from src/cz/crcs/ectester/data/cofactor/cofactor163t4.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor163t64.csv (renamed from src/cz/crcs/ectester/data/cofactor/cofactor163t64.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor163t8.csv (renamed from src/cz/crcs/ectester/data/cofactor/cofactor163t8.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor192p2.csv (renamed from src/cz/crcs/ectester/data/cofactor/cofactor192p2.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor192p4.csv (renamed from src/cz/crcs/ectester/data/cofactor/cofactor192p4.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor192p8.csv (renamed from src/cz/crcs/ectester/data/cofactor/cofactor192p8.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor233t128.csv (renamed from src/cz/crcs/ectester/data/cofactor/cofactor233t128.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor233t16.csv (renamed from src/cz/crcs/ectester/data/cofactor/cofactor233t16.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor233t2.csv (renamed from src/cz/crcs/ectester/data/cofactor/cofactor233t2.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor233t32.csv (renamed from src/cz/crcs/ectester/data/cofactor/cofactor233t32.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor233t4.csv (renamed from src/cz/crcs/ectester/data/cofactor/cofactor233t4.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor233t64.csv (renamed from src/cz/crcs/ectester/data/cofactor/cofactor233t64.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor233t8.csv (renamed from src/cz/crcs/ectester/data/cofactor/cofactor233t8.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/cofactor/curves.xml (renamed from src/cz/crcs/ectester/data/cofactor/curves.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/cofactor/keys.xml (renamed from src/cz/crcs/ectester/data/cofactor/keys.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/cofactor/secg_keys.xml (renamed from src/cz/crcs/ectester/data/cofactor/secg_keys.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/carmichael_128.csv (renamed from src/cz/crcs/ectester/data/composite/carmichael_128.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/carmichael_192.csv (renamed from src/cz/crcs/ectester/data/composite/carmichael_192.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/carmichael_224.csv (renamed from src/cz/crcs/ectester/data/composite/carmichael_224.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/carmichael_256.csv (renamed from src/cz/crcs/ectester/data/composite/carmichael_256.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/carmichael_384.csv (renamed from src/cz/crcs/ectester/data/composite/carmichael_384.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/carmichael_512.csv (renamed from src/cz/crcs/ectester/data/composite/carmichael_512.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/carmichael_521.csv (renamed from src/cz/crcs/ectester/data/composite/carmichael_521.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/composite128.csv (renamed from src/cz/crcs/ectester/data/composite/composite128.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/composite128_pq.csv (renamed from src/cz/crcs/ectester/data/composite/composite128_pq.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/composite128_pq1.csv (renamed from src/cz/crcs/ectester/data/composite/composite128_pq1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/composite128_pq2.csv (renamed from src/cz/crcs/ectester/data/composite/composite128_pq2.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/composite128_rg0.csv (renamed from src/cz/crcs/ectester/data/composite/composite128_rg0.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/composite128_small.csv (renamed from src/cz/crcs/ectester/data/composite/composite128_small.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/composite160.csv (renamed from src/cz/crcs/ectester/data/composite/composite160.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/composite160_pq.csv (renamed from src/cz/crcs/ectester/data/composite/composite160_pq.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/composite160_pq1.csv (renamed from src/cz/crcs/ectester/data/composite/composite160_pq1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/composite160_pq2.csv (renamed from src/cz/crcs/ectester/data/composite/composite160_pq2.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/composite160_rg0.csv (renamed from src/cz/crcs/ectester/data/composite/composite160_rg0.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/composite160_small.csv (renamed from src/cz/crcs/ectester/data/composite/composite160_small.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/composite192.csv (renamed from src/cz/crcs/ectester/data/composite/composite192.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/composite192_pq.csv (renamed from src/cz/crcs/ectester/data/composite/composite192_pq.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/composite192_pq1.csv (renamed from src/cz/crcs/ectester/data/composite/composite192_pq1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/composite192_pq2.csv (renamed from src/cz/crcs/ectester/data/composite/composite192_pq2.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/composite192_rg0.csv (renamed from src/cz/crcs/ectester/data/composite/composite192_rg0.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/composite192_small.csv (renamed from src/cz/crcs/ectester/data/composite/composite192_small.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/composite224.csv (renamed from src/cz/crcs/ectester/data/composite/composite224.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/composite224_pq.csv (renamed from src/cz/crcs/ectester/data/composite/composite224_pq.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/composite224_pq1.csv (renamed from src/cz/crcs/ectester/data/composite/composite224_pq1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/composite224_pq2.csv (renamed from src/cz/crcs/ectester/data/composite/composite224_pq2.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/composite224_rg0.csv (renamed from src/cz/crcs/ectester/data/composite/composite224_rg0.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/composite224_small.csv (renamed from src/cz/crcs/ectester/data/composite/composite224_small.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/composite256.csv (renamed from src/cz/crcs/ectester/data/composite/composite256.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/composite256_pq.csv (renamed from src/cz/crcs/ectester/data/composite/composite256_pq.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/composite256_pq1.csv (renamed from src/cz/crcs/ectester/data/composite/composite256_pq1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/composite256_pq2.csv (renamed from src/cz/crcs/ectester/data/composite/composite256_pq2.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/composite256_rg0.csv (renamed from src/cz/crcs/ectester/data/composite/composite256_rg0.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/composite256_small.csv (renamed from src/cz/crcs/ectester/data/composite/composite256_small.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/composite384.csv (renamed from src/cz/crcs/ectester/data/composite/composite384.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/composite384_small.csv (renamed from src/cz/crcs/ectester/data/composite/composite384_small.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/composite521.csv (renamed from src/cz/crcs/ectester/data/composite/composite521.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/composite521_small.csv (renamed from src/cz/crcs/ectester/data/composite/composite521_small.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/curves.xml (renamed from src/cz/crcs/ectester/data/composite/curves.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/keys.xml (renamed from src/cz/crcs/ectester/data/composite/keys.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/10.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/first/10.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/112.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/first/112.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/12.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/first/12.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/128.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/first/128.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/135.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/first/135.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/14.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/first/14.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/140.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/first/140.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/144.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/first/144.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/146.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/first/146.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/148.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/first/148.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/150.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/first/150.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/152.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/first/152.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/152_cofactor.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/first/152_cofactor.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/16.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/first/16.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/20.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/first/20.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/25.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/first/25.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/2a.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/first/2a.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/2b.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/first/2b.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/3.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/first/3.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/32.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/first/32.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/4.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/first/4.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/48.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/first/48.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/5.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/first/5.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/6.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/first/6.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/64.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/first/64.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/7.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/first/7.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/70.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/first/70.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/8.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/first/8.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/80.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/first/80.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/90.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/first/90.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/96.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/first/96.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/140.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/second/140.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/141.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/second/141.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/142.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/second/142.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/143.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/second/143.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/144.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/second/144.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/145.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/second/145.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/146.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/second/146.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/147.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/second/147.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/148.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/second/148.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/149.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/second/149.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/150.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/second/150.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/151.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/second/151.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/152.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/second/152.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/153.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/second/153.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/154.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/second/154.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/155.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/second/155.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/156.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/second/156.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/157.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/second/157.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/158.csv (renamed from src/cz/crcs/ectester/data/composite/varying/160/second/158.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/degenerate/brainpool.xml (renamed from src/cz/crcs/ectester/data/degenerate/brainpool.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/degenerate/cofactor.xml (renamed from src/cz/crcs/ectester/data/degenerate/cofactor.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/degenerate/keys.xml (renamed from src/cz/crcs/ectester/data/degenerate/keys.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/degenerate/secg.xml (renamed from src/cz/crcs/ectester/data/degenerate/secg.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/gost/curves.xml (renamed from src/cz/crcs/ectester/data/gost/curves.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/gost/gost256.csv (renamed from src/cz/crcs/ectester/data/gost/gost256.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/gost/gost512.csv (renamed from src/cz/crcs/ectester/data/gost/gost512.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/invalid/brainpool/brainpoolP160r1.xml (renamed from src/cz/crcs/ectester/data/invalid/brainpool/brainpoolP160r1.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/invalid/brainpool/brainpoolP160t1.xml (renamed from src/cz/crcs/ectester/data/invalid/brainpool/brainpoolP160t1.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/invalid/brainpool/brainpoolP192r1.xml (renamed from src/cz/crcs/ectester/data/invalid/brainpool/brainpoolP192r1.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/invalid/brainpool/brainpoolP192t1.xml (renamed from src/cz/crcs/ectester/data/invalid/brainpool/brainpoolP192t1.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/invalid/brainpool/brainpoolP224r1.xml (renamed from src/cz/crcs/ectester/data/invalid/brainpool/brainpoolP224r1.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/invalid/brainpool/brainpoolP224t1.xml (renamed from src/cz/crcs/ectester/data/invalid/brainpool/brainpoolP224t1.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/invalid/brainpool/brainpoolP256r1.xml (renamed from src/cz/crcs/ectester/data/invalid/brainpool/brainpoolP256r1.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/invalid/brainpool/brainpoolP256t1.xml (renamed from src/cz/crcs/ectester/data/invalid/brainpool/brainpoolP256t1.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/invalid/keys.xml (renamed from src/cz/crcs/ectester/data/invalid/keys.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/invalid/nist/b163.xml (renamed from src/cz/crcs/ectester/data/invalid/nist/b163.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/invalid/nist/b233.xml (renamed from src/cz/crcs/ectester/data/invalid/nist/b233.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/invalid/nist/b283.xml (renamed from src/cz/crcs/ectester/data/invalid/nist/b283.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/invalid/nist/k163.xml (renamed from src/cz/crcs/ectester/data/invalid/nist/k163.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/invalid/nist/k233.xml (renamed from src/cz/crcs/ectester/data/invalid/nist/k233.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/invalid/nist/k283.xml (renamed from src/cz/crcs/ectester/data/invalid/nist/k283.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/invalid/secg/secp112r1.xml (renamed from src/cz/crcs/ectester/data/invalid/secg/secp112r1.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/invalid/secg/secp112r2.xml (renamed from src/cz/crcs/ectester/data/invalid/secg/secp112r2.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/invalid/secg/secp128r1.xml (renamed from src/cz/crcs/ectester/data/invalid/secg/secp128r1.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/invalid/secg/secp128r2.xml (renamed from src/cz/crcs/ectester/data/invalid/secg/secp128r2.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/invalid/secg/secp160r1.xml (renamed from src/cz/crcs/ectester/data/invalid/secg/secp160r1.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/invalid/secg/secp160r2.xml (renamed from src/cz/crcs/ectester/data/invalid/secg/secp160r2.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/invalid/secg/secp192r1.xml (renamed from src/cz/crcs/ectester/data/invalid/secg/secp192r1.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/invalid/secg/secp224r1.xml (renamed from src/cz/crcs/ectester/data/invalid/secg/secp224r1.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/invalid/secg/secp256r1.xml (renamed from src/cz/crcs/ectester/data/invalid/secg/secp256r1.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/misc/keys.xml (renamed from src/cz/crcs/ectester/data/misc/keys.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/misc/results.xml (renamed from src/cz/crcs/ectester/data/misc/results.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/mnt/curves.xml (renamed from src/cz/crcs/ectester/data/mnt/curves.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/mnt/mnt1.csv (renamed from src/cz/crcs/ectester/data/mnt/mnt1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/mnt/mnt2_1.csv (renamed from src/cz/crcs/ectester/data/mnt/mnt2_1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/mnt/mnt2_2.csv (renamed from src/cz/crcs/ectester/data/mnt/mnt2_2.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/mnt/mnt3_1.csv (renamed from src/cz/crcs/ectester/data/mnt/mnt3_1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/mnt/mnt3_2.csv (renamed from src/cz/crcs/ectester/data/mnt/mnt3_2.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/mnt/mnt3_3.csv (renamed from src/cz/crcs/ectester/data/mnt/mnt3_3.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/mnt/mnt4.csv (renamed from src/cz/crcs/ectester/data/mnt/mnt4.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/mnt/mnt5_1.csv (renamed from src/cz/crcs/ectester/data/mnt/mnt5_1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/mnt/mnt5_2.csv (renamed from src/cz/crcs/ectester/data/mnt/mnt5_2.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/mnt/mnt5_3.csv (renamed from src/cz/crcs/ectester/data/mnt/mnt5_3.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/nist/b163.csv (renamed from src/cz/crcs/ectester/data/nist/b163.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/nist/b233.csv (renamed from src/cz/crcs/ectester/data/nist/b233.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/nist/b283.csv (renamed from src/cz/crcs/ectester/data/nist/b283.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/nist/b409.csv (renamed from src/cz/crcs/ectester/data/nist/b409.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/nist/b571.csv (renamed from src/cz/crcs/ectester/data/nist/b571.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/nist/curves.xml (renamed from src/cz/crcs/ectester/data/nist/curves.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/nist/k163.csv (renamed from src/cz/crcs/ectester/data/nist/k163.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/nist/k233.csv (renamed from src/cz/crcs/ectester/data/nist/k233.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/nist/k283.csv (renamed from src/cz/crcs/ectester/data/nist/k283.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/nist/k409.csv (renamed from src/cz/crcs/ectester/data/nist/k409.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/nist/k571.csv (renamed from src/cz/crcs/ectester/data/nist/k571.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/nist/p192.csv (renamed from src/cz/crcs/ectester/data/nist/p192.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/nist/p224.csv (renamed from src/cz/crcs/ectester/data/nist/p224.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/nist/p256.csv (renamed from src/cz/crcs/ectester/data/nist/p256.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/nist/p384.csv (renamed from src/cz/crcs/ectester/data/nist/p384.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/nist/p521.csv (renamed from src/cz/crcs/ectester/data/nist/p521.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/other/curve25519.csv (renamed from src/cz/crcs/ectester/data/other/curve25519.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/other/curves.xml (renamed from src/cz/crcs/ectester/data/other/curves.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/other/m221.csv (renamed from src/cz/crcs/ectester/data/other/m221.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/other/m383.csv (renamed from src/cz/crcs/ectester/data/other/m383.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/other/m511.csv (renamed from src/cz/crcs/ectester/data/other/m511.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/schema.xsd (renamed from src/cz/crcs/ectester/data/schema.xsd)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/secg/curves.xml (renamed from src/cz/crcs/ectester/data/secg/curves.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/secg/secp112r1.csv (renamed from src/cz/crcs/ectester/data/secg/secp112r1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/secg/secp112r2.csv (renamed from src/cz/crcs/ectester/data/secg/secp112r2.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/secg/secp128r1.csv (renamed from src/cz/crcs/ectester/data/secg/secp128r1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/secg/secp128r2.csv (renamed from src/cz/crcs/ectester/data/secg/secp128r2.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/secg/secp160k1.csv (renamed from src/cz/crcs/ectester/data/secg/secp160k1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/secg/secp160r1.csv (renamed from src/cz/crcs/ectester/data/secg/secp160r1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/secg/secp160r2.csv (renamed from src/cz/crcs/ectester/data/secg/secp160r2.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/secg/secp192k1.csv (renamed from src/cz/crcs/ectester/data/secg/secp192k1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/secg/secp192r1.csv (renamed from src/cz/crcs/ectester/data/secg/secp192r1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/secg/secp224r1.csv (renamed from src/cz/crcs/ectester/data/secg/secp224r1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/secg/secp256k1.csv (renamed from src/cz/crcs/ectester/data/secg/secp256k1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/secg/secp256r1.csv (renamed from src/cz/crcs/ectester/data/secg/secp256r1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/secg/secp384r1.csv (renamed from src/cz/crcs/ectester/data/secg/secp384r1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/secg/secp521r1.csv (renamed from src/cz/crcs/ectester/data/secg/secp521r1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/secg/sect163k1.csv (renamed from src/cz/crcs/ectester/data/secg/sect163k1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/secg/sect163r1.csv (renamed from src/cz/crcs/ectester/data/secg/sect163r1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/secg/sect163r2.csv (renamed from src/cz/crcs/ectester/data/secg/sect163r2.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/secg/sect233k1.csv (renamed from src/cz/crcs/ectester/data/secg/sect233k1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/secg/sect233r1.csv (renamed from src/cz/crcs/ectester/data/secg/sect233r1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/secg/sect239k1.csv (renamed from src/cz/crcs/ectester/data/secg/sect239k1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/secg/sect283k1.csv (renamed from src/cz/crcs/ectester/data/secg/sect283k1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/secg/sect283r1.csv (renamed from src/cz/crcs/ectester/data/secg/sect283r1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/secg/sect409k1.csv (renamed from src/cz/crcs/ectester/data/secg/sect409k1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/secg/sect409r1.csv (renamed from src/cz/crcs/ectester/data/secg/sect409r1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/secg/sect571k1.csv (renamed from src/cz/crcs/ectester/data/secg/sect571k1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/secg/sect571r1.csv (renamed from src/cz/crcs/ectester/data/secg/sect571r1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/supersingular/curves.xml (renamed from src/cz/crcs/ectester/data/supersingular/curves.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/supersingular/ss128.csv (renamed from src/cz/crcs/ectester/data/supersingular/ss128.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/supersingular/ss192.csv (renamed from src/cz/crcs/ectester/data/supersingular/ss192.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/supersingular/ss224.csv (renamed from src/cz/crcs/ectester/data/supersingular/ss224.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/supersingular/ss256.csv (renamed from src/cz/crcs/ectester/data/supersingular/ss256.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP224r1-dh-raw.csv (renamed from src/cz/crcs/ectester/data/test/brainpool/brainpoolP224r1-dh-raw.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP224r1-dh-sha1.csv (renamed from src/cz/crcs/ectester/data/test/brainpool/brainpoolP224r1-dh-sha1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP224r1-keyA.csv (renamed from src/cz/crcs/ectester/data/test/brainpool/brainpoolP224r1-keyA.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP224r1-keyB.csv (renamed from src/cz/crcs/ectester/data/test/brainpool/brainpoolP224r1-keyB.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP256r1-dh-raw.csv (renamed from src/cz/crcs/ectester/data/test/brainpool/brainpoolP256r1-dh-raw.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP256r1-dh-sha1.csv (renamed from src/cz/crcs/ectester/data/test/brainpool/brainpoolP256r1-dh-sha1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP256r1-keyA.csv (renamed from src/cz/crcs/ectester/data/test/brainpool/brainpoolP256r1-keyA.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP256r1-keyB.csv (renamed from src/cz/crcs/ectester/data/test/brainpool/brainpoolP256r1-keyB.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP384r1-dh-raw.csv (renamed from src/cz/crcs/ectester/data/test/brainpool/brainpoolP384r1-dh-raw.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP384r1-dh-sha1.csv (renamed from src/cz/crcs/ectester/data/test/brainpool/brainpoolP384r1-dh-sha1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP384r1-keyA.csv (renamed from src/cz/crcs/ectester/data/test/brainpool/brainpoolP384r1-keyA.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP384r1-keyB.csv (renamed from src/cz/crcs/ectester/data/test/brainpool/brainpoolP384r1-keyB.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP512r1-dh-raw.csv (renamed from src/cz/crcs/ectester/data/test/brainpool/brainpoolP512r1-dh-raw.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP512r1-dh-sha1.csv (renamed from src/cz/crcs/ectester/data/test/brainpool/brainpoolP512r1-dh-sha1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP512r1-keyA.csv (renamed from src/cz/crcs/ectester/data/test/brainpool/brainpoolP512r1-keyA.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP512r1-keyB.csv (renamed from src/cz/crcs/ectester/data/test/brainpool/brainpoolP512r1-keyB.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/keys.xml (renamed from src/cz/crcs/ectester/data/test/keys.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/b163-dhc-raw.csv (renamed from src/cz/crcs/ectester/data/test/nist/b163-dhc-raw.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/b163-dhc-sha1.csv (renamed from src/cz/crcs/ectester/data/test/nist/b163-dhc-sha1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/b163-keyCAVS.csv (renamed from src/cz/crcs/ectester/data/test/nist/b163-keyCAVS.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/b163-keyIUT.csv (renamed from src/cz/crcs/ectester/data/test/nist/b163-keyIUT.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/b233-dhc-raw.csv (renamed from src/cz/crcs/ectester/data/test/nist/b233-dhc-raw.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/b233-dhc-sha1.csv (renamed from src/cz/crcs/ectester/data/test/nist/b233-dhc-sha1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/b233-keyCAVS.csv (renamed from src/cz/crcs/ectester/data/test/nist/b233-keyCAVS.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/b233-keyIUT.csv (renamed from src/cz/crcs/ectester/data/test/nist/b233-keyIUT.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/b283-dhc-raw.csv (renamed from src/cz/crcs/ectester/data/test/nist/b283-dhc-raw.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/b283-dhc-sha1.csv (renamed from src/cz/crcs/ectester/data/test/nist/b283-dhc-sha1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/b283-keyCAVS.csv (renamed from src/cz/crcs/ectester/data/test/nist/b283-keyCAVS.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/b283-keyIUT.csv (renamed from src/cz/crcs/ectester/data/test/nist/b283-keyIUT.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/b409-dhc-raw.csv (renamed from src/cz/crcs/ectester/data/test/nist/b409-dhc-raw.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/b409-dhc-sha1.csv (renamed from src/cz/crcs/ectester/data/test/nist/b409-dhc-sha1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/b409-keyCAVS.csv (renamed from src/cz/crcs/ectester/data/test/nist/b409-keyCAVS.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/b409-keyIUT.csv (renamed from src/cz/crcs/ectester/data/test/nist/b409-keyIUT.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/b571-dhc-raw.csv (renamed from src/cz/crcs/ectester/data/test/nist/b571-dhc-raw.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/b571-dhc-sha1.csv (renamed from src/cz/crcs/ectester/data/test/nist/b571-dhc-sha1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/b571-keyCAVS.csv (renamed from src/cz/crcs/ectester/data/test/nist/b571-keyCAVS.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/b571-keyIUT.csv (renamed from src/cz/crcs/ectester/data/test/nist/b571-keyIUT.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/k163-dhc-raw.csv (renamed from src/cz/crcs/ectester/data/test/nist/k163-dhc-raw.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/k163-dhc-sha1.csv (renamed from src/cz/crcs/ectester/data/test/nist/k163-dhc-sha1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/k163-keyCAVS.csv (renamed from src/cz/crcs/ectester/data/test/nist/k163-keyCAVS.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/k163-keyIUT.csv (renamed from src/cz/crcs/ectester/data/test/nist/k163-keyIUT.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/k233-dhc-raw.csv (renamed from src/cz/crcs/ectester/data/test/nist/k233-dhc-raw.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/k233-dhc-sha1.csv (renamed from src/cz/crcs/ectester/data/test/nist/k233-dhc-sha1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/k233-keyCAVS.csv (renamed from src/cz/crcs/ectester/data/test/nist/k233-keyCAVS.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/k233-keyIUT.csv (renamed from src/cz/crcs/ectester/data/test/nist/k233-keyIUT.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/k283-dhc-raw.csv (renamed from src/cz/crcs/ectester/data/test/nist/k283-dhc-raw.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/k283-dhc-sha1.csv (renamed from src/cz/crcs/ectester/data/test/nist/k283-dhc-sha1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/k283-keyCAVS.csv (renamed from src/cz/crcs/ectester/data/test/nist/k283-keyCAVS.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/k283-keyIUT.csv (renamed from src/cz/crcs/ectester/data/test/nist/k283-keyIUT.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/k409-dhc-raw.csv (renamed from src/cz/crcs/ectester/data/test/nist/k409-dhc-raw.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/k409-dhc-sha1.csv (renamed from src/cz/crcs/ectester/data/test/nist/k409-dhc-sha1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/k409-keyCAVS.csv (renamed from src/cz/crcs/ectester/data/test/nist/k409-keyCAVS.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/k409-keyIUT.csv (renamed from src/cz/crcs/ectester/data/test/nist/k409-keyIUT.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/k571-dhc-raw.csv (renamed from src/cz/crcs/ectester/data/test/nist/k571-dhc-raw.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/k571-dhc-sha1.csv (renamed from src/cz/crcs/ectester/data/test/nist/k571-dhc-sha1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/k571-keyCAVS.csv (renamed from src/cz/crcs/ectester/data/test/nist/k571-keyCAVS.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/k571-keyIUT.csv (renamed from src/cz/crcs/ectester/data/test/nist/k571-keyIUT.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/p192-dhc-raw.csv (renamed from src/cz/crcs/ectester/data/test/nist/p192-dhc-raw.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/p192-dhc-sha1.csv (renamed from src/cz/crcs/ectester/data/test/nist/p192-dhc-sha1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/p192-keyCAVS.csv (renamed from src/cz/crcs/ectester/data/test/nist/p192-keyCAVS.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/p192-keyIUT.csv (renamed from src/cz/crcs/ectester/data/test/nist/p192-keyIUT.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/p224-dhc-raw.csv (renamed from src/cz/crcs/ectester/data/test/nist/p224-dhc-raw.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/p224-dhc-sha1.csv (renamed from src/cz/crcs/ectester/data/test/nist/p224-dhc-sha1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/p224-keyCAVS.csv (renamed from src/cz/crcs/ectester/data/test/nist/p224-keyCAVS.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/p224-keyIUT.csv (renamed from src/cz/crcs/ectester/data/test/nist/p224-keyIUT.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/p256-dhc-raw.csv (renamed from src/cz/crcs/ectester/data/test/nist/p256-dhc-raw.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/p256-dhc-sha1.csv (renamed from src/cz/crcs/ectester/data/test/nist/p256-dhc-sha1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/p256-keyCAVS.csv (renamed from src/cz/crcs/ectester/data/test/nist/p256-keyCAVS.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/p256-keyIUT.csv (renamed from src/cz/crcs/ectester/data/test/nist/p256-keyIUT.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/p384-dhc-raw.csv (renamed from src/cz/crcs/ectester/data/test/nist/p384-dhc-raw.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/p384-dhc-sha1.csv (renamed from src/cz/crcs/ectester/data/test/nist/p384-dhc-sha1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/p384-keyCAVS.csv (renamed from src/cz/crcs/ectester/data/test/nist/p384-keyCAVS.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/p384-keyIUT.csv (renamed from src/cz/crcs/ectester/data/test/nist/p384-keyIUT.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/p521-dhc-raw.csv (renamed from src/cz/crcs/ectester/data/test/nist/p521-dhc-raw.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/p521-dhc-sha1.csv (renamed from src/cz/crcs/ectester/data/test/nist/p521-dhc-sha1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/p521-keyCAVS.csv (renamed from src/cz/crcs/ectester/data/test/nist/p521-keyCAVS.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/nist/p521-keyIUT.csv (renamed from src/cz/crcs/ectester/data/test/nist/p521-keyIUT.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/results.xml (renamed from src/cz/crcs/ectester/data/test/results.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/secg/secp160r1-dh-kdf.csv (renamed from src/cz/crcs/ectester/data/test/secg/secp160r1-dh-kdf.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/secg/secp160r1-dh-raw.csv (renamed from src/cz/crcs/ectester/data/test/secg/secp160r1-dh-raw.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/secg/secp160r1-dh-sha1.csv (renamed from src/cz/crcs/ectester/data/test/secg/secp160r1-dh-sha1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/secg/secp160r1-keyU.csv (renamed from src/cz/crcs/ectester/data/test/secg/secp160r1-keyU.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/secg/secp160r1-keyV.csv (renamed from src/cz/crcs/ectester/data/test/secg/secp160r1-keyV.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/secg/sect163k1-dh-kdf.csv (renamed from src/cz/crcs/ectester/data/test/secg/sect163k1-dh-kdf.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/secg/sect163k1-dh-raw.csv (renamed from src/cz/crcs/ectester/data/test/secg/sect163k1-dh-raw.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/secg/sect163k1-dh-sha1.csv (renamed from src/cz/crcs/ectester/data/test/secg/sect163k1-dh-sha1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/secg/sect163k1-dhc-kdf.csv (renamed from src/cz/crcs/ectester/data/test/secg/sect163k1-dhc-kdf.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/secg/sect163k1-dhc-raw.csv (renamed from src/cz/crcs/ectester/data/test/secg/sect163k1-dhc-raw.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/secg/sect163k1-dhc-sha1.csv (renamed from src/cz/crcs/ectester/data/test/secg/sect163k1-dhc-sha1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/secg/sect163k1-keyU.csv (renamed from src/cz/crcs/ectester/data/test/secg/sect163k1-keyU.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/test/secg/sect163k1-keyV.csv (renamed from src/cz/crcs/ectester/data/test/secg/sect163k1-keyV.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/twist/cofactor/cofactor128p4.xml (renamed from src/cz/crcs/ectester/data/twist/cofactor/cofactor128p4.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/twist/cofactor/cofactor160p4.xml (renamed from src/cz/crcs/ectester/data/twist/cofactor/cofactor160p4.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/twist/keys.xml (renamed from src/cz/crcs/ectester/data/twist/keys.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/twist/nist/b163.xml (renamed from src/cz/crcs/ectester/data/twist/nist/b163.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/twist/nist/b233.xml (renamed from src/cz/crcs/ectester/data/twist/nist/b233.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/twist/nist/b283.xml (renamed from src/cz/crcs/ectester/data/twist/nist/b283.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/twist/nist/k163.xml (renamed from src/cz/crcs/ectester/data/twist/nist/k163.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/twist/nist/k233.xml (renamed from src/cz/crcs/ectester/data/twist/nist/k233.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/twist/nist/k283.xml (renamed from src/cz/crcs/ectester/data/twist/nist/k283.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/twist/nist/p192.xml (renamed from src/cz/crcs/ectester/data/twist/nist/p192.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/twist/nist/p224.xml (renamed from src/cz/crcs/ectester/data/twist/nist/p224.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/twist/nist/p256.xml (renamed from src/cz/crcs/ectester/data/twist/nist/p256.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/twist/nist/p384.xml (renamed from src/cz/crcs/ectester/data/twist/nist/p384.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/twist/nist/p521.xml (renamed from src/cz/crcs/ectester/data/twist/nist/p521.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp112r1.xml (renamed from src/cz/crcs/ectester/data/twist/secg/secp112r1.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp112r2.xml (renamed from src/cz/crcs/ectester/data/twist/secg/secp112r2.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp128r1.xml (renamed from src/cz/crcs/ectester/data/twist/secg/secp128r1.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp128r2.xml (renamed from src/cz/crcs/ectester/data/twist/secg/secp128r2.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp160k1.xml (renamed from src/cz/crcs/ectester/data/twist/secg/secp160k1.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp160r1.xml (renamed from src/cz/crcs/ectester/data/twist/secg/secp160r1.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp160r2.xml (renamed from src/cz/crcs/ectester/data/twist/secg/secp160r2.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp192k1.xml (renamed from src/cz/crcs/ectester/data/twist/secg/secp192k1.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp192r1.xml (renamed from src/cz/crcs/ectester/data/twist/secg/secp192r1.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp224r1.xml (renamed from src/cz/crcs/ectester/data/twist/secg/secp224r1.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp256k1.xml (renamed from src/cz/crcs/ectester/data/twist/secg/secp256k1.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp256r1.xml (renamed from src/cz/crcs/ectester/data/twist/secg/secp256r1.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp384r1.xml (renamed from src/cz/crcs/ectester/data/twist/secg/secp384r1.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp521r1.xml (renamed from src/cz/crcs/ectester/data/twist/secg/secp521r1.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/twist/secg/sect163k1.xml (renamed from src/cz/crcs/ectester/data/twist/secg/sect163k1.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/twist/secg/sect163r1.xml (renamed from src/cz/crcs/ectester/data/twist/secg/sect163r1.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/twist/secg/sect163r2.xml (renamed from src/cz/crcs/ectester/data/twist/secg/sect163r2.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/twist/secg/sect233k1.xml (renamed from src/cz/crcs/ectester/data/twist/secg/sect233k1.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/twist/secg/sect233r1.xml (renamed from src/cz/crcs/ectester/data/twist/secg/sect233r1.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/twist/secg/sect239k1.xml (renamed from src/cz/crcs/ectester/data/twist/secg/sect239k1.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/twist/secg/sect283k1.xml (renamed from src/cz/crcs/ectester/data/twist/secg/sect283k1.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/twist/secg/sect283r1.xml (renamed from src/cz/crcs/ectester/data/twist/secg/sect283r1.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/wrong/curves.xml (renamed from src/cz/crcs/ectester/data/wrong/curves.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/wrong/keys.xml (renamed from src/cz/crcs/ectester/data/wrong/keys.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/wrong/results.xml (renamed from src/cz/crcs/ectester/data/wrong/results.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/wrong/wrongp128.csv (renamed from src/cz/crcs/ectester/data/wrong/wrongp128.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/wrong/wrongp160.csv (renamed from src/cz/crcs/ectester/data/wrong/wrongp160.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/wrong/wrongp192.csv (renamed from src/cz/crcs/ectester/data/wrong/wrongp192.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/wrong/wrongp224.csv (renamed from src/cz/crcs/ectester/data/wrong/wrongp224.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/wrong/wrongp256.csv (renamed from src/cz/crcs/ectester/data/wrong/wrongp256.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/wrong/wrongp384.csv (renamed from src/cz/crcs/ectester/data/wrong/wrongp384.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/wrong/wrongp521.csv (renamed from src/cz/crcs/ectester/data/wrong/wrongp521.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/wrong/wrongt163.csv (renamed from src/cz/crcs/ectester/data/wrong/wrongt163.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/wrong/wrongt233.csv (renamed from src/cz/crcs/ectester/data/wrong/wrongt233.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/wrong/wrongt239.csv (renamed from src/cz/crcs/ectester/data/wrong/wrongt239.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/wrong/wrongt283.csv (renamed from src/cz/crcs/ectester/data/wrong/wrongt283.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/wrong/wrongt409.csv (renamed from src/cz/crcs/ectester/data/wrong/wrongt409.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/wrong/wrongt571.csv (renamed from src/cz/crcs/ectester/data/wrong/wrongt571.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/wycheproof/keys.xml (renamed from src/cz/crcs/ectester/data/wycheproof/keys.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/wycheproof/results.xml (renamed from src/cz/crcs/ectester/data/wycheproof/results.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/x962/curves.xml (renamed from src/cz/crcs/ectester/data/x962/curves.xml)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/x962/prime192v1.csv (renamed from src/cz/crcs/ectester/data/x962/prime192v1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/x962/prime192v2.csv (renamed from src/cz/crcs/ectester/data/x962/prime192v2.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/x962/prime192v3.csv (renamed from src/cz/crcs/ectester/data/x962/prime192v3.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/x962/prime239v1.csv (renamed from src/cz/crcs/ectester/data/x962/prime239v1.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/x962/prime239v2.csv (renamed from src/cz/crcs/ectester/data/x962/prime239v2.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/x962/prime239v3.csv (renamed from src/cz/crcs/ectester/data/x962/prime239v3.csv)0
-rw-r--r--common/src/main/resources/cz/crcs/ectester/data/x962/prime256v1.csv (renamed from src/cz/crcs/ectester/data/x962/prime256v1.csv)0
-rw-r--r--dist/README.TXT16
-rw-r--r--docs/DEVELOPING.md7
-rw-r--r--ext/ant-javacard.jarbin372534 -> 0 bytes
m---------ext/libressl0
m---------ext/sdks0
-rw-r--r--ext/wolfcrypt-jni.jar (renamed from lib/wolfcrypt-jni.jar)bin83453 -> 83453 bytes
-rw-r--r--gradle/wrapper/gradle-wrapper.jarbin0 -> 43462 bytes
-rw-r--r--gradle/wrapper/gradle-wrapper.properties7
-rwxr-xr-xgradlew249
-rw-r--r--gradlew.bat92
-rw-r--r--lib/bcprov-jdk18on-177.jarbin8372360 -> 0 bytes
-rw-r--r--lib/commons-cli-1.5.0-javadoc.jarbin185927 -> 0 bytes
-rw-r--r--lib/commons-cli-1.5.0.jarbin58284 -> 0 bytes
-rw-r--r--lib/jcardsim-3.0.5.11.jarbin499643 -> 0 bytes
-rw-r--r--lib/snakeyaml-1.19.jarbin297518 -> 0 bytes
-rw-r--r--nbproject/copylibstask.jarbin11902 -> 0 bytes
-rw-r--r--nbproject/dist-build.xml39
-rw-r--r--nbproject/genfiles.properties8
-rwxr-xr-xnbproject/keystorebin3987 -> 0 bytes
-rw-r--r--nbproject/reader/build-impl.xml1413
-rw-r--r--nbproject/reader/manifest.mf4
-rw-r--r--nbproject/reader/project.properties80
-rw-r--r--nbproject/reader/project.xml15
-rw-r--r--nbproject/standalone/build-impl.xml1413
-rw-r--r--nbproject/standalone/manifest.mf4
-rw-r--r--nbproject/standalone/project.properties81
-rw-r--r--nbproject/standalone/project.xml15
-rw-r--r--reader/build.gradle.kts38
-rw-r--r--reader/src/main/java/cz/crcs/ectester/reader/CardMngr.java (renamed from src/cz/crcs/ectester/reader/CardMngr.java)7
-rw-r--r--reader/src/main/java/cz/crcs/ectester/reader/ECTesterReader.java (renamed from src/cz/crcs/ectester/reader/ECTesterReader.java)123
-rw-r--r--reader/src/main/java/cz/crcs/ectester/reader/ISO7816_status_words.txt (renamed from src/cz/crcs/ectester/reader/ISO7816_status_words.txt)0
-rw-r--r--reader/src/main/java/cz/crcs/ectester/reader/command/Command.java (renamed from src/cz/crcs/ectester/reader/command/Command.java)95
-rw-r--r--reader/src/main/java/cz/crcs/ectester/reader/output/FileTestWriter.java (renamed from src/cz/crcs/ectester/reader/output/FileTestWriter.java)0
-rw-r--r--reader/src/main/java/cz/crcs/ectester/reader/output/ResponseWriter.java (renamed from src/cz/crcs/ectester/reader/output/ResponseWriter.java)0
-rw-r--r--reader/src/main/java/cz/crcs/ectester/reader/output/TextTestWriter.java (renamed from src/cz/crcs/ectester/reader/output/TextTestWriter.java)4
-rw-r--r--reader/src/main/java/cz/crcs/ectester/reader/output/XMLTestWriter.java (renamed from src/cz/crcs/ectester/reader/output/XMLTestWriter.java)0
-rw-r--r--reader/src/main/java/cz/crcs/ectester/reader/output/YAMLTestWriter.java (renamed from src/cz/crcs/ectester/reader/output/YAMLTestWriter.java)0
-rw-r--r--reader/src/main/java/cz/crcs/ectester/reader/response/Response.java (renamed from src/cz/crcs/ectester/reader/response/Response.java)42
-rw-r--r--reader/src/main/java/cz/crcs/ectester/reader/test/CardCofactorSuite.java (renamed from src/cz/crcs/ectester/reader/test/CardCofactorSuite.java)16
-rw-r--r--reader/src/main/java/cz/crcs/ectester/reader/test/CardCompositeSuite.java (renamed from src/cz/crcs/ectester/reader/test/CardCompositeSuite.java)22
-rw-r--r--reader/src/main/java/cz/crcs/ectester/reader/test/CardCompressionSuite.java (renamed from src/cz/crcs/ectester/reader/test/CardCompressionSuite.java)41
-rw-r--r--reader/src/main/java/cz/crcs/ectester/reader/test/CardDefaultSuite.java (renamed from src/cz/crcs/ectester/reader/test/CardDefaultSuite.java)33
-rw-r--r--reader/src/main/java/cz/crcs/ectester/reader/test/CardDegenerateSuite.java (renamed from src/cz/crcs/ectester/reader/test/CardDegenerateSuite.java)16
-rw-r--r--reader/src/main/java/cz/crcs/ectester/reader/test/CardEdgeCasesSuite.java (renamed from src/cz/crcs/ectester/reader/test/CardEdgeCasesSuite.java)93
-rw-r--r--reader/src/main/java/cz/crcs/ectester/reader/test/CardInvalidSuite.java (renamed from src/cz/crcs/ectester/reader/test/CardInvalidSuite.java)16
-rw-r--r--reader/src/main/java/cz/crcs/ectester/reader/test/CardMiscSuite.java (renamed from src/cz/crcs/ectester/reader/test/CardMiscSuite.java)14
-rw-r--r--reader/src/main/java/cz/crcs/ectester/reader/test/CardSignatureSuite.java (renamed from src/cz/crcs/ectester/reader/test/CardSignatureSuite.java)12
-rw-r--r--reader/src/main/java/cz/crcs/ectester/reader/test/CardTestSuite.java (renamed from src/cz/crcs/ectester/reader/test/CardTestSuite.java)18
-rw-r--r--reader/src/main/java/cz/crcs/ectester/reader/test/CardTestVectorSuite.java (renamed from src/cz/crcs/ectester/reader/test/CardTestVectorSuite.java)38
-rw-r--r--reader/src/main/java/cz/crcs/ectester/reader/test/CardTwistSuite.java (renamed from src/cz/crcs/ectester/reader/test/CardTwistSuite.java)16
-rw-r--r--reader/src/main/java/cz/crcs/ectester/reader/test/CardWrongSuite.java (renamed from src/cz/crcs/ectester/reader/test/CardWrongSuite.java)73
-rw-r--r--reader/src/main/java/cz/crcs/ectester/reader/test/CommandTest.java (renamed from src/cz/crcs/ectester/reader/test/CommandTest.java)0
-rw-r--r--reader/src/main/java/cz/crcs/ectester/reader/test/CommandTestable.java (renamed from src/cz/crcs/ectester/reader/test/CommandTestable.java)0
-rw-r--r--reader/src/main/java/cz/crcs/ectester/reader/test/PerformanceTest.java (renamed from src/cz/crcs/ectester/reader/test/PerformanceTest.java)6
-rw-r--r--settings.gradle.kts12
-rw-r--r--standalone/build.gradle.kts62
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/ECTesterStandalone.java (renamed from src/cz/crcs/ectester/standalone/ECTesterStandalone.java)15
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/consts/Ident.java (renamed from src/cz/crcs/ectester/standalone/consts/Ident.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/consts/KeyAgreementIdent.java (renamed from src/cz/crcs/ectester/standalone/consts/KeyAgreementIdent.java)4
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/consts/KeyPairGeneratorIdent.java (renamed from src/cz/crcs/ectester/standalone/consts/KeyPairGeneratorIdent.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/consts/SignatureIdent.java (renamed from src/cz/crcs/ectester/standalone/consts/SignatureIdent.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/libs/BoringsslLib.java (renamed from src/cz/crcs/ectester/standalone/libs/BoringsslLib.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/libs/BotanLib.java (renamed from src/cz/crcs/ectester/standalone/libs/BotanLib.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/libs/BouncyCastleLib.java (renamed from src/cz/crcs/ectester/standalone/libs/BouncyCastleLib.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/libs/CryptoppLib.java (renamed from src/cz/crcs/ectester/standalone/libs/CryptoppLib.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/libs/ECLibrary.java (renamed from src/cz/crcs/ectester/standalone/libs/ECLibrary.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/libs/GcryptLib.java (renamed from src/cz/crcs/ectester/standalone/libs/GcryptLib.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/libs/IppcpLib.java (renamed from src/cz/crcs/ectester/standalone/libs/IppcpLib.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/libs/LibresslLib.java (renamed from src/cz/crcs/ectester/standalone/libs/LibresslLib.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/libs/MatrixsslLib.java (renamed from src/cz/crcs/ectester/standalone/libs/MatrixsslLib.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/libs/MbedTLSLib.java (renamed from src/cz/crcs/ectester/standalone/libs/MbedTLSLib.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/libs/MscngLib.java (renamed from src/cz/crcs/ectester/standalone/libs/MscngLib.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/libs/NativeECLibrary.java (renamed from src/cz/crcs/ectester/standalone/libs/NativeECLibrary.java)16
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/libs/NettleLib.java (renamed from src/cz/crcs/ectester/standalone/libs/NettleLib.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/libs/OpensslLib.java (renamed from src/cz/crcs/ectester/standalone/libs/OpensslLib.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/libs/ProviderECLibrary.java (renamed from src/cz/crcs/ectester/standalone/libs/ProviderECLibrary.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/libs/SunECLib.java (renamed from src/cz/crcs/ectester/standalone/libs/SunECLib.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/libs/TomcryptLib.java (renamed from src/cz/crcs/ectester/standalone/libs/TomcryptLib.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/libs/WolfCryptLib.java (renamed from src/cz/crcs/ectester/standalone/libs/WolfCryptLib.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/libs/jni/NativeECPrivateKey.java (renamed from src/cz/crcs/ectester/standalone/libs/jni/NativeECPrivateKey.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/libs/jni/NativeECPublicKey.java (renamed from src/cz/crcs/ectester/standalone/libs/jni/NativeECPublicKey.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/libs/jni/NativeKeyAgreementSpi.java (renamed from src/cz/crcs/ectester/standalone/libs/jni/NativeKeyAgreementSpi.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/libs/jni/NativeKeyPairGeneratorSpi.java (renamed from src/cz/crcs/ectester/standalone/libs/jni/NativeKeyPairGeneratorSpi.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/libs/jni/NativeProvider.java (renamed from src/cz/crcs/ectester/standalone/libs/jni/NativeProvider.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/libs/jni/NativeSignatureSpi.java (renamed from src/cz/crcs/ectester/standalone/libs/jni/NativeSignatureSpi.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/output/TextTestWriter.java (renamed from src/cz/crcs/ectester/standalone/output/TextTestWriter.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/output/XMLTestWriter.java (renamed from src/cz/crcs/ectester/standalone/output/XMLTestWriter.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/output/YAMLTestWriter.java (renamed from src/cz/crcs/ectester/standalone/output/YAMLTestWriter.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/test/base/KeyAgreementTest.java (renamed from src/cz/crcs/ectester/standalone/test/base/KeyAgreementTest.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/test/base/KeyAgreementTestable.java (renamed from src/cz/crcs/ectester/standalone/test/base/KeyAgreementTestable.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/test/base/KeyGeneratorTest.java (renamed from src/cz/crcs/ectester/standalone/test/base/KeyGeneratorTest.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/test/base/KeyGeneratorTestable.java (renamed from src/cz/crcs/ectester/standalone/test/base/KeyGeneratorTestable.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/test/base/PerformanceTest.java (renamed from src/cz/crcs/ectester/standalone/test/base/PerformanceTest.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/test/base/SignatureTest.java (renamed from src/cz/crcs/ectester/standalone/test/base/SignatureTest.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/test/base/SignatureTestable.java (renamed from src/cz/crcs/ectester/standalone/test/base/SignatureTestable.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/test/base/StandaloneTestable.java (renamed from src/cz/crcs/ectester/standalone/test/base/StandaloneTestable.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneCofactorSuite.java (renamed from src/cz/crcs/ectester/standalone/test/suites/StandaloneCofactorSuite.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneCompositeSuite.java (renamed from src/cz/crcs/ectester/standalone/test/suites/StandaloneCompositeSuite.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneDefaultSuite.java (renamed from src/cz/crcs/ectester/standalone/test/suites/StandaloneDefaultSuite.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneDegenerateSuite.java (renamed from src/cz/crcs/ectester/standalone/test/suites/StandaloneDegenerateSuite.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneEdgeCasesSuite.java (renamed from src/cz/crcs/ectester/standalone/test/suites/StandaloneEdgeCasesSuite.java)1
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneInvalidSuite.java (renamed from src/cz/crcs/ectester/standalone/test/suites/StandaloneInvalidSuite.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneMiscSuite.java (renamed from src/cz/crcs/ectester/standalone/test/suites/StandaloneMiscSuite.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandalonePerformanceSuite.java (renamed from src/cz/crcs/ectester/standalone/test/suites/StandalonePerformanceSuite.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneSignatureSuite.java (renamed from src/cz/crcs/ectester/standalone/test/suites/StandaloneSignatureSuite.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneTestSuite.java (renamed from src/cz/crcs/ectester/standalone/test/suites/StandaloneTestSuite.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneTestVectorSuite.java (renamed from src/cz/crcs/ectester/standalone/test/suites/StandaloneTestVectorSuite.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneTwistSuite.java (renamed from src/cz/crcs/ectester/standalone/test/suites/StandaloneTwistSuite.java)0
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneWrongSuite.java (renamed from src/cz/crcs/ectester/standalone/test/suites/StandaloneWrongSuite.java)3
-rw-r--r--standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/.clang-format (renamed from src/cz/crcs/ectester/standalone/libs/jni/.clang-format)0
-rw-r--r--standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/.gitignore (renamed from src/cz/crcs/ectester/standalone/libs/jni/.gitignore)2
-rw-r--r--standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/Makefile (renamed from src/cz/crcs/ectester/standalone/libs/jni/Makefile)13
-rwxr-xr-xstandalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/Makefile.bat (renamed from src/cz/crcs/ectester/standalone/libs/jni/Makefile.bat)326
-rw-r--r--standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/boringssl.c (renamed from src/cz/crcs/ectester/standalone/libs/jni/boringssl.c)0
-rw-r--r--standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/botan.cpp (renamed from src/cz/crcs/ectester/standalone/libs/jni/botan.cpp)0
-rw-r--r--standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/c_timing.c (renamed from src/cz/crcs/ectester/standalone/libs/jni/c_timing.c)0
-rw-r--r--standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/c_timing.h (renamed from src/cz/crcs/ectester/standalone/libs/jni/c_timing.h)0
-rw-r--r--standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/c_utils.c (renamed from src/cz/crcs/ectester/standalone/libs/jni/c_utils.c)0
-rw-r--r--standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/c_utils.h (renamed from src/cz/crcs/ectester/standalone/libs/jni/c_utils.h)0
-rw-r--r--standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/cpp_utils.cpp (renamed from src/cz/crcs/ectester/standalone/libs/jni/cpp_utils.cpp)0
-rw-r--r--standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/cpp_utils.hpp (renamed from src/cz/crcs/ectester/standalone/libs/jni/cpp_utils.hpp)0
-rw-r--r--standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/cryptopp.cpp (renamed from src/cz/crcs/ectester/standalone/libs/jni/cryptopp.cpp)0
-rw-r--r--standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/gcrypt.c (renamed from src/cz/crcs/ectester/standalone/libs/jni/gcrypt.c)0
-rw-r--r--standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/ippcp.c (renamed from src/cz/crcs/ectester/standalone/libs/jni/ippcp.c)0
-rw-r--r--standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/libressl.c (renamed from src/cz/crcs/ectester/standalone/libs/jni/libressl.c)0
-rw-r--r--standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/matrixssl.c (renamed from src/cz/crcs/ectester/standalone/libs/jni/matrixssl.c)0
-rw-r--r--standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/mbedtls.c (renamed from src/cz/crcs/ectester/standalone/libs/jni/mbedtls.c)0
-rw-r--r--standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/mscng.c (renamed from src/cz/crcs/ectester/standalone/libs/jni/mscng.c)2544
-rw-r--r--standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/native.h (renamed from src/cz/crcs/ectester/standalone/libs/jni/native.h)0
-rw-r--r--standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/nettle.c (renamed from src/cz/crcs/ectester/standalone/libs/jni/nettle.c)0
-rw-r--r--standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/openssl.c (renamed from src/cz/crcs/ectester/standalone/libs/jni/openssl.c)0
-rw-r--r--standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/tomcrypt.c (renamed from src/cz/crcs/ectester/standalone/libs/jni/tomcrypt.c)0
-rw-r--r--standalone/src/test/java/cz/crcs/ectester/reader/IdentTests.java14
644 files changed, 4298 insertions, 5723 deletions
diff --git a/.appveyor.yml b/.appveyor.yml
deleted file mode 100755
index 051d974..0000000
--- a/.appveyor.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-version: '{build}'
-image: Visual Studio 2017
-
-branches:
- except:
- - gh-pages
-
-environment:
- JAVA_HOME: C:\Program Files\Java\jdk1.8.0
-
-install:
- - cinst ant
- - git submodule update --init --recursive
-
-build_script:
- - ant -f build-applet.xml build
- - ant -f build-reader.xml package
- - ant -f build-standalone.xml package \ No newline at end of file
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..097f9f9
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,9 @@
+#
+# https://help.github.com/articles/dealing-with-line-endings/
+#
+# Linux start script should use lf
+/gradlew text eol=lf
+
+# These are Windows script files and should use crlf
+*.bat text eol=crlf
+
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 0000000..eb4b902
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,99 @@
+name: Build
+
+on:
+ push:
+ branches: [ "master" ]
+ pull_request:
+ branches: [ "master" ]
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+
+ strategy:
+ matrix:
+ java: [ "8", "11", "17", "21" ]
+ env:
+ JAVA_VERSION: ${{ matrix.java }}
+ name: Build Java ${{ matrix.java }}
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ submodules: recursive
+
+ - name: Set up JDK
+ uses: actions/setup-java@v4
+ with:
+ java-version: ${{ matrix.java }}
+ distribution: "temurin"
+
+ - name: Setup Gradle
+ uses: gradle/actions/setup-gradle@v3
+
+ - name: Setup libraries
+ run: |
+ sudo apt update
+ sudo apt install libmbedtls-dev libtomcrypt-dev libtommath-dev libssl-dev libcrypto++-dev libgcrypt20-dev nettle-dev libbotan-2-dev libwolfssl-dev nasm
+ echo "BORINGSSL_VERSION=$(git submodule status ext/boringssl | cut -f2 -d' ')" >> $GITHUB_ENV
+ echo "LIBRESSL_VERSION=$(git submodule status ext/libressl | cut -f2 -d' ')" >> $GITHUB_ENV
+ echo "IPPCP_VERSION=$(git submodule status ext/ipp-crypto | cut -f2 -d' ')" >> $GITHUB_ENV
+
+ - name: Build applets
+ run: if [ $JAVA_VERSION != 21 ]; then ./gradlew applet:buildJavaCard; fi
+
+ - name: Build reader
+ run: ./gradlew reader:uberJar
+
+ - name: Cache libs
+ uses: actions/cache@v4
+ id: cache-libs
+ with:
+ key: libs-${{ env.BORINGSSL_VERSION }}-${{ env.LIBRESSL_VERSION }}-${{ env.IPPCP_VERSION }}
+ path: |
+ ext/boringssl/build/crypto/libcrypto.so
+ ext/libressl/build/crypto/libcrypto.so
+ ext/ipp-crypto/build/.build/RELEASE/lib/libippcp.so
+
+ - name: Build libs
+ if: steps.cache-libs.outputs.cache-hit != 'true'
+ run: |
+ cd ext/boringssl
+ cmake -DBUILD_SHARED_LIBS=1 -Bbuild
+ cd build
+ make -j4 crypto
+ cd ../../..
+ cd ext/libressl
+ ./autogen.sh
+ cmake -DBUILD_SHARED_LIBS=ON -Bbuild
+ cd build
+ make -j4 crypto
+ cd ../../..
+ cd ext/ipp-crypto
+ CC=clang CXX=clang++ cmake CMakeLists.txt -Bbuild -DARCH=intel64
+ cd build
+ make -j4
+ cd ../../..
+
+ - name: Build standalone
+ run: |
+ ./gradlew standalone:libs || true
+ ./gradlew standalone:uberJar
+
+ # ffs: https://github.com/adoptium/adoptium-support/issues/485 !!!
+ - name: List libraries
+ run: env LD_LIBRARY_PATH="/usr/lib/x86_64-linux-gnu/" ./gradlew standalone:run --args="list-libs"
+
+ - name: Test
+ run: ./gradlew test
+
+ - name: Upload build artifacts
+ uses: actions/upload-artifact@v4
+ with:
+ name: built-${{ matrix.java }}
+ path: |
+ applet/build/javacard/*.cap
+ reader/build/libs/ECTesterReader.jar
+ standalone/build/libs/ECTesterStandalone.jar \ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 201c0f8..aa7fbd3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -40,3 +40,9 @@
# Python stuff
/util/__pycache__/
/util/.ipynb_checkpoints/
+
+# Ignore Gradle project-specific cache directory
+.gradle
+
+# Ignore Gradle build output directory
+build
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index be60ac9..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,63 +0,0 @@
-os: linux
-dist: bionic
-addons:
- apt:
- sources:
- - ubuntu-toolchain-r-test
- packages:
- - cmake
- - libmbedtls-dev
- - libtomcrypt-dev
- - libtommath-dev
- - libssl-dev
- - libcrypto++-dev
- - libgcrypt20-dev
- - nettle-dev
- - gcc-8
- - g++-8
-language: java
-jdk: openjdk8
-env:
- - CC=gcc-8 CXX=g++-8
-
-install:
- - eval "$(gimme 1.13)"
- - cd ext/boringssl
- - mkdir build
- - cd build
- - cmake -DBUILD_SHARED_LIBS=1 ..
- - make crypto
- - cd ../../..
- - cd ext/libressl
- - ./autogen.sh
- - mkdir build
- - cd build
- - cmake -DBUILD_SHARED_LIBS=ON ..
- - make crypto
- - cd ../../..
-
-script:
- - ant -f build-applet.xml build
- - ant -f build-reader.xml package
- - ant -f build-standalone.xml package
- - ./util/test.sh
-
-before_deploy:
- - zip "dist/ECTester.zip" "dist/ECTesterReader-dist.jar" "dist/ECTesterReader.jar" "applet/ectester221.cap" "applet/ectester222.cap" "dist/ECTesterStandalone-dist.jar" "dist/ECTesterStandalone.jar"
-
-deploy:
- provider: releases
- token:
- secure: q2aJvu32K+nfbMR60nFCEkn+jYCKprlCRlIoPjuRz1HySX233Ccwpx1CAdNzEjY6FDFcoReKAg6r5vdPjJ4FRPAQ23TxffIYZPkykL5K/pUZJbM5xkazJY0Fp8i6Vyl0JfeanVib1PTyOSugplhCttFk5nb9JUFV36Tre66XntOl5y80Trn94F5aTlRjfW26UH65W7Aa6WZ0N4OX/ZsX+vEOJPAu+RLfOq9oBOx/loB8ntYM/e/6bEwJp6EedRQLDsiS4NavP3svH+GXsPLs5p3soyRXYsvvGKVnVjcjZURxDDdxv5YuCWUUfl9PbNB+Mqmx/HQxl50BKoKFqwap1+TnlbuTAiWaXeh3zdXuGB+TPg8KE8h6ueDneHd3Lpivgq79IvPWIH+N4b3Pa952+rD+JKBZ807efB+97OtWrkQL7/sLZESQUdIszE724HHOiArKpNajIX+kN6NJdul5xFCiQQHG+O7iDFQBavCGM9fk63mZRyGPxZQzS06BV2vIIHg0yx3igN+OKKMFCH+P3hYR1zL6o65OlgbL1ifTZ18GDvmVRNdi53/fxQ2n/mQmI4tQpn4ZB7Ddoxx4GlpjFjzdKk/P9nKwng0M9wrp8row/vb5S+1aPwSxp9/4ASP9dkvLcNjTkWhmGPrWe+82Y9JPK47uesx0YeaVI2C7IR0=
- file:
- - "dist/ECTesterReader-dist.jar"
- - "dist/ECTesterReader.jar"
- - "applet/ectester221.cap"
- - "applet/ectester222.cap"
- - "dist/ECTesterStandalone-dist.jar"
- - "dist/ECTesterStandalone.jar"
- - "dist/ECTester.zip"
- cleanup: false
- on:
- tags: true
- repo: crocs-muni/ECTester
diff --git a/README.md b/README.md
index f0fa08f..8c1da32 100644
--- a/README.md
+++ b/README.md
@@ -1,15 +1,16 @@
# ![](docs/full.png)
-[![Build status](https://api.travis-ci.org/crocs-muni/ECTester.svg?branch=master)](https://travis-ci.org/crocs-muni/ECTester) [![Build status](https://ci.appveyor.com/api/projects/status/02kcaf52op89910u?svg=true)](https://ci.appveyor.com/project/J08nY/ectester-cm6ng) [![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/)
+[![Build](https://github.com/crocs-muni/ECTester/actions/workflows/build.yml/badge.svg)](https://github.com/crocs-muni/ECTester/actions/workflows/build.yml) [![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/)
-ECTester is a tool for testing and analysis of elliptic curve cryptography implementations on JavaCards and in cryptographic libraries. It consists of four separate parts:
+ECTester is a tool for testing and analysis of elliptic curve cryptography implementations on JavaCards and in
+cryptographic libraries. It consists of four separate parts:
- The ECTester applet, a JavaCard applet that provides the testing interface
- The ECTesterReader app, a reader app that works with the applet
- The ECTesterStandalone app, which works with software libraries
- Jupyter notebooks for analysis and visualization of data from the apps
-For more information on ECC support on JavaCards see the [github page](https://crocs-muni.github.io/ECTester/), with results, tables and docs.
+For more information on ECC support on JavaCards see the [GitHub page](https://crocs-muni.github.io/ECTester/), with results, tables and docs.
This project is developed by the [Centre for Research On Cryptography and Security](https://crocs.fi.muni.cz) at Faculty of Informatics, Masaryk University.
@@ -30,25 +31,26 @@ This project is developed by the [Centre for Research On Cryptography and Securi
## Setup
-ECTester uses Java 8 and ant. There are three parts of ECTester, the JavaCard applet used for testing, the reader app which controls it and the standalone app which tests software libraries. The target platform for ECTester is Linux, but things should work on Windows as well, although testing of standalone libraries will be limited to Java libraries and Microsoft CNG library.
+ECTester uses Gradle (and Gradle wrapper) for its build.
+There are three parts of ECTester, the JavaCard applet used for testing, the reader app which controls it and the
+standalone app which tests software libraries. The target platform for ECTester is Linux, but things should work on
+Windows as well, although testing of standalone libraries will be limited to Java libraries and Microsoft CNG library.
To build ECTester simply do:
```bash
git submodule update --init --recursive # To initialize submodules (JavaCard SDKs, Microsoft CNG, BoringSSL, ...)
-ant -f build-reader.xml package # To build the reader tool (jar) -> "dist/ECTesterReader.jar"
-ant -f build-standalone.xml package # To build the standalone tool (jar) -> "dist/ECTesterStandalone.jar"
-ant -f build-applet.xml build # To build the applet (cap) -> "applet/ectester.cap".
+./gradlew :applet:buildJavaCard # To build the applet (cap) -> "applet/build/javacard/applet[221,222,305].cap".
+./gradlew :reader:uberJar # To build the reader tool (jar) -> "reader/build/libs/ECTesterReader.jar"
+./gradlew :standalone:libs # To build the native library shims. (Necessary
+./gradlew :standalone:uberJar # To build the standalone tool (jar) -> "standalone/build/libs/ECTesterStandalone.jar"
```
-Build produces both a lightweight version of the JARs and a full version of the JARs with dependencies included, the latter has the `*-dist.jar` suffix.
+The applet comes in several flavors, targeting JavaCard `2.2.1`, `2.2.2` and `3.0.5`. The `2.2.2` and later flavors
+support extended length APDUs which are necessary for some commands to work properly.
-The applet comes in two flavors, targeting JavaCard 2.2.1 and 2.2.2. The 2.2.2 version supports extended length APDUs which are necessary for some commands to work properly. Use the `cap` ant property to specify which CAP file to build, either `ectester221.cap` or `ectester222.cap`.
-
-To build the 221 version do:
-```bash
-ant -f build-applet.xml build -Dcap=ectester221.cap
-```
-
-The `build-standalone.xml` ant build file invokes a Makefile (or a Makefile.bat on Windows) in `src/cz/crcs/ectester/standalone/libs/jni`, which tries to build the C/C++ shim libraries required for ECTester to test the actual native cryptographic libraries from Java. The Makefile uses pkg-config to locate the libraries installed, thus if non-standard location of the tested libraries is used, the Makefile or your pkg-config needs some changes to work.
+The `:standalone:libs` task invokes a Makefile in `src/cz/crcs/ectester/standalone/libs/jni`, which tries to build the
+C/C++ shim libraries required for ECTester to test the actual native cryptographic libraries from Java.
+The Makefile uses pkg-config to locate the libraries installed, thus if non-standard location of the tested libraries is
+used, the Makefile or your pkg-config needs some changes to work.
See the section on [setup](#setup-1) of standalone library testing for more details.
@@ -56,8 +58,8 @@ See the section on [setup](#setup-1) of standalone library testing for more deta
The JavaCard part of ECTester targets testing elliptic curve cryptography implementations in programmable smart cards of the JavaCard platform, version 2.2.1 and up. The reader app supports many actions, the main one being [testing](#test): the running of predetermined test suites that test the JavaCard for support, performance and vulnerabilities. The other actions focus on data collection, [generating keys](#generate), [signing data](#ecdsa), [performing key agreement](#ecdh) or [exporting the preset curves](#export), output of the mentioned actions can then be analyzed using the Jupyter notebooks, see [analysis](#analysis).
-1. Upload `applet/ectester.cap` using your favorite tool (e.g., [GlobalPlatformPro tool](https://github.com/martinpaljak/GlobalPlatform)) or the `build-applet.xml` ant file (target `upload` or `upload-emv`).
-2. Run `java -jar dist/ECTesterReader.jar -t` or other data collection commands.
+1. Upload `applet/build/applet/ectester[221,222,305].cap` using your favorite tool (e.g., [GlobalPlatformPro tool](https://github.com/martinpaljak/GlobalPlatform)).
+2. Run `java -jar reader/build/libs/ECTesterReader.jar -t` or other data collection commands.
3. Inspect output log with annotated results.
Following operations are tested in the default test suite, which is just a basic support test suite:
@@ -305,14 +307,24 @@ For more information on ECC libraries see [LIBS](docs/LIBS.md).
### Setup
-Simply doing `ant -f build-standalone.xml package` should build everything necessary to teste libraries via the standalone app, the sections below describe the details of how that works and what needs to be done if it doesn't.
+```shell
+./gradlew :standalone:libs # To build the native library shims. (Necessary
+./gradlew :standalone:uberJar # To build the standalone tool (jar) -> "standalone/build/libs/ECTesterStandalone.jar"
+```
+Simply doing the above should build everything necessary to test libraries via the standalone app,
+(except the BoringSSL, LibreSSL, ipp-crypto and MatrixSSL libraries)
+the sections below describe the details of how that works and what needs to be done if it doesn't.
-To see whether your build was sucessful, go to the `dist` directory, run:
-`java -jar ECTesterStandalone.jar list-libs` and observe if your target libraries are included in the output. If they are not, and they are native libraries, it means that either the shim library was not built successfully or that the actual native library couldn't be found and loaded on runtime. To solve the former, look for build errors during the ant run in the `libs-try` step, for the latter, if the library is in an non-standard location specifying `LD_LIBRARY_PATH` will help load it. Consulting the next sections should help solve both.
+To see whether your build was successful, run:
+`java -jar standalone/build/libs/ECTesterStandalone.jar list-libs` and observe if your target libraries are included in
+the output. If they are not, and they are native libraries, it means that either the shim library was not built
+successfully or that the actual native library couldn't be found and loaded on runtime. To solve the former, look for
+build errors during the ant run in the `libs-try` step, for the latter, if the library is in an non-standard location
+specifying `LD_LIBRARY_PATH` will help load it. Consulting the next sections should help solve both.
#### Native
-ECTester interfaces with native libraries by using custom shim libraries that expose the functionality via the [Java Native Interface](https://en.wikipedia.org/wiki/Java_Native_Interface), these can be found in the [src/cz/crcs/ectester/standalone/libs/jni](src/cz/crcs/ectester/standalone/libs/jni) directory along with a Makefile (Makefile.bat for Windows). The shim library will depend on the native library, and have a name like `boringssl_provider.so`, `botan_provider.so`, `cryptopp_provider.so` and `openssl_provider.so`. The Makefile has a target for every library that it supports that builds its shim, see the `help` target for more info. The Makefile is automatically ran when the `build-standalone.xml` ant build is triggered, so if all is setup correctly, you do not need to deal with the Makefile while building.
+ECTester interfaces with native libraries by using custom shim libraries that expose the functionality via the [Java Native Interface](https://en.wikipedia.org/wiki/Java_Native_Interface), these can be found in the [src/cz/crcs/ectester/standalone/libs/jni](src/cz/crcs/ectester/standalone/libs/jni) directory along with a Makefile (Makefile.bat for Windows). The shim library will depend on the native library, and have a name like `boringssl_provider.so`, `botan_provider.so`, `cryptopp_provider.so` and `openssl_provider.so`. The Makefile has a target for every library that it supports that builds its shim, see the `help` target for more info. The Makefile is automatically ran when the `:standalone:libs` gradle task is triggered, so if all is setup correctly, you do not need to deal with the Makefile while building.
There are two important environmental variables that should be set in your environment. First, you should set `JAVA_HOME` which should point to your JDK. The tooling uses `JAVA_HOME` to locate native Java library headers, like `jni.h`. Second, ECTester uses pkg-config to locate the native libraries, if your pkg-config files are in an unusual place the pkg-config command would not find them by default, you should set `PKG_CONFIG_PATH` to the directory containing the `*.pc` files. If pkg-config files are unavailable for the library you are trying to test, you will need to change the Makefile manually to apply the correct options to the commands (CFLAGS, include options, linker options...).
@@ -348,9 +360,8 @@ BoringSSL, LibreSSL and ipp-crypto are included as git submodules. Make sure you
after checking out the ECTester repository to initialize them. To build BoringSSL do:
```
cd ext/boringssl
-mkdir build
+cmake -GNinja -Bbuild -DBUILD_SHARED_LIBS=1
cd build
-cmake -GNinja -DBUILD_SHARED_LIBS=1 ..
ninja
```
@@ -358,9 +369,8 @@ To build LibreSSL do:
```
cd ext/libressl
./autogen.sh
-mkdir build
+cmake -GNinja -Bbuild -DBUILD_SHARED_LIBS=1
cd build
-cmake -GNinja -DBUILD_SHARED_LIBS=1 ..
ninja
```
@@ -376,7 +386,7 @@ ninja
#### Java
-OpenJDK JRE is required to test ECDH on Windows properly, as Oracle JRE requires the Java Cryptography Providers
+OpenJDK JRE is required to test ECDH on Windows properly, as Oracle JRE requires the Java Cryptography Providers
for certain classes (such as a [KeyAgreement](https://docs.oracle.com/javase/8/docs/api/javax/crypto/KeyAgreement.html))
to be signed by keys that are signed by their JCA Code Signing Authority. ECTester internally uses Java Cryptography Provider
API to expose and test native libraries. OpenJDK for Windows can be obtained from [ojdkbuild/ojdkbuild](https://github.com/ojdkbuild/ojdkbuild).
@@ -493,7 +503,7 @@ Snippet below shows how the `list-libs` command for well, listing currently supp
Snippet below demonstrates generation of 1000 (`-n`) keys on the named curve `secp256r1` (`-nc`) using the BouncyCastle library.
```
-> java -jar ECTesterStandalone.jar gen -n 1000 -nc secg/secp256r1 Bouncy
+> java -jar ECTesterStandalone.jar generate -n 1000 -nc secg/secp256r1 Bouncy
index;time[nano];pubW;privS
0;18459241;04886c2d253490d6a80906628aea65dc6763fe53690241d54de1f479f44d120e6349528644b3736eda0a8a0326563c3a846a415e1ff029a22404718c91770349d4;532e9b01e439df0ae63f7ed0a9c5f57f91175fd21d80a1d048c93fda7b704522
1;1672835;049de329ce6d7d031a693143890ea7a277c0cb400b534b3a075614a1ec7d0b1e1680bd6791bb5027007ea286aa86a3af451e6772440be0adb3b19d249a47f8581e;00d69151b165880f93d18b4870b613e012ff00883192cd405d1fccd23e9001f9cc
diff --git a/applet/GPPcScConnectionPlugin.dll b/applet/GPPcScConnectionPlugin.dll
deleted file mode 100644
index 3b27f6b..0000000
--- a/applet/GPPcScConnectionPlugin.dll
+++ /dev/null
Binary files differ
diff --git a/applet/GPShell.exe b/applet/GPShell.exe
deleted file mode 100644
index 091eece..0000000
--- a/applet/GPShell.exe
+++ /dev/null
Binary files differ
diff --git a/applet/GlobalPlatform.dll b/applet/GlobalPlatform.dll
deleted file mode 100644
index 6dca172..0000000
--- a/applet/GlobalPlatform.dll
+++ /dev/null
Binary files differ
diff --git a/applet/build.gradle.kts b/applet/build.gradle.kts
new file mode 100644
index 0000000..5380bae
--- /dev/null
+++ b/applet/build.gradle.kts
@@ -0,0 +1,156 @@
+// Buildscript configuration for the javacard-gradle plugin.
+// Do not modify this particular block. Dependencies for the project are lower.
+buildscript {
+ repositories {
+ mavenCentral()
+ maven("https://javacard.pro/maven")
+ maven("https://deadcode.me/mvn")
+ }
+ dependencies {
+ classpath("com.klinec:gradle-javacard:1.8.0")
+ }
+}
+
+plugins {
+ id("com.klinec.gradle.javacard") version "1.8.0"
+ id("java")
+}
+
+// Common settings, definitions
+val rootPath = rootDir.absolutePath
+val libs = "$rootPath/ext/libs"
+val libsSdk = "$rootPath/ext/sdks"
+
+// Repositories for your project
+repositories {
+ mavenCentral()
+ // mavenLocal() // for local maven repository if needed
+
+ // Repository with JCardSim, Globalplatform, etc, ...
+ maven("https://javacard.pro/maven")
+ maven("https://deadcode.me/mvn")
+
+ // Local lib repository
+ flatDir {
+ dirs(libs)
+ }
+}
+
+// Dependencies for your project
+dependencies {
+ jcardsim("com.klinec:jcardsim:3.0.5.11")
+ implementation("com.klinec:jcardsim:3.0.5.11")
+
+ testImplementation(platform("org.junit:junit-bom:5.10.2"))
+ testImplementation("org.junit.jupiter:junit-jupiter")
+ testRuntimeOnly("org.junit.platform:junit-platform-launcher")
+
+ // Include plugin as it has bundled GP & other tools.
+ // Alternative: include GP manually, but the included
+ // version has to be compatible with the plugin.
+ runtimeOnly("com.klinec:gradle-javacard:1.8.0")
+}
+
+tasks.named<Test>("test") {
+ useJUnitPlatform()
+}
+
+// JavaCard SDKs and libraries
+val sdks = mapOf(
+ "JC211" to Triple("$libsSdk/jc211_kit", JavaVersion.VERSION_1_8, JavaVersion.VERSION_1_8),
+ "JC212" to Triple("$libsSdk/jc212_kit", JavaVersion.VERSION_1_8, JavaVersion.VERSION_1_8),
+ "JC221" to Triple("$libsSdk/jc221_kit", JavaVersion.VERSION_1_8, JavaVersion.VERSION_1_8),
+ "JC222" to Triple("$libsSdk/jc222_kit", JavaVersion.VERSION_1_8, JavaVersion.VERSION_1_8),
+ "JC303" to Triple("$libsSdk/jc303_kit", JavaVersion.VERSION_1_8, JavaVersion.VERSION_11),
+ "JC304" to Triple("$libsSdk/jc304_kit", JavaVersion.VERSION_1_8, JavaVersion.VERSION_11),
+ "JC305u2" to Triple("$libsSdk/jc305u2_kit", JavaVersion.VERSION_1_8, JavaVersion.VERSION_11),
+ "JC305u3" to Triple("$libsSdk/jc305u3_kit", JavaVersion.VERSION_1_8, JavaVersion.VERSION_11),
+ "JC305u4" to Triple("$libsSdk/jc305u4_kit", JavaVersion.VERSION_1_8, JavaVersion.VERSION_11),
+ "JC310b43" to Triple("$libsSdk/jc310b43_kit", JavaVersion.VERSION_1_8, JavaVersion.VERSION_17),
+ "JC310r20210706" to Triple("$libsSdk/jc310r20210706_kit", JavaVersion.VERSION_1_8, JavaVersion.VERSION_17),
+ "JC320v24" to Triple("$libsSdk/jc320v24.0_kit", JavaVersion.VERSION_1_8, JavaVersion.VERSION_17),
+)
+
+var pkgAID = "4543546573746572"
+var version = "0.3.3"
+
+javacard {
+ config {
+ // Using custom repo with jcardsim
+ debugGpPro(true)
+ addImplicitJcardSim(false)
+ addImplicitJcardSimJunit(false)
+
+ if (JavaVersion.current() == JavaVersion.VERSION_1_8) {
+ /*
+ // Exclude for the time being, as the "excludes" param is not properly implemented upstream.
+ // https://github.com/ph4r05/javacard-gradle-plugin/pull/11
+ cap {
+ jckit(sdks["JC221"]!!.first)
+ packageName("cz.crcs.ectester.applet")
+ version(version)
+ aid(pkgAID)
+ output("applet221.cap")
+
+ //excludes("ECTesterAppletExtended.*")
+
+ applet {
+ className("cz.crcs.ectester.applet.ECTesterApplet")
+ aid("454354657374657230333320323231")
+ }
+ }
+ */
+
+ cap {
+ jckit(sdks["JC222"]!!.first)
+ packageName("cz.crcs.ectester.applet")
+ version(version)
+ aid(pkgAID)
+ output("applet222.cap")
+
+ //excludes("ECTesterApplet.*")
+
+ applet {
+ className("cz.crcs.ectester.applet.ECTesterAppletExtended")
+ aid("454354657374657230333320323232")
+ }
+ }
+ }
+
+ if (JavaVersion.current() >= JavaVersion.VERSION_1_8 && JavaVersion.current() <= JavaVersion.VERSION_11) {
+ cap {
+ jckit(sdks["JC305u4"]!!.first)
+ packageName("cz.crcs.ectester.applet")
+ version(version)
+ aid(pkgAID)
+ output("applet305.cap")
+
+ //excludes("ECTesterApplet.*")
+
+ applet {
+ className("cz.crcs.ectester.applet.ECTesterAppletExtended")
+ aid("454354657374657230333320323035")
+ }
+ }
+ }
+
+ if (JavaVersion.current() > JavaVersion.VERSION_11) {
+ // This really only works for Java <= 17, but if the check is added, then configuration
+ // of the project will not work for Java > 17.
+ cap {
+ jckit(sdks["JC320v24"]!!.first)
+ packageName("cz.crcs.ectester.applet")
+ version(version)
+ aid(pkgAID)
+ output("applet320.cap")
+
+ //excludes("ECTesterApplet.*")
+
+ applet {
+ className("cz.crcs.ectester.applet.ECTesterAppletExtended")
+ aid("454354657374657230333320323230")
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/applet/gp.exe b/applet/gp.exe
deleted file mode 100644
index 6478bf2..0000000
--- a/applet/gp.exe
+++ /dev/null
Binary files differ
diff --git a/applet/gp.jar b/applet/gp.jar
deleted file mode 100644
index 774d81a..0000000
--- a/applet/gp.jar
+++ /dev/null
Binary files differ
diff --git a/applet/gppro_upload.bat b/applet/gppro_upload.bat
deleted file mode 100644
index 50a41d7..0000000
--- a/applet/gppro_upload.bat
+++ /dev/null
@@ -1,14 +0,0 @@
-if "%1" == "" {
- set err=yes
-}
-if "%2" == "" {
- set err=yes
-}
-if "%err" == "yes" {
- echo "gppro_upload.bat <AID> <CAP file>"
- exit
-}
-gp.exe -deletedeps -verbose -delete %1
-gp.exe -install %2 -verbose -d
-
-
diff --git a/applet/gppro_upload.sh b/applet/gppro_upload.sh
deleted file mode 100755
index 055d51d..0000000
--- a/applet/gppro_upload.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/usr/bin/env bash
-if [ "$#" -ne 2 ]; then
- echo "gppro_upload.sh <AID> <CAP file>" >&2
- exit 1
-fi
-
-java -jar gp.jar -deletedeps -verbose -delete $1
-java -jar gp.jar -install $2 -verbose -d
-
-
diff --git a/applet/gppro_upload_emv.bat b/applet/gppro_upload_emv.bat
deleted file mode 100644
index 4094623..0000000
--- a/applet/gppro_upload_emv.bat
+++ /dev/null
@@ -1,15 +0,0 @@
-if "%1" == "" {
- set err=yes
-}
-if "%2" == "" {
- set err=yes
-}
-if "%err" == "yes" {
- echo "gppro_upload_emv.bat <AID> <CAP file>"
- exit
-}
-
-gp.exe -deletedeps -verbose -emv -delete %1
-gp.exe -install %2 -verbose -emv -d
-
-
diff --git a/applet/gppro_upload_emv.sh b/applet/gppro_upload_emv.sh
deleted file mode 100755
index 9e1a62e..0000000
--- a/applet/gppro_upload_emv.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/usr/bin/env bash
-if [ "$#" -ne 2 ]; then
- echo "gppro_upload.sh <AID> <CAP file>" >&2
- exit 1
-fi
-
-java -jar gp.jar --deletedeps --verbose -emv --delete $1
-java -jar gp.jar --install $2 --verbose --emv -d
-
-
diff --git a/applet/libeay32.dll b/applet/libeay32.dll
deleted file mode 100644
index b59a6b4..0000000
--- a/applet/libeay32.dll
+++ /dev/null
Binary files differ
diff --git a/applet/openkms-gp.jar b/applet/openkms-gp.jar
deleted file mode 100644
index 9cd5de5..0000000
--- a/applet/openkms-gp.jar
+++ /dev/null
Binary files differ
diff --git a/src/cz/crcs/ectester/applet/AppletBase.java b/applet/src/main/java/cz/crcs/ectester/applet/AppletBase.java
index 9a8a479..411e5a1 100644
--- a/src/cz/crcs/ectester/applet/AppletBase.java
+++ b/applet/src/main/java/cz/crcs/ectester/applet/AppletBase.java
@@ -11,70 +11,6 @@ import javacard.security.*;
* @author Jan Jancar johny@neuromancer.sk
*/
public abstract class AppletBase extends Applet {
-
- // MAIN INSTRUCTION CLASS
- public static final byte CLA_ECTESTERAPPLET = (byte) 0xB0;
-
- // INSTRUCTIONS
- public static final byte INS_ALLOCATE = (byte) 0x5a;
- public static final byte INS_CLEAR = (byte) 0x5b;
- public static final byte INS_SET = (byte) 0x5c;
- public static final byte INS_TRANSFORM = (byte) 0x5d;
- public static final byte INS_GENERATE = (byte) 0x5e;
- public static final byte INS_EXPORT = (byte) 0x5f;
- public static final byte INS_ECDH = (byte) 0x70;
- public static final byte INS_ECDH_DIRECT = (byte) 0x71;
- public static final byte INS_ECDSA = (byte) 0x72;
- public static final byte INS_ECDSA_SIGN = (byte) 0x73;
- public static final byte INS_ECDSA_VERIFY = (byte) 0x74;
- public static final byte INS_CLEANUP = (byte) 0x75;
- public static final byte INS_ALLOCATE_KA = (byte) 0x76;
- public static final byte INS_ALLOCATE_SIG = (byte) 0x77;
- public static final byte INS_GET_INFO = (byte) 0x78;
- public static final byte INS_SET_DRY_RUN_MODE = (byte) 0x79;
- public static final byte INS_BUFFER = (byte) 0x7a;
- public static final byte INS_PERFORM = (byte) 0x7b;
-
- // PARAMETERS for P1 and P2
- public static final byte KEYPAIR_LOCAL = (byte) 0x01;
- public static final byte KEYPAIR_REMOTE = (byte) 0x02;
- public static final byte KEYPAIR_BOTH = KEYPAIR_LOCAL | KEYPAIR_REMOTE;
- public static final byte BUILD_KEYPAIR = (byte) 0x01;
- public static final byte BUILD_KEYBUILDER = (byte) 0x02;
- public static final byte EXPORT_TRUE = (byte) 0xff;
- public static final byte EXPORT_FALSE = (byte) 0x00;
- public static final byte MODE_NORMAL = (byte) 0xaa;
- public static final byte MODE_DRY_RUN = (byte) 0xbb;
-
- // STATUS WORDS
- public static final short SW_SIG_VERIFY_FAIL = (short) 0x0ee1;
- public static final short SW_DH_DHC_MISMATCH = (short) 0x0ee2;
- public static final short SW_KEYPAIR_NULL = (short) 0x0ee3;
- public static final short SW_KA_NULL = (short) 0x0ee4;
- public static final short SW_SIGNATURE_NULL = (short) 0x0ee5;
- public static final short SW_OBJECT_NULL = (short) 0x0ee6;
- public static final short SW_CANNOT_FIT = (short) 0x0ee7;
- public static final short SW_Exception = (short) 0xff01;
- public static final short SW_ArrayIndexOutOfBoundsException = (short) 0xff02;
- public static final short SW_ArithmeticException = (short) 0xff03;
- public static final short SW_ArrayStoreException = (short) 0xff04;
- public static final short SW_NullPointerException = (short) 0xff05;
- public static final short SW_NegativeArraySizeException = (short) 0xff06;
- public static final short SW_CryptoException_prefix = (short) 0xf100;
- public static final short SW_SystemException_prefix = (short) 0xf200;
- public static final short SW_PINException_prefix = (short) 0xf300;
- public static final short SW_TransactionException_prefix = (short) 0xf400;
- public static final short SW_CardRuntimeException_prefix = (short) 0xf500;
-
- //
- public static final short BASE_221 = (short) 0x0221;
- public static final short BASE_222 = (short) 0x0222;
-
- //
- public static final short CDATA_BASIC = (short) 5;
- public static final short CDATA_EXTENDED = (short) 7;
-
- //
public static final byte[] VERSION = {'v', '0', '.', '3', '.', '3'};
public static final short ARRAY_LENGTH = 0x100;
@@ -171,12 +107,12 @@ public abstract class AppletBase extends Applet {
return;
}
- if (cla == CLA_ECTESTERAPPLET) {
+ if (cla == CardConsts.CLA_ECTESTERAPPLET) {
try {
- if (ins == INS_BUFFER) {
+ if (ins == CardConsts.INS_BUFFER) {
short read = readAPDU(apdu, true);
if (read == -1) {
- ISOException.throwIt(SW_CANNOT_FIT);
+ ISOException.throwIt(CardConsts.SW_CANNOT_FIT);
return;
}
apduEnd += read;
@@ -184,12 +120,12 @@ public abstract class AppletBase extends Applet {
return;
} else {
apduEnd = 0;
- if (ins == INS_PERFORM) {
+ if (ins == CardConsts.INS_PERFORM) {
ins = apduArray[ISO7816.OFFSET_INS];
apdu.setIncomingAndReceive();
} else {
if (readAPDU(apdu, false) == -1) {
- ISOException.throwIt(SW_CANNOT_FIT);
+ ISOException.throwIt(CardConsts.SW_CANNOT_FIT);
return;
}
}
@@ -197,52 +133,52 @@ public abstract class AppletBase extends Applet {
short length = 0;
switch (ins) {
- case INS_ALLOCATE_KA:
+ case CardConsts.INS_ALLOCATE_KA:
length = insAllocateKA(apdu);
break;
- case INS_ALLOCATE_SIG:
+ case CardConsts.INS_ALLOCATE_SIG:
length = insAllocateSig(apdu);
break;
- case INS_ALLOCATE:
+ case CardConsts.INS_ALLOCATE:
length = insAllocate(apdu);
break;
- case INS_CLEAR:
+ case CardConsts.INS_CLEAR:
length = insClear(apdu);
break;
- case INS_SET:
+ case CardConsts.INS_SET:
length = insSet(apdu);
break;
- case INS_TRANSFORM:
+ case CardConsts.INS_TRANSFORM:
length = insTransform(apdu);
break;
- case INS_GENERATE:
+ case CardConsts.INS_GENERATE:
length = insGenerate(apdu);
break;
- case INS_EXPORT:
+ case CardConsts.INS_EXPORT:
length = insExport(apdu);
break;
- case INS_ECDH:
+ case CardConsts.INS_ECDH:
length = insECDH(apdu);
break;
- case INS_ECDH_DIRECT:
+ case CardConsts.INS_ECDH_DIRECT:
length = insECDH_direct(apdu);
break;
- case INS_ECDSA:
+ case CardConsts.INS_ECDSA:
length = insECDSA(apdu);
break;
- case INS_ECDSA_SIGN:
+ case CardConsts.INS_ECDSA_SIGN:
length = insECDSA_sign(apdu);
break;
- case INS_ECDSA_VERIFY:
+ case CardConsts.INS_ECDSA_VERIFY:
length = insECDSA_verify(apdu);
break;
- case INS_CLEANUP:
+ case CardConsts.INS_CLEANUP:
length = insCleanup(apdu);
break;
- case INS_GET_INFO:
+ case CardConsts.INS_GET_INFO:
length = insGetInfo(apdu);
break;
- case INS_SET_DRY_RUN_MODE:
+ case CardConsts.INS_SET_DRY_RUN_MODE:
length = insSetDryRunMode(apdu);
break;
default:
@@ -255,27 +191,27 @@ public abstract class AppletBase extends Applet {
} catch (ISOException e) {
throw e; // Our exception from code, just re-emit
} catch (ArrayIndexOutOfBoundsException e) {
- ISOException.throwIt(SW_ArrayIndexOutOfBoundsException);
+ ISOException.throwIt(CardConsts.SW_ArrayIndexOutOfBoundsException);
} catch (ArithmeticException e) {
- ISOException.throwIt(SW_ArithmeticException);
+ ISOException.throwIt(CardConsts.SW_ArithmeticException);
} catch (ArrayStoreException e) {
- ISOException.throwIt(SW_ArrayStoreException);
+ ISOException.throwIt(CardConsts.SW_ArrayStoreException);
} catch (NullPointerException e) {
- ISOException.throwIt(SW_NullPointerException);
+ ISOException.throwIt(CardConsts.SW_NullPointerException);
} catch (NegativeArraySizeException e) {
- ISOException.throwIt(SW_NegativeArraySizeException);
+ ISOException.throwIt(CardConsts.SW_NegativeArraySizeException);
} catch (CryptoException e) {
- ISOException.throwIt((short) (SW_CryptoException_prefix | e.getReason()));
+ ISOException.throwIt((short) (CardConsts.SW_CryptoException_prefix | e.getReason()));
} catch (SystemException e) {
- ISOException.throwIt((short) (SW_SystemException_prefix | e.getReason()));
+ ISOException.throwIt((short) (CardConsts.SW_SystemException_prefix | e.getReason()));
} catch (PINException e) {
- ISOException.throwIt((short) (SW_PINException_prefix | e.getReason()));
+ ISOException.throwIt((short) (CardConsts.SW_PINException_prefix | e.getReason()));
} catch (TransactionException e) {
- ISOException.throwIt((short) (SW_TransactionException_prefix | e.getReason()));
+ ISOException.throwIt((short) (CardConsts.SW_TransactionException_prefix | e.getReason()));
} catch (CardRuntimeException e) {
- ISOException.throwIt((short) (SW_CardRuntimeException_prefix | e.getReason()));
+ ISOException.throwIt((short) (CardConsts.SW_CardRuntimeException_prefix | e.getReason()));
} catch (Exception e) {
- ISOException.throwIt(SW_Exception);
+ ISOException.throwIt(CardConsts.SW_Exception);
}
} else ISOException.throwIt(ISO7816.SW_CLA_NOT_SUPPORTED);
@@ -293,9 +229,9 @@ public abstract class AppletBase extends Applet {
short offset = 0;
if (skipHeader) {
offset = cdataOffset;
- cdata = CDATA_EXTENDED;
+ cdata = CardConsts.CDATA_EXTENDED;
} else {
- cdata = CDATA_BASIC;
+ cdata = CardConsts.CDATA_BASIC;
}
/* How much stuff was really sent in this APDU? */
@@ -380,10 +316,10 @@ public abstract class AppletBase extends Applet {
byte keyPair = apduArray[ISO7816.OFFSET_P1];
short len = 0;
- if ((keyPair & KEYPAIR_LOCAL) != 0) {
+ if ((keyPair & CardConsts.KEYPAIR_LOCAL) != 0) {
len += clear(localKeypair, apdu.getBuffer(), (short) 0);
}
- if ((keyPair & KEYPAIR_REMOTE) != 0) {
+ if ((keyPair & CardConsts.KEYPAIR_REMOTE) != 0) {
len += clear(remoteKeypair, apdu.getBuffer(), len);
}
@@ -411,10 +347,10 @@ public abstract class AppletBase extends Applet {
short len = 0;
- if ((keyPair & KEYPAIR_LOCAL) != 0) {
+ if ((keyPair & CardConsts.KEYPAIR_LOCAL) != 0) {
len += set(localKeypair, curve, params, apduArray, (short) (cdata + 2), apdu.getBuffer(), (short) 0);
}
- if ((keyPair & KEYPAIR_REMOTE) != 0) {
+ if ((keyPair & CardConsts.KEYPAIR_REMOTE) != 0) {
len += set(remoteKeypair, curve, params, apduArray, (short) (cdata + 2), apdu.getBuffer(), len);
}
@@ -438,11 +374,11 @@ public abstract class AppletBase extends Applet {
short transformation = Util.getShort(apduArray, (short) (cdata + 2));
short len = 0;
- if ((keyPair & KEYPAIR_LOCAL) != 0) {
+ if ((keyPair & CardConsts.KEYPAIR_LOCAL) != 0) {
len += transform(localKeypair, key, params, transformation, apdu.getBuffer(), (short) 0);
}
- if ((keyPair & KEYPAIR_REMOTE) != 0) {
+ if ((keyPair & CardConsts.KEYPAIR_REMOTE) != 0) {
len += transform(remoteKeypair, key, params, transformation, apdu.getBuffer(), len);
}
@@ -461,10 +397,10 @@ public abstract class AppletBase extends Applet {
byte keyPair = apduArray[ISO7816.OFFSET_P1];
short len = 0;
- if ((keyPair & KEYPAIR_LOCAL) != 0) {
+ if ((keyPair & CardConsts.KEYPAIR_LOCAL) != 0) {
len += generate(localKeypair, apdu.getBuffer(), (short) 0);
}
- if ((keyPair & KEYPAIR_REMOTE) != 0) {
+ if ((keyPair & CardConsts.KEYPAIR_REMOTE) != 0) {
len += generate(remoteKeypair, apdu.getBuffer(), len);
}
@@ -485,13 +421,13 @@ public abstract class AppletBase extends Applet {
short params = Util.getShort(apduArray, cdata);
short swOffset = 0;
- short len = (short) (keyPair == KEYPAIR_BOTH ? 4 : 2);
+ short len = (short) (keyPair == CardConsts.KEYPAIR_BOTH ? 4 : 2);
- if ((keyPair & KEYPAIR_LOCAL) != 0) {
+ if ((keyPair & CardConsts.KEYPAIR_LOCAL) != 0) {
len += export(localKeypair, key, params, apdu.getBuffer(), swOffset, len);
swOffset += 2;
}
- if ((keyPair & KEYPAIR_REMOTE) != 0) {
+ if ((keyPair & CardConsts.KEYPAIR_REMOTE) != 0) {
len += export(remoteKeypair, key, params, apdu.getBuffer(), swOffset, len);
}
@@ -557,10 +493,10 @@ public abstract class AppletBase extends Applet {
byte sigType = apduArray[cdata];
short len = 0;
- if ((keyPair & KEYPAIR_LOCAL) != 0) {
+ if ((keyPair & CardConsts.KEYPAIR_LOCAL) != 0) {
len += ecdsa(localKeypair, sigType, export, apduArray, (short) (cdata + 1), apdu.getBuffer(), (short) 0);
}
- if ((keyPair & KEYPAIR_REMOTE) != 0) {
+ if ((keyPair & CardConsts.KEYPAIR_REMOTE) != 0) {
len += ecdsa(remoteKeypair, sigType, export, apduArray, (short) (cdata + 1), apdu.getBuffer(), len);
}
@@ -581,10 +517,10 @@ public abstract class AppletBase extends Applet {
byte sigType = apduArray[cdata];
short len = 0;
- if ((keyPair & KEYPAIR_LOCAL) != 0) {
+ if ((keyPair & CardConsts.KEYPAIR_LOCAL) != 0) {
len += ecdsa_sign(localKeypair, sigType, export, apduArray, (short) (cdata + 1), apdu.getBuffer(), (short) 0);
}
- if ((keyPair & KEYPAIR_REMOTE) != 0) {
+ if ((keyPair & CardConsts.KEYPAIR_REMOTE) != 0) {
len += ecdsa_sign(remoteKeypair, sigType, export, apduArray, (short) (cdata + 1), apdu.getBuffer(), len);
}
return len;
@@ -604,10 +540,10 @@ public abstract class AppletBase extends Applet {
byte sigType = apduArray[ISO7816.OFFSET_P2];
short len = 0;
- if ((keyPair & KEYPAIR_LOCAL) != 0) {
+ if ((keyPair & CardConsts.KEYPAIR_LOCAL) != 0) {
len += ecdsa_verify(localKeypair, sigType, apduArray, cdata, apdu.getBuffer(), (short) 0);
}
- if ((keyPair & KEYPAIR_REMOTE) != 0) {
+ if ((keyPair & CardConsts.KEYPAIR_REMOTE) != 0) {
len += ecdsa_verify(remoteKeypair, sigType, apduArray, cdata, apdu.getBuffer(), len);
}
return len;
@@ -649,10 +585,10 @@ public abstract class AppletBase extends Applet {
byte mode = apduArray[ISO7816.OFFSET_P1];
short len = 0;
- if (mode == MODE_NORMAL) {
+ if (mode == CardConsts.MODE_NORMAL) {
len = setDryRunMode(apdubuf, false, (short) 0);
}
- if (mode == MODE_DRY_RUN) {
+ if (mode == CardConsts.MODE_DRY_RUN) {
len = setDryRunMode(apdubuf, true, (short) 0);
}
return len;
@@ -669,26 +605,26 @@ public abstract class AppletBase extends Applet {
*/
private short allocate(byte keyPair, byte build, short keyLength, byte keyClass, byte[] outBuffer, short outOffset) {
short length = 0;
- if ((keyPair & KEYPAIR_LOCAL) != 0) {
- if ((build & BUILD_KEYPAIR) != 0) {
+ if ((keyPair & CardConsts.KEYPAIR_LOCAL) != 0) {
+ if ((build & CardConsts.BUILD_KEYPAIR) != 0) {
localKeypair = keyGenerator.allocatePair(keyClass, keyLength);
- if (keyGenerator.getSW() != ISO7816.SW_NO_ERROR && (build & BUILD_KEYBUILDER) != 0) {
+ if (keyGenerator.getSW() != ISO7816.SW_NO_ERROR && (build & CardConsts.BUILD_KEYBUILDER) != 0) {
localKeypair = keyGenerator.constructPair(keyClass, keyLength);
}
- } else if ((build & BUILD_KEYBUILDER) != 0) {
+ } else if ((build & CardConsts.BUILD_KEYBUILDER) != 0) {
localKeypair = keyGenerator.constructPair(keyClass, keyLength);
}
Util.setShort(outBuffer, outOffset, keyGenerator.getSW());
length += 2;
}
- if ((keyPair & KEYPAIR_REMOTE) != 0) {
- if ((build & BUILD_KEYPAIR) != 0) {
+ if ((keyPair & CardConsts.KEYPAIR_REMOTE) != 0) {
+ if ((build & CardConsts.BUILD_KEYPAIR) != 0) {
remoteKeypair = keyGenerator.allocatePair(keyClass, keyLength);
- if (keyGenerator.getSW() != ISO7816.SW_NO_ERROR && (build & BUILD_KEYBUILDER) != 0) {
+ if (keyGenerator.getSW() != ISO7816.SW_NO_ERROR && (build & CardConsts.BUILD_KEYBUILDER) != 0) {
remoteKeypair = keyGenerator.constructPair(keyClass, keyLength);
}
- } else if ((build & BUILD_KEYBUILDER) != 0) {
+ } else if ((build & CardConsts.BUILD_KEYBUILDER) != 0) {
remoteKeypair = keyGenerator.constructPair(keyClass, keyLength);
}
Util.setShort(outBuffer, (short) (outOffset + length), keyGenerator.getSW());
@@ -811,8 +747,8 @@ public abstract class AppletBase extends Applet {
private short ecdh(byte pubkey, byte privkey, byte export, short transformation, byte type, byte[] outBuffer, short outOffset) {
short length = 0;
- KeyPair pub = ((pubkey & KEYPAIR_LOCAL) != 0) ? localKeypair : remoteKeypair;
- KeyPair priv = ((privkey & KEYPAIR_LOCAL) != 0) ? localKeypair : remoteKeypair;
+ KeyPair pub = ((pubkey & CardConsts.KEYPAIR_LOCAL) != 0) ? localKeypair : remoteKeypair;
+ KeyPair priv = ((privkey & CardConsts.KEYPAIR_LOCAL) != 0) ? localKeypair : remoteKeypair;
short secretLength = 0;
if (keyTester.getKaType() == type) {
@@ -826,7 +762,7 @@ public abstract class AppletBase extends Applet {
Util.setShort(outBuffer, outOffset, keyTester.getSW());
length += 2;
- if ((export == EXPORT_TRUE)) {
+ if ((export == CardConsts.EXPORT_TRUE)) {
Util.setShort(outBuffer, (short) (outOffset + length), secretLength);
length += 2;
Util.arrayCopyNonAtomic(ramArray2, (short) 0, outBuffer, (short) (outOffset + length), secretLength);
@@ -839,7 +775,7 @@ public abstract class AppletBase extends Applet {
private short ecdh_direct(byte privkey, byte export, short transformation, byte type, short keyOffset, short keyLength, byte[] outBuffer, short outOffset) {
short length = 0;
- KeyPair priv = ((privkey & KEYPAIR_LOCAL) != 0) ? localKeypair : remoteKeypair;
+ KeyPair priv = ((privkey & CardConsts.KEYPAIR_LOCAL) != 0) ? localKeypair : remoteKeypair;
short secretLength = 0;
if (keyTester.getKaType() == type) {
@@ -854,7 +790,7 @@ public abstract class AppletBase extends Applet {
Util.setShort(outBuffer, outOffset, keyTester.getSW());
length += 2;
- if ((export == EXPORT_TRUE)) {
+ if ((export == CardConsts.EXPORT_TRUE)) {
Util.setShort(outBuffer, (short) (outOffset + length), secretLength);
length += 2;
Util.arrayCopyNonAtomic(ramArray2, (short) 0, outBuffer, (short) (outOffset + length), secretLength);
@@ -897,7 +833,7 @@ public abstract class AppletBase extends Applet {
Util.setShort(outBuffer, outOffset, keyTester.getSW());
length += 2;
- if (export == EXPORT_TRUE) {
+ if (export == CardConsts.EXPORT_TRUE) {
Util.setShort(outBuffer, (short) (outOffset + length), signatureLength);
length += 2;
@@ -932,7 +868,7 @@ public abstract class AppletBase extends Applet {
Util.setShort(outBuffer, outOffset, keyTester.getSW());
length += 2;
- if (export == EXPORT_TRUE) {
+ if (export == CardConsts.EXPORT_TRUE) {
Util.setShort(outBuffer, (short) (outOffset + length), signatureLength);
length += 2;
diff --git a/src/cz/crcs/ectester/applet/AppletUtil.java b/applet/src/main/java/cz/crcs/ectester/applet/AppletUtil.java
index 9869aa4..c4a6744 100644
--- a/src/cz/crcs/ectester/applet/AppletUtil.java
+++ b/applet/src/main/java/cz/crcs/ectester/applet/AppletUtil.java
@@ -18,18 +18,18 @@ public class AppletUtil {
}
public static short objCheck(Object obj) {
- return nullCheck(obj, AppletBase.SW_OBJECT_NULL);
+ return nullCheck(obj, CardConsts.SW_OBJECT_NULL);
}
public static short keypairCheck(KeyPair keyPair) {
- return nullCheck(keyPair, AppletBase.SW_KEYPAIR_NULL);
+ return nullCheck(keyPair, CardConsts.SW_KEYPAIR_NULL);
}
public static short kaCheck(KeyAgreement keyAgreement) {
- return nullCheck(keyAgreement, AppletBase.SW_KA_NULL);
+ return nullCheck(keyAgreement, CardConsts.SW_KA_NULL);
}
public static short signCheck(Signature signature) {
- return nullCheck(signature, AppletBase.SW_SIGNATURE_NULL);
+ return nullCheck(signature, CardConsts.SW_SIGNATURE_NULL);
}
}
diff --git a/applet/src/main/java/cz/crcs/ectester/applet/CardConsts.java b/applet/src/main/java/cz/crcs/ectester/applet/CardConsts.java
new file mode 100644
index 0000000..abac8e7
--- /dev/null
+++ b/applet/src/main/java/cz/crcs/ectester/applet/CardConsts.java
@@ -0,0 +1,65 @@
+package cz.crcs.ectester.applet;
+
+public class CardConsts {
+ // MAIN INSTRUCTION CLASS
+ public static final byte CLA_ECTESTERAPPLET = (byte) 0xB0;
+
+ // INSTRUCTIONS
+ public static final byte INS_ALLOCATE = (byte) 0x5a;
+ public static final byte INS_CLEAR = (byte) 0x5b;
+ public static final byte INS_SET = (byte) 0x5c;
+ public static final byte INS_TRANSFORM = (byte) 0x5d;
+ public static final byte INS_GENERATE = (byte) 0x5e;
+ public static final byte INS_EXPORT = (byte) 0x5f;
+ public static final byte INS_ECDH = (byte) 0x70;
+ public static final byte INS_ECDH_DIRECT = (byte) 0x71;
+ public static final byte INS_ECDSA = (byte) 0x72;
+ public static final byte INS_ECDSA_SIGN = (byte) 0x73;
+ public static final byte INS_ECDSA_VERIFY = (byte) 0x74;
+ public static final byte INS_CLEANUP = (byte) 0x75;
+ public static final byte INS_ALLOCATE_KA = (byte) 0x76;
+ public static final byte INS_ALLOCATE_SIG = (byte) 0x77;
+ public static final byte INS_GET_INFO = (byte) 0x78;
+ public static final byte INS_SET_DRY_RUN_MODE = (byte) 0x79;
+ public static final byte INS_BUFFER = (byte) 0x7a;
+ public static final byte INS_PERFORM = (byte) 0x7b;
+
+ // PARAMETERS for P1 and P2
+ public static final byte KEYPAIR_LOCAL = (byte) 0x01;
+ public static final byte KEYPAIR_REMOTE = (byte) 0x02;
+ public static final byte KEYPAIR_BOTH = KEYPAIR_LOCAL | KEYPAIR_REMOTE;
+ public static final byte BUILD_KEYPAIR = (byte) 0x01;
+ public static final byte BUILD_KEYBUILDER = (byte) 0x02;
+ public static final byte EXPORT_TRUE = (byte) 0xff;
+ public static final byte EXPORT_FALSE = (byte) 0x00;
+ public static final byte MODE_NORMAL = (byte) 0xaa;
+ public static final byte MODE_DRY_RUN = (byte) 0xbb;
+
+ // STATUS WORDS
+ public static final short SW_SIG_VERIFY_FAIL = (short) 0x0ee1;
+ public static final short SW_DH_DHC_MISMATCH = (short) 0x0ee2;
+ public static final short SW_KEYPAIR_NULL = (short) 0x0ee3;
+ public static final short SW_KA_NULL = (short) 0x0ee4;
+ public static final short SW_SIGNATURE_NULL = (short) 0x0ee5;
+ public static final short SW_OBJECT_NULL = (short) 0x0ee6;
+ public static final short SW_CANNOT_FIT = (short) 0x0ee7;
+ public static final short SW_Exception = (short) 0xff01;
+ public static final short SW_ArrayIndexOutOfBoundsException = (short) 0xff02;
+ public static final short SW_ArithmeticException = (short) 0xff03;
+ public static final short SW_ArrayStoreException = (short) 0xff04;
+ public static final short SW_NullPointerException = (short) 0xff05;
+ public static final short SW_NegativeArraySizeException = (short) 0xff06;
+ public static final short SW_CryptoException_prefix = (short) 0xf100;
+ public static final short SW_SystemException_prefix = (short) 0xf200;
+ public static final short SW_PINException_prefix = (short) 0xf300;
+ public static final short SW_TransactionException_prefix = (short) 0xf400;
+ public static final short SW_CardRuntimeException_prefix = (short) 0xf500;
+
+ //
+ public static final short BASE_221 = (short) 0x0221;
+ public static final short BASE_222 = (short) 0x0222;
+
+ //
+ public static final short CDATA_BASIC = (short) 5;
+ public static final short CDATA_EXTENDED = (short) 7;
+}
diff --git a/src/cz/crcs/ectester/applet/ECKeyGenerator.java b/applet/src/main/java/cz/crcs/ectester/applet/ECKeyGenerator.java
index 601654a..601654a 100644
--- a/src/cz/crcs/ectester/applet/ECKeyGenerator.java
+++ b/applet/src/main/java/cz/crcs/ectester/applet/ECKeyGenerator.java
diff --git a/src/cz/crcs/ectester/applet/ECKeyTester.java b/applet/src/main/java/cz/crcs/ectester/applet/ECKeyTester.java
index 89590d0..3af1cca 100644
--- a/src/cz/crcs/ectester/applet/ECKeyTester.java
+++ b/applet/src/main/java/cz/crcs/ectester/applet/ECKeyTester.java
@@ -131,7 +131,7 @@ public class ECKeyTester {
ecdsaSignature.init(verifyKey, Signature.MODE_VERIFY);
if (!ecdsaSignature.verify(inputBuffer, inputOffset, inputLength, sigBuffer, sigOffset, length)) {
- sw = AppletBase.SW_SIG_VERIFY_FAIL;
+ sw = CardConsts.SW_SIG_VERIFY_FAIL;
}
}
} catch (CardRuntimeException ce) {
@@ -182,7 +182,7 @@ public class ECKeyTester {
if (!dryRun) {
ecdsaSignature.init(verifyKey, Signature.MODE_VERIFY);
if (!ecdsaSignature.verify(inputBuffer, inputOffset, inputLength, sigBuffer, sigOffset, sigLength)) {
- sw = AppletBase.SW_SIG_VERIFY_FAIL;
+ sw = CardConsts.SW_SIG_VERIFY_FAIL;
}
}
} catch (CardRuntimeException ce) {
diff --git a/src/cz/crcs/ectester/applet/ECTesterApplet.java b/applet/src/main/java/cz/crcs/ectester/applet/ECTesterApplet.java
index 12978e6..d679341 100644
--- a/src/cz/crcs/ectester/applet/ECTesterApplet.java
+++ b/applet/src/main/java/cz/crcs/ectester/applet/ECTesterApplet.java
@@ -21,10 +21,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
-/*
- * PACKAGEID: 4543546573746572
- * APPLETID: 454354657374657230333362 // VERSION v0.3.3
- */
package cz.crcs.ectester.applet;
import javacard.framework.APDU;
@@ -58,6 +54,6 @@ public class ECTesterApplet extends AppletBase {
}
short getBase() {
- return AppletBase.BASE_221;
+ return CardConsts.BASE_221;
}
}
diff --git a/src/cz/crcs/ectester/applet/ECTesterAppletExtended.java b/applet/src/main/java/cz/crcs/ectester/applet/ECTesterAppletExtended.java
index 97a3769..a254ebd 100644
--- a/src/cz/crcs/ectester/applet/ECTesterAppletExtended.java
+++ b/applet/src/main/java/cz/crcs/ectester/applet/ECTesterAppletExtended.java
@@ -21,10 +21,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
-/*
- * PACKAGEID: 4543546573746572
- * APPLETID: 454354657374657230333378 // VERSION v0.3.3
- */
package cz.crcs.ectester.applet;
import javacard.framework.APDU;
@@ -59,6 +55,6 @@ public class ECTesterAppletExtended extends AppletBase implements ExtendedLength
}
short getBase() {
- return AppletBase.BASE_222;
+ return CardConsts.BASE_222;
}
}
diff --git a/src/cz/crcs/ectester/applet/EC_Consts.java b/applet/src/main/java/cz/crcs/ectester/applet/EC_Consts.java
index 81016ac..2883ff1 100644
--- a/src/cz/crcs/ectester/applet/EC_Consts.java
+++ b/applet/src/main/java/cz/crcs/ectester/applet/EC_Consts.java
@@ -1472,7 +1472,6 @@ public class EC_Consts {
return curve <= FP_CURVES ? KeyPair.ALG_EC_FP : KeyPair.ALG_EC_F2M;
}
- @SuppressWarnings("fallthrough")
public static short toX962(byte form, byte[] outputBuffer, short outputOffset, byte[] xBuffer, short xOffset, short xLength, byte[] yBuffer, short yOffset, short yLength) {
short size = 1;
size += xLength;
diff --git a/applet/ssleay32.dll b/applet/ssleay32.dll
deleted file mode 100644
index e8fabb6..0000000
--- a/applet/ssleay32.dll
+++ /dev/null
Binary files differ
diff --git a/applet/zlib1.dll b/applet/zlib1.dll
deleted file mode 100644
index 31996cd..0000000
--- a/applet/zlib1.dll
+++ /dev/null
Binary files differ
diff --git a/build-applet.xml b/build-applet.xml
deleted file mode 100644
index c31ae23..0000000
--- a/build-applet.xml
+++ /dev/null
@@ -1,107 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project basedir="." default="build" name="ECTesterApplet">
- <!-- Based on Martin Paljak's applets playground -->
- <!-- Applet building dependencies -->
- <property name="SDK_PATH" value="ext/sdks"/>
-
- <property name="JC212" value="${SDK_PATH}/jc212_kit"/>
- <property name="JC221" value="${SDK_PATH}/jc221_kit"/>
- <property name="JC222" value="${SDK_PATH}/jc222_kit"/>
- <property name="JC303" value="${SDK_PATH}/jc303_kit"/>
- <property name="JC304" value="${SDK_PATH}/jc304_kit"/>
- <property name="JC305u1" value="${SDK_PATH}/jc305u1_kit"/>
-
- <!-- ant-javacard task from javacard.pro -->
- <taskdef name="javacard" classname="pro.javacard.ant.JavaCard" classpath="ext/ant-javacard.jar"/>
-
- <!-- applet properties -->
- <property name="pkg_aid" value="4543546573746572"/>
- <property name="applet_aid_221" value="454354657374657230333362"/> <!--// VERSION v0.3.3 -->
- <property name="applet_aid_222" value="454354657374657230333378"/> <!--// VERSION v0.3.3 -->
- <property name="applet_aid_304" value="454354657374657230333394"/> <!--// VERSION v0.3.3 -->
- <property name="cap_221" value="ectester221.cap"/>
- <property name="cap_222" value="ectester222.cap"/>
- <property name="cap_304" value="ectester304.cap"/>
- <property name="cap" value="${cap_304}"/>
-
-
- <condition property="build_221">
- <equals arg1="${cap}" arg2="${cap_221}"/>
- </condition>
- <condition property="build_222">
- <equals arg1="${cap}" arg2="${cap_222}"/>
- </condition>
- <condition property="build_304">
- <equals arg1="${cap}" arg2="${cap_304}"/>
- </condition>
-
- <target name="build-check">
- <fail message="Invalid cap name!">
- <condition>
- <not>
- <or>
- <equals arg1="${cap}" arg2="${cap_304}"/>
- <equals arg1="${cap}" arg2="${cap_222}"/>
- <equals arg1="${cap}" arg2="${cap_221}"/>
- </or>
- </not>
- </condition>
- </fail>
- </target>
-
- <!-- TODO: These conditions disallow a manual request to build a concrete version. Fix this. -->
- <target name="build-221" description="Builds the CAP file for JavaCard 2.2.1." if="build_221">
- <javacard jckit="${JC221}">
- <cap verify="false" output="applet/${cap_221}" sources="src/cz/crcs/ectester/applet" aid="${pkg_aid}" excludes="ECTesterAppletExtended.*">
- <applet class="cz.crcs.ectester.applet.ECTesterApplet" aid="${applet_aid_221}"/>
- </cap>
- </javacard>
- </target>
-
- <target name="build-222" description="Builds the CAP file for JavaCard 2.2.2." if="build_222">
- <javacard jckit="${JC222}">
- <cap output="applet/${cap_222}" sources="src/cz/crcs/ectester/applet" aid="${pkg_aid}" excludes="ECTesterApplet.*">
- <applet class="cz.crcs.ectester.applet.ECTesterAppletExtended" aid="${applet_aid_222}"/>
- </cap>
- </javacard>
- </target>
-
- <target name="build-304" description="Builds the CAP file for JavaCard 3.0.4." if="build_304">
- <javacard jckit="${JC304}">
- <cap output="applet/${cap_304}" sources="src/cz/crcs/ectester/applet" aid="${pkg_aid}" excludes="ECTesterApplet.*">
- <applet class="cz.crcs.ectester.applet.ECTesterAppletExtended" aid="${applet_aid_304}"/>
- </cap>
- </javacard>
- </target>
-
- <target name="build" description="Builds the CAP file." depends="build-check,build-221,build-222,build-304">
- </target>
-
- <target name="upload" depends="build" description="Uploads the CAP file to the card, using gp.jar.">
- <exec dir="applet" executable="./gppro_upload.sh" osfamily="unix">
- <arg value="${pkg_aid}"/>
- <arg value="${cap}"/>
- </exec>
- <exec dir="applet" executable="./gppro_upload.bat" osfamily="windows">
- <arg value="${pkg_aid}"/>
- <arg value="${cap}"/>
- </exec>
- </target>
-
- <target name="upload-emv" depends="build" description="Uploads the CAP file to the card, using gp.jar, uses the EMV protocol">
- <exec dir="applet" executable="./gppro_upload_emv.sh" osfamily="unix">
- <arg value="${pkg_aid}"/>
- <arg value="${cap}"/>
- </exec>
- <exec dir="applet" executable="./gppro_upload_emv.bat" osfamily="windows">
- <arg value="${pkg_aid}"/>
- <arg value="${cap}"/>
- </exec>
- </target>
-
- <target name="clean" description="Clean the built CAP files.">
- <delete file="applet/${cap_221}" quiet="true"/>
- <delete file="applet/${cap_222}" quiet="true"/>
- <delete file="applet/${cap_304}" quiet="true"/>
- </target>
-</project>
diff --git a/build-reader.xml b/build-reader.xml
deleted file mode 100644
index 11d6145..0000000
--- a/build-reader.xml
+++ /dev/null
@@ -1,89 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- You may freely edit this file. See commented blocks below for -->
-<!-- some examples of how to customize the build. -->
-<!-- (If you delete it and reopen the project it will be recreated.) -->
-<!-- By default, only the Clean and Build commands use this build script. -->
-<!-- Commands such as Run, Debug, and Test only use this build script if -->
-<!-- the Compile on Save feature is turned off for the project. -->
-<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
-<!-- in the project's Project Properties dialog box.-->
-<project name="ECTesterReader" default="default" basedir=".">
- <description>Builds, tests, and runs the project ECTesterReader.</description>
- <import file="nbproject/reader/build-impl.xml"/>
- <import file="nbproject/dist-build.xml"/>
- <!--
-
- There exist several targets which are by default empty and which can be
- used for execution of your tasks. These targets are usually executed
- before and after some main targets. They are:
-
- -pre-init: called before initialization of project properties
- -post-init: called after initialization of project properties
- -pre-compile: called before javac compilation
- -post-compile: called after javac compilation
- -pre-compile-single: called before javac compilation of single file
- -post-compile-single: called after javac compilation of single file
- -pre-compile-test: called before javac compilation of JUnit tests
- -post-compile-test: called after javac compilation of JUnit tests
- -pre-compile-test-single: called before javac compilation of single JUnit test
- -post-compile-test-single: called after javac compilation of single JUunit test
- -pre-jar: called before JAR building
- -post-jar: called after JAR building
- -post-clean: called after cleaning build products
-
- (Targets beginning with '-' are not intended to be called on their own.)
-
- Example of inserting an obfuscator after compilation could look like this:
-
- <target name="-post-compile">
- <obfuscate>
- <fileset dir="${build.classes.dir}"/>
- </obfuscate>
- </target>
-
- For list of available properties check the imported
- nbproject/build-impl.xml file.
-
-
- Another way to customize the build is by overriding existing main targets.
- The targets of interest are:
-
- -init-macrodef-javac: defines macro for javac compilation
- -init-macrodef-junit: defines macro for junit execution
- -init-macrodef-debug: defines macro for class debugging
- -init-macrodef-java: defines macro for class execution
- -do-jar: JAR building
- run: execution of project
- -javadoc-build: Javadoc generation
- test-report: JUnit report generation
-
- An example of overriding the target for project execution could look like this:
-
- <target name="run" depends="SimpleECC-impl.jar">
- <exec dir="bin" executable="launcher.exe">
- <arg file="${dist.jar}"/>
- </exec>
- </target>
-
- Notice that the overridden target depends on the jar target and not only on
- the compile target as the regular run target does. Again, for a list of available
- properties which you can use, check the target you are overriding in the
- nbproject/build-impl.xml file.
-
- -->
- <target name="-pre-jar">
- <copy file="LICENSE" todir="${build.classes.dir}"/>
- </target>
-
- <!--
- <target name="-post-jar">
- <copy file="src/cz/crcs/ectester/scripts/ectester-reader.sh" todir="${dist.dir}"/>
- <copy file="src/cz/crcs/ectester/scripts/ectester-reader.bat" todir="${dist.dir}"/>
- </target>
- -->
-
- <target name="package" depends="jar">
- <property name="store.jar.name" value="ECTesterReader-dist"/>
- <antcall target="dist-build.package"/>
- </target>
-</project>
diff --git a/build-standalone.xml b/build-standalone.xml
deleted file mode 100644
index 731698b..0000000
--- a/build-standalone.xml
+++ /dev/null
@@ -1,224 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- You may freely edit this file. See commented blocks below for -->
-<!-- some examples of how to customize the build. -->
-<!-- (If you delete it and reopen the project it will be recreated.) -->
-<!-- By default, only the Clean and Build commands use this build script. -->
-<!-- Commands such as Run, Debug, and Test only use this build script if -->
-<!-- the Compile on Save feature is turned off for the project. -->
-<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
-<!-- in the project's Project Properties dialog box.-->
-<project name="ECTesterStandalone" default="default" basedir=".">
- <description>Builds, tests, and runs the project ECTesterStandalone.</description>
- <import file="nbproject/standalone/build-impl.xml"/>
- <import file="nbproject/dist-build.xml"/>
- <!--
-
- There exist several targets which are by default empty and which can be
- used for execution of your tasks. These targets are usually executed
- before and after some main targets. They are:
-
- -pre-init: called before initialization of project properties
- -post-init: called after initialization of project properties
- -pre-compile: called before javac compilation
- -post-compile: called after javac compilation
- -pre-compile-single: called before javac compilation of single file
- -post-compile-single: called after javac compilation of single file
- -pre-compile-test: called before javac compilation of JUnit tests
- -post-compile-test: called after javac compilation of JUnit tests
- -pre-compile-test-single: called before javac compilation of single JUnit test
- -post-compile-test-single: called after javac compilation of single JUunit test
- -pre-jar: called before JAR building
- -post-jar: called after JAR building
- -post-clean: called after cleaning build products
-
- (Targets beginning with '-' are not intended to be called on their own.)
-
- Example of inserting an obfuscator after compilation could look like this:
-
- <target name="-post-compile">
- <obfuscate>
- <fileset dir="${build.classes.dir}"/>
- </obfuscate>
- </target>
-
- For list of available properties check the imported
- nbproject/build-impl.xml file.
-
-
- Another way to customize the build is by overriding existing main targets.
- The targets of interest are:
-
- -init-macrodef-javac: defines macro for javac compilation
- -init-macrodef-junit: defines macro for junit execution
- -init-macrodef-debug: defines macro for class debugging
- -init-macrodef-java: defines macro for class execution
- -do-jar: JAR building
- run: execution of project
- -javadoc-build: Javadoc generation
- test-report: JUnit report generation
-
- An example of overriding the target for project execution could look like this:
-
- <target name="run" depends="SimpleECC-impl.jar">
- <exec dir="bin" executable="launcher.exe">
- <arg file="${dist.jar}"/>
- </exec>
- </target>
-
- Notice that the overridden target depends on the jar target and not only on
- the compile target as the regular run target does. Again, for a list of available
- properties which you can use, check the target you are overriding in the
- nbproject/build-impl.xml file.
-
- -->
- <target name="-pre-jar">
- <copy file="LICENSE" todir="${build.classes.dir}"/>
- </target>
-
- <target name="package" depends="jar">
- <property name="store.jar.name" value="ECTesterStandalone-dist"/>
- <antcall target="dist-build.package"/>
- </target>
-
- <target name="sign" depends="package">
- <signjar keystore="nbproject/keystore" alias="ectester" storepass="ectester">
- <path>
- <fileset dir="dist" includes="*.jar"/>
- </path>
- </signjar>
- </target>
-
- <target name="libs-try">
- <exec dir="src/cz/crcs/ectester/standalone/libs/jni" executable="make" osfamily="unix">
- <arg value="-k"/>
- <arg value="-B"/>
- </exec>
- <exec dir="src/cz/crcs/ectester/standalone/libs/jni" executable="cmd" osfamily="windows">
- <arg value="/c"/>
- <arg value="Makefile.bat"/>
- </exec>
- </target>
- <target name="libs">
- <exec dir="src/cz/crcs/ectester/standalone/libs/jni" failonerror="true" executable="make" osfamily="unix">
- <arg value="-k"/>
- <arg value="-B"/>
- </exec>
- <exec dir="src/cz/crcs/ectester/standalone/libs/jni" failonerror="true" executable="cmd" osfamily="windows">
- <arg value="/c"/>
- <arg value="Makefile.bat"/>
- </exec>
- </target>
- <target name="libs-debug">
- <exec dir="src/cz/crcs/ectester/standalone/libs/jni" failonerror="true" executable="make" osfamily="unix">
- <arg value="-k"/>
- <arg value="DEBUG=1"/>
- </exec>
- <exec dir="src/cz/crcs/ectester/standalone/libs/jni" failonerror="true" executable="cmd" osfamily="windows">
- <arg value="/c"/>
- <arg value="Makefile.bat"/>
- <env key="DEBUG" value="1"/>
- </exec>
- </target>
-
- <target name="-pre-compile" depends="libs-try"/>
-
- <target name="-post-clean">
- <exec dir="src/cz/crcs/ectester/standalone/libs/jni" failonerror="true" executable="make" osfamily="unix">
- <arg value="clean"/>
- </exec>
- <exec dir="src/cz/crcs/ectester/standalone/libs/jni" failonerror="true" executable="cmd" osfamily="windows">
- <arg value="/c"/>
- <arg value="Makefile.bat"/>
- <arg value="clean"/>
- </exec>
- </target>
-
- <target name="headers" depends="compile">
- <javah classpath="${build.classes.dir}" outputfile="src/cz/crcs/ectester/standalone/libs/jni/native.h">
- <class name="cz.crcs.ectester.standalone.libs.NativeECLibrary"/>
- <class name="cz.crcs.ectester.standalone.libs.TomcryptLib"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeProvider$TomCrypt"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeKeyPairGeneratorSpi$TomCrypt"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeECPublicKey$TomCrypt"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeECPrivateKey$TomCrypt"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeKeyAgreementSpi$TomCrypt"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeSignatureSpi$TomCryptRaw"/>
- <class name="cz.crcs.ectester.standalone.libs.BotanLib"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeProvider$Botan"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeKeyPairGeneratorSpi$Botan"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeECPublicKey$Botan"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeECPrivateKey$Botan"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeKeyAgreementSpi$Botan"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeSignatureSpi$Botan"/>
- <class name="cz.crcs.ectester.standalone.libs.CryptoppLib"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeProvider$Cryptopp"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeKeyPairGeneratorSpi$Cryptopp"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeECPublicKey$Cryptopp"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeECPrivateKey$Cryptopp"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeKeyAgreementSpi$Cryptopp"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeSignatureSpi$Cryptopp"/>
- <class name="cz.crcs.ectester.standalone.libs.OpensslLib"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeProvider$Openssl"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeKeyPairGeneratorSpi$Openssl"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeECPublicKey$Openssl"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeECPrivateKey$Openssl"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeKeyAgreementSpi$Openssl"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeSignatureSpi$Openssl"/>
- <class name="cz.crcs.ectester.standalone.libs.MscngLib"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeProvider$Mscng"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeKeyPairGeneratorSpi$Mscng"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeECPublicKey$Mscng"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeECPrivateKey$Mscng"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeKeyAgreementSpi$Mscng"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeSignatureSpi$Mscng"/>
- <class name="cz.crcs.ectester.standalone.libs.BoringsslLib"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeProvider$Boringssl"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeKeyPairGeneratorSpi$Boringssl"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeECPublicKey$Boringssl"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeECPrivateKey$Boringssl"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeKeyAgreementSpi$Boringssl"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeSignatureSpi$Boringssl"/>
- <class name="cz.crcs.ectester.standalone.libs.GcryptLib"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeProvider$Gcrypt"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeKeyPairGeneratorSpi$Gcrypt"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeECPublicKey$Gcrypt"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeECPrivateKey$Gcrypt"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeKeyAgreementSpi$Gcrypt"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeSignatureSpi$Gcrypt"/>
- <class name="cz.crcs.ectester.standalone.libs.MbedTLSLib"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeProvider$MbedTLS"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeKeyPairGeneratorSpi$MbedTLS"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeECPublicKey$MbedTLS"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeECPrivateKey$MbedTLS"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeKeyAgreementSpi$MbedTLS"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeSignatureSpi$MbedTLS"/>
- <class name="cz.crcs.ectester.standalone.libs.IppcpLib"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeProvider$Ippcp"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeKeyPairGeneratorSpi$Ippcp"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeECPublicKey$Ippcp"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeECPrivateKey$Ippcp"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeKeyAgreementSpi$Ippcp"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeSignatureSpi$Ippcp"/>
- <class name="cz.crcs.ectester.standalone.libs.MatrixsslLib"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeProvider$Matrixssl"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeKeyPairGeneratorSpi$Matrixssl"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeECPublicKey$Matrixssl"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeECPrivateKey$Matrixssl"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeKeyAgreementSpi$Matrixssl"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeSignatureSpi$Matrixssl"/>
- <class name="cz.crcs.ectester.standalone.libs.NettleLib"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeProvider$Nettle"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeKeyPairGeneratorSpi$Nettle"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeECPublicKey$Nettle"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeECPrivateKey$Nettle"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeSignatureSpi$Nettle"/>
- <class name="cz.crcs.ectester.standalone.libs.LibresslLib"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeProvider$Libressl"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeKeyPairGeneratorSpi$Libressl"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeECPublicKey$Libressl"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeECPrivateKey$Libressl"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeKeyAgreementSpi$Libressl"/>
- <class name="cz.crcs.ectester.standalone.libs.jni.NativeSignatureSpi$Libressl"/>
- </javah>
- </target>
-</project>
diff --git a/build.xml b/build.xml
deleted file mode 100644
index b3c6461..0000000
--- a/build.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project basedir="." default="build" name="ECTester">
- <target name="build">
- <ant antfile="build-applet.xml" target="build"/>
- <ant antfile="build-reader.xml" target="jar"/>
- <ant antfile="build-standalone.xml" target="jar"/>
- </target>
- <target name="package">
- <ant antfile="build-applet.xml" target="build"/>
- <ant antfile="build-reader.xml" target="package"/>
- <ant antfile="build-standalone.xml" target="package"/>
- </target>
- <target name="upload">
- <ant antfile="build-applet.xml" target="upload"/>
- </target>
- <target name="clean">
- <ant antfile="build-applet.xml" target="clean"/>
- <ant antfile="build-reader.xml" target="clean"/>
- <ant antfile="build-standalone.xml" target="clean"/>
- </target>
- <target name="help">
- <echo message="ECTester is built using three ant files:"/>
- <echo message=" - build-applet.xml - For building the JavaCard applet."/>
- <echo message=" -> build: Build the applet."/>
- <echo message=" -> build-221: Build the applet for JavaCard 2.2.1."/>
- <echo message=" -> build-222: Build the applet for JavaCard 2.2.2."/>
- <echo message=" -> upload: Upload the applet using the GPPro tool."/>
- <echo message=" (use `-Dcap=ectester221.cap` to upload the 2.2.1 version.)"/>
- <echo message=" -> upload-emv: Upload the applet using the GPPro tool and the EMV key protocol."/>
- <echo message=" (use `-Dcap=ectester221.cap` to upload the 2.2.1 version.)"/>
- <echo message=" - build-reader.xml - For building the reader app."/>
- <echo message=" -> jar: Build the reader app."/>
- <echo message=" -> package: Build the reader app into a distributable single jar, along with dependencies."/>
- <echo message=" - build-standalone.xml - For building the standalone app."/>
- <echo message=" -> jar: Build the standalone app."/>
- <echo message=" -> headers: Build the JNI header for testing native libraries."/>
- <echo message=" -> libs: Build the JNI shims for testing native libraries."/>
- <echo message=" -> libs-try: Build the JNI shims for testing native libraries, but do not fail if some are not available."/>
- <echo message=" -> package: Build the standalone app into a distributable single jar, along with dependencies."/>
- <echo message=""/>
- <echo message="Finally, this file provides four targets:"/>
- <echo message=" -> build: "/>
- <echo message=" -> package: "/>
- <echo message=" -> clean: "/>
- <echo message=" -> help: "/>
- </target>
-</project> \ No newline at end of file
diff --git a/common/build.gradle.kts b/common/build.gradle.kts
new file mode 100644
index 0000000..5829d8c
--- /dev/null
+++ b/common/build.gradle.kts
@@ -0,0 +1,23 @@
+/*
+ * This file was generated by the Gradle 'init' task.
+ */
+
+plugins {
+ id("java-library")
+}
+
+repositories {
+ mavenCentral()
+}
+
+dependencies {
+ // https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk18on
+ api("org.bouncycastle:bcprov-jdk18on:1.77")
+ // https://mvnrepository.com/artifact/commons-cli/commons-cli
+ // We need 1.5.0, as for some reason 1.6.0 doesn't work (arguments don't ger parsed properly).
+ api("commons-cli:commons-cli:1.5.0")
+ // https://mvnrepository.com/artifact/org.yaml/snakeyaml
+ api("org.yaml:snakeyaml:2.2")
+ // https://mvnrepository.com/artifact/com.klinec/jcardsim
+ api("com.klinec:jcardsim:3.0.5.11")
+} \ No newline at end of file
diff --git a/src/cz/crcs/ectester/common/cli/Argument.java b/common/src/main/java/cz/crcs/ectester/common/cli/Argument.java
index e9b6688..e9b6688 100644
--- a/src/cz/crcs/ectester/common/cli/Argument.java
+++ b/common/src/main/java/cz/crcs/ectester/common/cli/Argument.java
diff --git a/src/cz/crcs/ectester/common/cli/CLITools.java b/common/src/main/java/cz/crcs/ectester/common/cli/CLITools.java
index 82ab530..82ab530 100644
--- a/src/cz/crcs/ectester/common/cli/CLITools.java
+++ b/common/src/main/java/cz/crcs/ectester/common/cli/CLITools.java
diff --git a/src/cz/crcs/ectester/common/cli/Colors.java b/common/src/main/java/cz/crcs/ectester/common/cli/Colors.java
index 7601088..7601088 100644
--- a/src/cz/crcs/ectester/common/cli/Colors.java
+++ b/common/src/main/java/cz/crcs/ectester/common/cli/Colors.java
diff --git a/src/cz/crcs/ectester/common/cli/ParserOptions.java b/common/src/main/java/cz/crcs/ectester/common/cli/ParserOptions.java
index 7300cbb..7300cbb 100644
--- a/src/cz/crcs/ectester/common/cli/ParserOptions.java
+++ b/common/src/main/java/cz/crcs/ectester/common/cli/ParserOptions.java
diff --git a/src/cz/crcs/ectester/common/cli/TreeCommandLine.java b/common/src/main/java/cz/crcs/ectester/common/cli/TreeCommandLine.java
index d758b78..d758b78 100644
--- a/src/cz/crcs/ectester/common/cli/TreeCommandLine.java
+++ b/common/src/main/java/cz/crcs/ectester/common/cli/TreeCommandLine.java
diff --git a/src/cz/crcs/ectester/common/cli/TreeParser.java b/common/src/main/java/cz/crcs/ectester/common/cli/TreeParser.java
index 657318d..657318d 100644
--- a/src/cz/crcs/ectester/common/cli/TreeParser.java
+++ b/common/src/main/java/cz/crcs/ectester/common/cli/TreeParser.java
diff --git a/src/cz/crcs/ectester/common/ec/CustomECFieldF2m.java b/common/src/main/java/cz/crcs/ectester/common/ec/CustomECFieldF2m.java
index 24ea5aa..24ea5aa 100644
--- a/src/cz/crcs/ectester/common/ec/CustomECFieldF2m.java
+++ b/common/src/main/java/cz/crcs/ectester/common/ec/CustomECFieldF2m.java
diff --git a/src/cz/crcs/ectester/common/ec/CustomECFieldFp.java b/common/src/main/java/cz/crcs/ectester/common/ec/CustomECFieldFp.java
index eafcb72..eafcb72 100644
--- a/src/cz/crcs/ectester/common/ec/CustomECFieldFp.java
+++ b/common/src/main/java/cz/crcs/ectester/common/ec/CustomECFieldFp.java
diff --git a/src/cz/crcs/ectester/common/ec/CustomECParameterSpec.java b/common/src/main/java/cz/crcs/ectester/common/ec/CustomECParameterSpec.java
index cbc15e7..cbc15e7 100644
--- a/src/cz/crcs/ectester/common/ec/CustomECParameterSpec.java
+++ b/common/src/main/java/cz/crcs/ectester/common/ec/CustomECParameterSpec.java
diff --git a/src/cz/crcs/ectester/common/ec/CustomEllipticCurve.java b/common/src/main/java/cz/crcs/ectester/common/ec/CustomEllipticCurve.java
index 489861c..489861c 100644
--- a/src/cz/crcs/ectester/common/ec/CustomEllipticCurve.java
+++ b/common/src/main/java/cz/crcs/ectester/common/ec/CustomEllipticCurve.java
diff --git a/src/cz/crcs/ectester/common/ec/EC_Category.java b/common/src/main/java/cz/crcs/ectester/common/ec/EC_Category.java
index 154403e..154403e 100644
--- a/src/cz/crcs/ectester/common/ec/EC_Category.java
+++ b/common/src/main/java/cz/crcs/ectester/common/ec/EC_Category.java
diff --git a/common/src/main/java/cz/crcs/ectester/common/ec/EC_Consts.java b/common/src/main/java/cz/crcs/ectester/common/ec/EC_Consts.java
new file mode 100644
index 0000000..86c30fa
--- /dev/null
+++ b/common/src/main/java/cz/crcs/ectester/common/ec/EC_Consts.java
@@ -0,0 +1,1403 @@
+package cz.crcs.ectester.common.ec;
+
+import cz.crcs.ectester.common.util.ByteUtil;
+
+import java.nio.ByteBuffer;
+
+/**
+ * @author Petr Svenda petr@svenda.com
+ * @author Jan Jancar johny@neuromancer.sk
+ */
+public class EC_Consts {
+ private static byte[] EC_FP_P = null; //p
+ private static byte[] EC_A = null; //a
+ private static byte[] EC_B = null; //b
+ private static byte[] EC_G_X = null; //G[x,y]
+ private static byte[] EC_G_Y = null; //
+ private static byte[] EC_R = null; //n
+ private static short EC_K = 1; //h
+
+ private static byte[] EC_W_X = null; //Pubkey[x,y]
+ private static byte[] EC_W_Y = null;
+ private static byte[] EC_S = null; //Private
+
+ private static byte[] EC_F2M_F2M = null; //[short i1, short i2, short i3], f = x^m + x^i1 + x^i2 + x^i3 + 1
+
+ // EC domain parameter identifiers (bit flags)
+ public static final short PARAMETER_FP = 0x0001;
+ public static final short PARAMETER_F2M = 0x0002;
+
+ public static final short PARAMETER_A = 0x0004;
+ public static final short PARAMETER_B = 0x0008;
+ public static final short PARAMETER_G = 0x0010;
+ public static final short PARAMETER_R = 0x0020;
+ public static final short PARAMETER_K = 0x0040;
+ public static final short PARAMETER_W = 0x0080;
+ public static final short PARAMETER_S = 0x0100;
+
+ public static final short PARAMETERS_NONE = 0x0000;
+ /**
+ * FP,A,B,G,R,K
+ */
+ public static final short PARAMETERS_DOMAIN_FP = 0x007d;
+ /**
+ * F2M,A,B,G,R,K
+ */
+ public static final short PARAMETERS_DOMAIN_F2M = 0x007e;
+ /**
+ * W,S
+ */
+ public static final short PARAMETERS_KEYPAIR = 0x0180;
+ public static final short PARAMETERS_ALL = 0x01ff;
+
+ // EC key identifiers
+ public static final byte KEY_PUBLIC = 0x01;
+ public static final byte KEY_PRIVATE = 0x02;
+ public static final byte KEY_BOTH = KEY_PUBLIC | KEY_PRIVATE;
+
+ // secp112r1
+ public static final byte[] EC112_FP_P = new byte[]{
+ (byte) 0xdb, (byte) 0x7c, (byte) 0x2a, (byte) 0xbf,
+ (byte) 0x62, (byte) 0xe3, (byte) 0x5e, (byte) 0x66,
+ (byte) 0x80, (byte) 0x76, (byte) 0xbe, (byte) 0xad,
+ (byte) 0x20, (byte) 0x8b
+ };
+
+ public static final byte[] EC112_FP_A = new byte[]{
+ (byte) 0xdb, (byte) 0x7c, (byte) 0x2a, (byte) 0xbf,
+ (byte) 0x62, (byte) 0xe3, (byte) 0x5e, (byte) 0x66,
+ (byte) 0x80, (byte) 0x76, (byte) 0xbe, (byte) 0xad,
+ (byte) 0x20, (byte) 0x88
+ };
+
+ public static final byte[] EC112_FP_B = new byte[]{
+ (byte) 0x65, (byte) 0x9e, (byte) 0xf8, (byte) 0xba,
+ (byte) 0x04, (byte) 0x39, (byte) 0x16, (byte) 0xee,
+ (byte) 0xde, (byte) 0x89, (byte) 0x11, (byte) 0x70,
+ (byte) 0x2b, (byte) 0x22
+ };
+
+ public static final byte[] EC112_FP_G_X = new byte[]{
+ (byte) 0x09, (byte) 0x48, (byte) 0x72, (byte) 0x39,
+ (byte) 0x99, (byte) 0x5a, (byte) 0x5e, (byte) 0xe7,
+ (byte) 0x6b, (byte) 0x55, (byte) 0xf9, (byte) 0xc2,
+ (byte) 0xf0, (byte) 0x98
+ };
+
+ public static final byte[] EC112_FP_G_Y = new byte[]{
+ (byte) 0xa8, (byte) 0x9c, (byte) 0xe5, (byte) 0xaf,
+ (byte) 0x87, (byte) 0x24, (byte) 0xc0, (byte) 0xa2,
+ (byte) 0x3e, (byte) 0x0e, (byte) 0x0f, (byte) 0xf7,
+ (byte) 0x75, (byte) 0x00
+ };
+
+ public static final byte[] EC112_FP_R = new byte[]{
+ (byte) 0xdb, (byte) 0x7c, (byte) 0x2a, (byte) 0xbf,
+ (byte) 0x62, (byte) 0xe3, (byte) 0x5e, (byte) 0x76,
+ (byte) 0x28, (byte) 0xdf, (byte) 0xac, (byte) 0x65,
+ (byte) 0x61, (byte) 0xc5
+ };
+
+ public static final short EC112_FP_K = 1;
+
+
+ // secp128r1 from http://www.secg.org/sec2-v2.pdf
+ public static final byte[] EC128_FP_P = new byte[]{
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFD,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF
+ };
+
+ public static final byte[] EC128_FP_A = new byte[]{
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFD,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFC
+ };
+
+ public static final byte[] EC128_FP_B = new byte[]{
+ (byte) 0xE8, (byte) 0x75, (byte) 0x79, (byte) 0xC1,
+ (byte) 0x10, (byte) 0x79, (byte) 0xF4, (byte) 0x3D,
+ (byte) 0xD8, (byte) 0x24, (byte) 0x99, (byte) 0x3C,
+ (byte) 0x2C, (byte) 0xEE, (byte) 0x5E, (byte) 0xD3
+ };
+
+ // G in compressed form / first part of ucompressed
+ public static final byte[] EC128_FP_G_X = new byte[]{
+ (byte) 0x16, (byte) 0x1F, (byte) 0xF7, (byte) 0x52,
+ (byte) 0x8B, (byte) 0x89, (byte) 0x9B, (byte) 0x2D,
+ (byte) 0x0C, (byte) 0x28, (byte) 0x60, (byte) 0x7C,
+ (byte) 0xA5, (byte) 0x2C, (byte) 0x5B, (byte) 0x86
+ };
+
+ // second part of G uncompressed
+ public static final byte[] EC128_FP_G_Y = new byte[]{
+ (byte) 0xCF, (byte) 0x5A, (byte) 0xC8, (byte) 0x39,
+ (byte) 0x5B, (byte) 0xAF, (byte) 0xEB, (byte) 0x13,
+ (byte) 0xC0, (byte) 0x2D, (byte) 0xA2, (byte) 0x92,
+ (byte) 0xDD, (byte) 0xED, (byte) 0x7A, (byte) 0x83
+ };
+ // Order of G
+ public static final byte[] EC128_FP_R = new byte[]{
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFE,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x75, (byte) 0xA3, (byte) 0x0D, (byte) 0x1B,
+ (byte) 0x90, (byte) 0x38, (byte) 0xA1, (byte) 0x15
+ };
+ // cofactor of G
+ public static final short EC128_FP_K = 1;
+
+ // secp160r1 from http://www.secg.org/sec2-v2.pdf
+ public static final byte[] EC160_FP_P = new byte[]{
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0x7F, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF
+ };
+
+ public static final byte[] EC160_FP_A = new byte[]{
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0x7F, (byte) 0xFF, (byte) 0xFF, (byte) 0xFC
+ };
+
+ public static final byte[] EC160_FP_B = new byte[]{
+ (byte) 0x1C, (byte) 0x97, (byte) 0xBE, (byte) 0xFC,
+ (byte) 0x54, (byte) 0xBD, (byte) 0x7A, (byte) 0x8B,
+ (byte) 0x65, (byte) 0xAC, (byte) 0xF8, (byte) 0x9F,
+ (byte) 0x81, (byte) 0xD4, (byte) 0xD4, (byte) 0xAD,
+ (byte) 0xC5, (byte) 0x65, (byte) 0xFA, (byte) 0x45
+ };
+
+ // G in compressed form / first part of ucompressed
+ public static final byte[] EC160_FP_G_X = new byte[]{
+ (byte) 0x4A, (byte) 0x96, (byte) 0xB5, (byte) 0x68,
+ (byte) 0x8E, (byte) 0xF5, (byte) 0x73, (byte) 0x28,
+ (byte) 0x46, (byte) 0x64, (byte) 0x69, (byte) 0x89,
+ (byte) 0x68, (byte) 0xC3, (byte) 0x8B, (byte) 0xB9,
+ (byte) 0x13, (byte) 0xCB, (byte) 0xFC, (byte) 0x82
+ };
+
+ // second part of G uncompressed
+ public static final byte[] EC160_FP_G_Y = new byte[]{
+ (byte) 0x23, (byte) 0xA6, (byte) 0x28, (byte) 0x55,
+ (byte) 0x31, (byte) 0x68, (byte) 0x94, (byte) 0x7D,
+ (byte) 0x59, (byte) 0xDC, (byte) 0xC9, (byte) 0x12,
+ (byte) 0x04, (byte) 0x23, (byte) 0x51, (byte) 0x37,
+ (byte) 0x7A, (byte) 0xC5, (byte) 0xFB, (byte) 0x32
+ };
+ // Order of G
+ public static final byte[] EC160_FP_R = new byte[]{
+ (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x01, (byte) 0xF4, (byte) 0xC8,
+ (byte) 0xF9, (byte) 0x27, (byte) 0xAE, (byte) 0xD3,
+ (byte) 0xCA, (byte) 0x75, (byte) 0x22, (byte) 0x57
+ };
+ // cofactor of G
+ public static final short EC160_FP_K = 1;
+
+
+ // secp192r1 from http://www.secg.org/sec2-v2.pdf
+ public static final byte[] EC192_FP_P = new byte[]{
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFE,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF
+ };
+ public static final byte[] EC192_FP_A = new byte[]{
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFE,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFC
+ };
+ public static final byte[] EC192_FP_B = new byte[]{
+ (byte) 0x64, (byte) 0x21, (byte) 0x05, (byte) 0x19,
+ (byte) 0xE5, (byte) 0x9C, (byte) 0x80, (byte) 0xE7,
+ (byte) 0x0F, (byte) 0xA7, (byte) 0xE9, (byte) 0xAB,
+ (byte) 0x72, (byte) 0x24, (byte) 0x30, (byte) 0x49,
+ (byte) 0xFE, (byte) 0xB8, (byte) 0xDE, (byte) 0xEC,
+ (byte) 0xC1, (byte) 0x46, (byte) 0xB9, (byte) 0xB1
+ };
+ // G in compressed form / first part of ucompressed
+ public static final byte[] EC192_FP_G_X = new byte[]{
+ (byte) 0x18, (byte) 0x8D, (byte) 0xA8, (byte) 0x0E,
+ (byte) 0xB0, (byte) 0x30, (byte) 0x90, (byte) 0xF6,
+ (byte) 0x7C, (byte) 0xBF, (byte) 0x20, (byte) 0xEB,
+ (byte) 0x43, (byte) 0xA1, (byte) 0x88, (byte) 0x00,
+ (byte) 0xF4, (byte) 0xFF, (byte) 0x0A, (byte) 0xFD,
+ (byte) 0x82, (byte) 0xFF, (byte) 0x10, (byte) 0x12
+ };
+ // second part of G uncompressed
+ public static final byte[] EC192_FP_G_Y = new byte[]{
+ (byte) 0x07, (byte) 0x19, (byte) 0x2B, (byte) 0x95,
+ (byte) 0xFF, (byte) 0xC8, (byte) 0xDA, (byte) 0x78,
+ (byte) 0x63, (byte) 0x10, (byte) 0x11, (byte) 0xED,
+ (byte) 0x6B, (byte) 0x24, (byte) 0xCD, (byte) 0xD5,
+ (byte) 0x73, (byte) 0xF9, (byte) 0x77, (byte) 0xA1,
+ (byte) 0x1E, (byte) 0x79, (byte) 0x48, (byte) 0x11
+ };
+ // Order of G
+ public static final byte[] EC192_FP_R = new byte[]{
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0x99, (byte) 0xDE, (byte) 0xF8, (byte) 0x36,
+ (byte) 0x14, (byte) 0x6B, (byte) 0xC9, (byte) 0xB1,
+ (byte) 0xB4, (byte) 0xD2, (byte) 0x28, (byte) 0x31
+ };
+ // cofactor of G
+ public static final short EC192_FP_K = 1;
+
+ // secp224r1 from http://www.secg.org/sec2-v2.pdf
+ public static final byte[] EC224_FP_P = new byte[]{
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x01
+ };
+
+ public static final byte[] EC224_FP_A = new byte[]{
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFE,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFE
+ };
+
+ public static final byte[] EC224_FP_B = new byte[]{
+ (byte) 0xB4, (byte) 0x05, (byte) 0x0A, (byte) 0x85,
+ (byte) 0x0C, (byte) 0x04, (byte) 0xB3, (byte) 0xAB,
+ (byte) 0xF5, (byte) 0x41, (byte) 0x32, (byte) 0x56,
+ (byte) 0x50, (byte) 0x44, (byte) 0xB0, (byte) 0xB7,
+ (byte) 0xD7, (byte) 0xBF, (byte) 0xD8, (byte) 0xBA,
+ (byte) 0x27, (byte) 0x0B, (byte) 0x39, (byte) 0x43,
+ (byte) 0x23, (byte) 0x55, (byte) 0xFF, (byte) 0xB4
+ };
+
+ // G in compressed form / first part of ucompressed
+ public static final byte[] EC224_FP_G_X = new byte[]{
+ (byte) 0xB7, (byte) 0x0E, (byte) 0x0C, (byte) 0xBD,
+ (byte) 0x6B, (byte) 0xB4, (byte) 0xBF, (byte) 0x7F,
+ (byte) 0x32, (byte) 0x13, (byte) 0x90, (byte) 0xB9,
+ (byte) 0x4A, (byte) 0x03, (byte) 0xC1, (byte) 0xD3,
+ (byte) 0x56, (byte) 0xC2, (byte) 0x11, (byte) 0x22,
+ (byte) 0x34, (byte) 0x32, (byte) 0x80, (byte) 0xD6,
+ (byte) 0x11, (byte) 0x5C, (byte) 0x1D, (byte) 0x21
+ };
+ // second part of G uncompressed
+ public static final byte[] EC224_FP_G_Y = new byte[]{
+ (byte) 0xBD, (byte) 0x37, (byte) 0x63, (byte) 0x88,
+ (byte) 0xB5, (byte) 0xF7, (byte) 0x23, (byte) 0xFB,
+ (byte) 0x4C, (byte) 0x22, (byte) 0xDF, (byte) 0xE6,
+ (byte) 0xCD, (byte) 0x43, (byte) 0x75, (byte) 0xA0,
+ (byte) 0x5A, (byte) 0x07, (byte) 0x47, (byte) 0x64,
+ (byte) 0x44, (byte) 0xD5, (byte) 0x81, (byte) 0x99,
+ (byte) 0x85, (byte) 0x00, (byte) 0x7E, (byte) 0x34
+ };
+ // Order of G
+ public static final byte[] EC224_FP_R = new byte[]{
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0x16, (byte) 0xA2,
+ (byte) 0xE0, (byte) 0xB8, (byte) 0xF0, (byte) 0x3E,
+ (byte) 0x13, (byte) 0xDD, (byte) 0x29, (byte) 0x45,
+ (byte) 0x5C, (byte) 0x5C, (byte) 0x2A, (byte) 0x3D
+ };
+ // cofactor of G
+ public static final short EC224_FP_K = 1;
+
+ // secp256r1 from http://www.secg.org/sec2-v2.pdf
+ public static final byte[] EC256_FP_P = new byte[]{
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x01,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF
+ };
+ public static final byte[] EC256_FP_A = new byte[]{
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x01,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFC
+ };
+ public static final byte[] EC256_FP_B = new byte[]{
+ (byte) 0x5A, (byte) 0xC6, (byte) 0x35, (byte) 0xD8,
+ (byte) 0xAA, (byte) 0x3A, (byte) 0x93, (byte) 0xE7,
+ (byte) 0xB3, (byte) 0xEB, (byte) 0xBD, (byte) 0x55,
+ (byte) 0x76, (byte) 0x98, (byte) 0x86, (byte) 0xBC,
+ (byte) 0x65, (byte) 0x1D, (byte) 0x06, (byte) 0xB0,
+ (byte) 0xCC, (byte) 0x53, (byte) 0xB0, (byte) 0xF6,
+ (byte) 0x3B, (byte) 0xCE, (byte) 0x3C, (byte) 0x3E,
+ (byte) 0x27, (byte) 0xD2, (byte) 0x60, (byte) 0x4B
+ };
+ // G in compressed form / first part of ucompressed
+ public static final byte[] EC256_FP_G_X = new byte[]{
+ (byte) 0x6B, (byte) 0x17, (byte) 0xD1, (byte) 0xF2,
+ (byte) 0xE1, (byte) 0x2C, (byte) 0x42, (byte) 0x47,
+ (byte) 0xF8, (byte) 0xBC, (byte) 0xE6, (byte) 0xE5,
+ (byte) 0x63, (byte) 0xA4, (byte) 0x40, (byte) 0xF2,
+ (byte) 0x77, (byte) 0x03, (byte) 0x7D, (byte) 0x81,
+ (byte) 0x2D, (byte) 0xEB, (byte) 0x33, (byte) 0xA0,
+ (byte) 0xF4, (byte) 0xA1, (byte) 0x39, (byte) 0x45,
+ (byte) 0xD8, (byte) 0x98, (byte) 0xC2, (byte) 0x96
+ };
+ // second part of G uncompressed
+ public static final byte[] EC256_FP_G_Y = new byte[]{
+ (byte) 0x4F, (byte) 0xE3, (byte) 0x42, (byte) 0xE2,
+ (byte) 0xFE, (byte) 0x1A, (byte) 0x7F, (byte) 0x9B,
+ (byte) 0x8E, (byte) 0xE7, (byte) 0xEB, (byte) 0x4A,
+ (byte) 0x7C, (byte) 0x0F, (byte) 0x9E, (byte) 0x16,
+ (byte) 0x2B, (byte) 0xCE, (byte) 0x33, (byte) 0x57,
+ (byte) 0x6B, (byte) 0x31, (byte) 0x5E, (byte) 0xCE,
+ (byte) 0xCB, (byte) 0xB6, (byte) 0x40, (byte) 0x68,
+ (byte) 0x37, (byte) 0xBF, (byte) 0x51, (byte) 0xF5
+ };
+ // Order of G
+ public static final byte[] EC256_FP_R = new byte[]{
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xBC, (byte) 0xE6, (byte) 0xFA, (byte) 0xAD,
+ (byte) 0xA7, (byte) 0x17, (byte) 0x9E, (byte) 0x84,
+ (byte) 0xF3, (byte) 0xB9, (byte) 0xCA, (byte) 0xC2,
+ (byte) 0xFC, (byte) 0x63, (byte) 0x25, (byte) 0x51
+ };
+ // cofactor of G
+ public static final short EC256_FP_K = 1;
+
+ // secp384r1 from http://www.secg.org/sec2-v2.pdf
+ public static final byte[] EC384_FP_P = new byte[]{
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFE,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF
+ };
+
+ public static final byte[] EC384_FP_A = new byte[]{
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFE,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFC
+ };
+
+ public static final byte[] EC384_FP_B = new byte[]{
+ (byte) 0xB3, (byte) 0x31, (byte) 0x2F, (byte) 0xA7,
+ (byte) 0xE2, (byte) 0x3E, (byte) 0xE7, (byte) 0xE4,
+ (byte) 0x98, (byte) 0x8E, (byte) 0x05, (byte) 0x6B,
+ (byte) 0xE3, (byte) 0xF8, (byte) 0x2D, (byte) 0x19,
+ (byte) 0x18, (byte) 0x1D, (byte) 0x9C, (byte) 0x6E,
+ (byte) 0xFE, (byte) 0x81, (byte) 0x41, (byte) 0x12,
+ (byte) 0x03, (byte) 0x14, (byte) 0x08, (byte) 0x8F,
+ (byte) 0x50, (byte) 0x13, (byte) 0x87, (byte) 0x5A,
+ (byte) 0xC6, (byte) 0x56, (byte) 0x39, (byte) 0x8D,
+ (byte) 0x8A, (byte) 0x2E, (byte) 0xD1, (byte) 0x9D,
+ (byte) 0x2A, (byte) 0x85, (byte) 0xC8, (byte) 0xED,
+ (byte) 0xD3, (byte) 0xEC, (byte) 0x2A, (byte) 0xEF
+ };
+
+ // G in compressed form / first part of ucompressed
+ public static final byte[] EC384_FP_G_X = new byte[]{
+ (byte) 0xAA, (byte) 0x87, (byte) 0xCA, (byte) 0x22,
+ (byte) 0xBE, (byte) 0x8B, (byte) 0x05, (byte) 0x37,
+ (byte) 0x8E, (byte) 0xB1, (byte) 0xC7, (byte) 0x1E,
+ (byte) 0xF3, (byte) 0x20, (byte) 0xAD, (byte) 0x74,
+ (byte) 0x6E, (byte) 0x1D, (byte) 0x3B, (byte) 0x62,
+ (byte) 0x8B, (byte) 0xA7, (byte) 0x9B, (byte) 0x98,
+ (byte) 0x59, (byte) 0xF7, (byte) 0x41, (byte) 0xE0,
+ (byte) 0x82, (byte) 0x54, (byte) 0x2A, (byte) 0x38,
+ (byte) 0x55, (byte) 0x02, (byte) 0xF2, (byte) 0x5D,
+ (byte) 0xBF, (byte) 0x55, (byte) 0x29, (byte) 0x6C,
+ (byte) 0x3A, (byte) 0x54, (byte) 0x5E, (byte) 0x38,
+ (byte) 0x72, (byte) 0x76, (byte) 0x0A, (byte) 0xB7
+ };
+ // second part of G uncompressed
+ public static final byte[] EC384_FP_G_Y = new byte[]{
+ (byte) 0x36, (byte) 0x17, (byte) 0xDE, (byte) 0x4A,
+ (byte) 0x96, (byte) 0x26, (byte) 0x2C, (byte) 0x6F,
+ (byte) 0x5D, (byte) 0x9E, (byte) 0x98, (byte) 0xBF,
+ (byte) 0x92, (byte) 0x92, (byte) 0xDC, (byte) 0x29,
+ (byte) 0xF8, (byte) 0xF4, (byte) 0x1D, (byte) 0xBD,
+ (byte) 0x28, (byte) 0x9A, (byte) 0x14, (byte) 0x7C,
+ (byte) 0xE9, (byte) 0xDA, (byte) 0x31, (byte) 0x13,
+ (byte) 0xB5, (byte) 0xF0, (byte) 0xB8, (byte) 0xC0,
+ (byte) 0x0A, (byte) 0x60, (byte) 0xB1, (byte) 0xCE,
+ (byte) 0x1D, (byte) 0x7E, (byte) 0x81, (byte) 0x9D,
+ (byte) 0x7A, (byte) 0x43, (byte) 0x1D, (byte) 0x7C,
+ (byte) 0x90, (byte) 0xEA, (byte) 0x0E, (byte) 0x5F
+ };
+
+ // Order of G
+ public static final byte[] EC384_FP_R = new byte[]{
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xC7, (byte) 0x63, (byte) 0x4D, (byte) 0x81,
+ (byte) 0xF4, (byte) 0x37, (byte) 0x2D, (byte) 0xDF,
+ (byte) 0x58, (byte) 0x1A, (byte) 0x0D, (byte) 0xB2,
+ (byte) 0x48, (byte) 0xB0, (byte) 0xA7, (byte) 0x7A,
+ (byte) 0xEC, (byte) 0xEC, (byte) 0x19, (byte) 0x6A,
+ (byte) 0xCC, (byte) 0xC5, (byte) 0x29, (byte) 0x73
+ };
+ // cofactor of G
+ public static final short EC384_FP_K = 1;
+
+
+ // secp521r1 from http://www.secg.org/sec2-v2.pdf
+ public static final byte[] EC521_FP_P = new byte[]{
+ (byte) 0x01, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF
+ };
+
+ public static final byte[] EC521_FP_A = new byte[]{
+ (byte) 0x01, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFC
+ };
+
+ public static final byte[] EC521_FP_B = new byte[]{
+ (byte) 0x00, (byte) 0x51, (byte) 0x95, (byte) 0x3E,
+ (byte) 0xB9, (byte) 0x61, (byte) 0x8E, (byte) 0x1C,
+ (byte) 0x9A, (byte) 0x1F, (byte) 0x92, (byte) 0x9A,
+ (byte) 0x21, (byte) 0xA0, (byte) 0xB6, (byte) 0x85,
+ (byte) 0x40, (byte) 0xEE, (byte) 0xA2, (byte) 0xDA,
+ (byte) 0x72, (byte) 0x5B, (byte) 0x99, (byte) 0xB3,
+ (byte) 0x15, (byte) 0xF3, (byte) 0xB8, (byte) 0xB4,
+ (byte) 0x89, (byte) 0x91, (byte) 0x8E, (byte) 0xF1,
+ (byte) 0x09, (byte) 0xE1, (byte) 0x56, (byte) 0x19,
+ (byte) 0x39, (byte) 0x51, (byte) 0xEC, (byte) 0x7E,
+ (byte) 0x93, (byte) 0x7B, (byte) 0x16, (byte) 0x52,
+ (byte) 0xC0, (byte) 0xBD, (byte) 0x3B, (byte) 0xB1,
+ (byte) 0xBF, (byte) 0x07, (byte) 0x35, (byte) 0x73,
+ (byte) 0xDF, (byte) 0x88, (byte) 0x3D, (byte) 0x2C,
+ (byte) 0x34, (byte) 0xF1, (byte) 0xEF, (byte) 0x45,
+ (byte) 0x1F, (byte) 0xD4, (byte) 0x6B, (byte) 0x50,
+ (byte) 0x3F, (byte) 0x00
+ };
+
+ // G in compressed form / first part of ucompressed
+ public static final byte[] EC521_FP_G_X = new byte[]{
+ (byte) 0x00, (byte) 0xC6, (byte) 0x85, (byte) 0x8E,
+ (byte) 0x06, (byte) 0xB7, (byte) 0x04, (byte) 0x04,
+ (byte) 0xE9, (byte) 0xCD, (byte) 0x9E, (byte) 0x3E,
+ (byte) 0xCB, (byte) 0x66, (byte) 0x23, (byte) 0x95,
+ (byte) 0xB4, (byte) 0x42, (byte) 0x9C, (byte) 0x64,
+ (byte) 0x81, (byte) 0x39, (byte) 0x05, (byte) 0x3F,
+ (byte) 0xB5, (byte) 0x21, (byte) 0xF8, (byte) 0x28,
+ (byte) 0xAF, (byte) 0x60, (byte) 0x6B, (byte) 0x4D,
+ (byte) 0x3D, (byte) 0xBA, (byte) 0xA1, (byte) 0x4B,
+ (byte) 0x5E, (byte) 0x77, (byte) 0xEF, (byte) 0xE7,
+ (byte) 0x59, (byte) 0x28, (byte) 0xFE, (byte) 0x1D,
+ (byte) 0xC1, (byte) 0x27, (byte) 0xA2, (byte) 0xFF,
+ (byte) 0xA8, (byte) 0xDE, (byte) 0x33, (byte) 0x48,
+ (byte) 0xB3, (byte) 0xC1, (byte) 0x85, (byte) 0x6A,
+ (byte) 0x42, (byte) 0x9B, (byte) 0xF9, (byte) 0x7E,
+ (byte) 0x7E, (byte) 0x31, (byte) 0xC2, (byte) 0xE5,
+ (byte) 0xBD, (byte) 0x66
+ };
+
+ // second part of G uncompressed
+ public static final byte[] EC521_FP_G_Y = new byte[]{
+ (byte) 0x01, (byte) 0x18, (byte) 0x39, (byte) 0x29,
+ (byte) 0x6A, (byte) 0x78, (byte) 0x9A, (byte) 0x3B,
+ (byte) 0xC0, (byte) 0x04, (byte) 0x5C, (byte) 0x8A,
+ (byte) 0x5F, (byte) 0xB4, (byte) 0x2C, (byte) 0x7D,
+ (byte) 0x1B, (byte) 0xD9, (byte) 0x98, (byte) 0xF5,
+ (byte) 0x44, (byte) 0x49, (byte) 0x57, (byte) 0x9B,
+ (byte) 0x44, (byte) 0x68, (byte) 0x17, (byte) 0xAF,
+ (byte) 0xBD, (byte) 0x17, (byte) 0x27, (byte) 0x3E,
+ (byte) 0x66, (byte) 0x2C, (byte) 0x97, (byte) 0xEE,
+ (byte) 0x72, (byte) 0x99, (byte) 0x5E, (byte) 0xF4,
+ (byte) 0x26, (byte) 0x40, (byte) 0xC5, (byte) 0x50,
+ (byte) 0xB9, (byte) 0x01, (byte) 0x3F, (byte) 0xAD,
+ (byte) 0x07, (byte) 0x61, (byte) 0x35, (byte) 0x3C,
+ (byte) 0x70, (byte) 0x86, (byte) 0xA2, (byte) 0x72,
+ (byte) 0xC2, (byte) 0x40, (byte) 0x88, (byte) 0xBE,
+ (byte) 0x94, (byte) 0x76, (byte) 0x9F, (byte) 0xD1,
+ (byte) 0x66, (byte) 0x50
+ };
+
+ // Order of G
+ public static final byte[] EC521_FP_R = new byte[]{
+ (byte) 0x01, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFA,
+ (byte) 0x51, (byte) 0x86, (byte) 0x87, (byte) 0x83,
+ (byte) 0xBF, (byte) 0x2F, (byte) 0x96, (byte) 0x6B,
+ (byte) 0x7F, (byte) 0xCC, (byte) 0x01, (byte) 0x48,
+ (byte) 0xF7, (byte) 0x09, (byte) 0xA5, (byte) 0xD0,
+ (byte) 0x3B, (byte) 0xB5, (byte) 0xC9, (byte) 0xB8,
+ (byte) 0x89, (byte) 0x9C, (byte) 0x47, (byte) 0xAE,
+ (byte) 0xBB, (byte) 0x6F, (byte) 0xB7, (byte) 0x1E,
+ (byte) 0x91, (byte) 0x38, (byte) 0x64, (byte) 0x09
+ };
+
+ // cofactor of G
+ public static final short EC521_FP_K = 1;
+
+ //sect163r1 from http://www.secg.org/sec2-v2.pdf
+ // [short i1, short i2, short i3] f = x^163 + x^i1 + x^i2 + x^i3 + 1
+ public static final byte[] EC163_F2M_F = new byte[]{
+ (byte) 0x00, (byte) 0x07,
+ (byte) 0x00, (byte) 0x06,
+ (byte) 0x00, (byte) 0x03
+ };
+
+ public static final byte[] EC163_F2M_A = new byte[]{
+ (byte) 0x07, (byte) 0xB6, (byte) 0x88, (byte) 0x2C,
+ (byte) 0xAA, (byte) 0xEF, (byte) 0xA8, (byte) 0x4F,
+ (byte) 0x95, (byte) 0x54, (byte) 0xFF, (byte) 0x84,
+ (byte) 0x28, (byte) 0xBD, (byte) 0x88, (byte) 0xE2,
+ (byte) 0x46, (byte) 0xD2, (byte) 0x78, (byte) 0x2A,
+ (byte) 0xE2
+ };
+
+ public static final byte[] EC163_F2M_B = new byte[]{
+ (byte) 0x07, (byte) 0x13, (byte) 0x61, (byte) 0x2D,
+ (byte) 0xCD, (byte) 0xDC, (byte) 0xB4, (byte) 0x0A,
+ (byte) 0xAB, (byte) 0x94, (byte) 0x6B, (byte) 0xDA,
+ (byte) 0x29, (byte) 0xCA, (byte) 0x91, (byte) 0xF7,
+ (byte) 0x3A, (byte) 0xF9, (byte) 0x58, (byte) 0xAF,
+ (byte) 0xD9
+ };
+
+ // G in compressed form / first part of ucompressed
+ public static final byte[] EC163_F2M_G_X = new byte[]{
+ (byte) 0x03, (byte) 0x69, (byte) 0x97, (byte) 0x96,
+ (byte) 0x97, (byte) 0xAB, (byte) 0x43, (byte) 0x89,
+ (byte) 0x77, (byte) 0x89, (byte) 0x56, (byte) 0x67,
+ (byte) 0x89, (byte) 0x56, (byte) 0x7F, (byte) 0x78,
+ (byte) 0x7A, (byte) 0x78, (byte) 0x76, (byte) 0xA6,
+ (byte) 0x54
+ };
+
+ // second part of G uncompressed
+ public static final byte[] EC163_F2M_G_Y = new byte[]{
+ (byte) 0x00, (byte) 0x43, (byte) 0x5E, (byte) 0xDB,
+ (byte) 0x42, (byte) 0xEF, (byte) 0xAF, (byte) 0xB2,
+ (byte) 0x98, (byte) 0x9D, (byte) 0x51, (byte) 0xFE,
+ (byte) 0xFC, (byte) 0xE3, (byte) 0xC8, (byte) 0x09,
+ (byte) 0x88, (byte) 0xF4, (byte) 0x1F, (byte) 0xF8,
+ (byte) 0x83
+ };
+
+ // order of G
+ public static final byte[] EC163_F2M_R = new byte[]{
+ (byte) 0x03, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0x48,
+ (byte) 0xAA, (byte) 0xB6, (byte) 0x89, (byte) 0xC2,
+ (byte) 0x9C, (byte) 0xA7, (byte) 0x10, (byte) 0x27,
+ (byte) 0x9B
+ };
+
+ // cofactor of G
+ public static final short EC163_F2M_K = 2;
+
+ //sect233r1 from http://www.secg.org/sec2-v2.pdf
+ // [short i1, short i2, short i3] f = x^233 + x^i1 + 1
+ public static final byte[] EC233_F2M_F = new byte[]{
+ (byte) 0x00, (byte) 0x4a
+ };
+
+ public static final byte[] EC233_F2M_A = new byte[]{
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x01
+ };
+
+ public static final byte[] EC233_F2M_B = new byte[]{
+ (byte) 0x00, (byte) 0x66, (byte) 0x64, (byte) 0x7E,
+ (byte) 0xDE, (byte) 0x6C, (byte) 0x33, (byte) 0x2C,
+ (byte) 0x7F, (byte) 0x8C, (byte) 0x09, (byte) 0x23,
+ (byte) 0xBB, (byte) 0x58, (byte) 0x21, (byte) 0x3B,
+ (byte) 0x33, (byte) 0x3B, (byte) 0x20, (byte) 0xE9,
+ (byte) 0xCE, (byte) 0x42, (byte) 0x81, (byte) 0xFE,
+ (byte) 0x11, (byte) 0x5F, (byte) 0x7D, (byte) 0x8F,
+ (byte) 0x90, (byte) 0xAD
+ };
+
+ // G in compressed form / first part of ucompressed
+ public static final byte[] EC233_F2M_G_X = new byte[]{
+ (byte) 0x00, (byte) 0xFA, (byte) 0xC9, (byte) 0xDF,
+ (byte) 0xCB, (byte) 0xAC, (byte) 0x83, (byte) 0x13,
+ (byte) 0xBB, (byte) 0x21, (byte) 0x39, (byte) 0xF1,
+ (byte) 0xBB, (byte) 0x75, (byte) 0x5F, (byte) 0xEF,
+ (byte) 0x65, (byte) 0xBC, (byte) 0x39, (byte) 0x1F,
+ (byte) 0x8B, (byte) 0x36, (byte) 0xF8, (byte) 0xF8,
+ (byte) 0xEB, (byte) 0x73, (byte) 0x71, (byte) 0xFD,
+ (byte) 0x55, (byte) 0x8B
+ };
+
+ // second part of G uncompressed
+ public static final byte[] EC233_F2M_G_Y = new byte[]{
+ (byte) 0x01, (byte) 0x00, (byte) 0x6A, (byte) 0x08,
+ (byte) 0xA4, (byte) 0x19, (byte) 0x03, (byte) 0x35,
+ (byte) 0x06, (byte) 0x78, (byte) 0xE5, (byte) 0x85,
+ (byte) 0x28, (byte) 0xBE, (byte) 0xBF, (byte) 0x8A,
+ (byte) 0x0B, (byte) 0xEF, (byte) 0xF8, (byte) 0x67,
+ (byte) 0xA7, (byte) 0xCA, (byte) 0x36, (byte) 0x71,
+ (byte) 0x6F, (byte) 0x7E, (byte) 0x01, (byte) 0xF8,
+ (byte) 0x10, (byte) 0x52
+ };
+
+ // order of G
+ public static final byte[] EC233_F2M_R = new byte[]{
+ (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x13,
+ (byte) 0xE9, (byte) 0x74, (byte) 0xE7, (byte) 0x2F,
+ (byte) 0x8A, (byte) 0x69, (byte) 0x22, (byte) 0x03,
+ (byte) 0x1D, (byte) 0x26, (byte) 0x03, (byte) 0xCF,
+ (byte) 0xE0, (byte) 0xD7
+ };
+
+ // cofactor of G
+ public static final short EC233_F2M_K = 2;
+
+ //sect283r1 from http://www.secg.org/sec2-v2.pdf
+ // [short i1, short i2, short i3] f = x^283 + x^i1 + x^i2 + x^i3 + 1
+ public static final byte[] EC283_F2M_F = new byte[]{
+ (byte) 0x00, (byte) 0x0c,
+ (byte) 0x00, (byte) 0x07,
+ (byte) 0x00, (byte) 0x05
+ };
+
+ public static final byte[] EC283_F2M_A = new byte[]{
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x01
+ };
+
+ public static final byte[] EC283_F2M_B = new byte[]{
+ (byte) 0x02, (byte) 0x7B, (byte) 0x68, (byte) 0x0A,
+ (byte) 0xC8, (byte) 0xB8, (byte) 0x59, (byte) 0x6D,
+ (byte) 0xA5, (byte) 0xA4, (byte) 0xAF, (byte) 0x8A,
+ (byte) 0x19, (byte) 0xA0, (byte) 0x30, (byte) 0x3F,
+ (byte) 0xCA, (byte) 0x97, (byte) 0xFD, (byte) 0x76,
+ (byte) 0x45, (byte) 0x30, (byte) 0x9F, (byte) 0xA2,
+ (byte) 0xA5, (byte) 0x81, (byte) 0x48, (byte) 0x5A,
+ (byte) 0xF6, (byte) 0x26, (byte) 0x3E, (byte) 0x31,
+ (byte) 0x3B, (byte) 0x79, (byte) 0xA2, (byte) 0xF5
+ };
+
+ // G in compressed form / first part of ucompressed
+ public static final byte[] EC283_F2M_G_X = new byte[]{
+ (byte) 0x05, (byte) 0xF9, (byte) 0x39, (byte) 0x25,
+ (byte) 0x8D, (byte) 0xB7, (byte) 0xDD, (byte) 0x90,
+ (byte) 0xE1, (byte) 0x93, (byte) 0x4F, (byte) 0x8C,
+ (byte) 0x70, (byte) 0xB0, (byte) 0xDF, (byte) 0xEC,
+ (byte) 0x2E, (byte) 0xED, (byte) 0x25, (byte) 0xB8,
+ (byte) 0x55, (byte) 0x7E, (byte) 0xAC, (byte) 0x9C,
+ (byte) 0x80, (byte) 0xE2, (byte) 0xE1, (byte) 0x98,
+ (byte) 0xF8, (byte) 0xCD, (byte) 0xBE, (byte) 0xCD,
+ (byte) 0x86, (byte) 0xB1, (byte) 0x20, (byte) 0x53
+ };
+
+ // second part of G uncompressed
+ public static final byte[] EC283_F2M_G_Y = new byte[]{
+ (byte) 0x03, (byte) 0x67, (byte) 0x68, (byte) 0x54,
+ (byte) 0xFE, (byte) 0x24, (byte) 0x14, (byte) 0x1C,
+ (byte) 0xB9, (byte) 0x8F, (byte) 0xE6, (byte) 0xD4,
+ (byte) 0xB2, (byte) 0x0D, (byte) 0x02, (byte) 0xB4,
+ (byte) 0x51, (byte) 0x6F, (byte) 0xF7, (byte) 0x02,
+ (byte) 0x35, (byte) 0x0E, (byte) 0xDD, (byte) 0xB0,
+ (byte) 0x82, (byte) 0x67, (byte) 0x79, (byte) 0xC8,
+ (byte) 0x13, (byte) 0xF0, (byte) 0xDF, (byte) 0x45,
+ (byte) 0xBE, (byte) 0x81, (byte) 0x12, (byte) 0xF4
+ };
+
+ // order of G
+ public static final byte[] EC283_F2M_R = new byte[]{
+ (byte) 0x03, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xEF, (byte) 0x90,
+ (byte) 0x39, (byte) 0x96, (byte) 0x60, (byte) 0xFC,
+ (byte) 0x93, (byte) 0x8A, (byte) 0x90, (byte) 0x16,
+ (byte) 0x5B, (byte) 0x04, (byte) 0x2A, (byte) 0x7C,
+ (byte) 0xEF, (byte) 0xAD, (byte) 0xB3, (byte) 0x07
+ };
+
+ // cofactor of G
+ public static final short EC283_F2M_K = 2;
+
+ //sect409r1 from http://www.secg.org/sec2-v2.pdf
+ // [short i1, short i2, short i3] f = x^409 + x^i1 + 1
+ public static final byte[] EC409_F2M_F = new byte[]{
+ (byte) 0x00, (byte) 0x57
+ };
+
+ public static final byte[] EC409_F2M_A = new byte[]{
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x01
+ };
+
+ public static final byte[] EC409_F2M_B = new byte[]{
+ (byte) 0x00, (byte) 0x21, (byte) 0xA5, (byte) 0xC2,
+ (byte) 0xC8, (byte) 0xEE, (byte) 0x9F, (byte) 0xEB,
+ (byte) 0x5C, (byte) 0x4B, (byte) 0x9A, (byte) 0x75,
+ (byte) 0x3B, (byte) 0x7B, (byte) 0x47, (byte) 0x6B,
+ (byte) 0x7F, (byte) 0xD6, (byte) 0x42, (byte) 0x2E,
+ (byte) 0xF1, (byte) 0xF3, (byte) 0xDD, (byte) 0x67,
+ (byte) 0x47, (byte) 0x61, (byte) 0xFA, (byte) 0x99,
+ (byte) 0xD6, (byte) 0xAC, (byte) 0x27, (byte) 0xC8,
+ (byte) 0xA9, (byte) 0xA1, (byte) 0x97, (byte) 0xB2,
+ (byte) 0x72, (byte) 0x82, (byte) 0x2F, (byte) 0x6C,
+ (byte) 0xD5, (byte) 0x7A, (byte) 0x55, (byte) 0xAA,
+ (byte) 0x4F, (byte) 0x50, (byte) 0xAE, (byte) 0x31,
+ (byte) 0x7B, (byte) 0x13, (byte) 0x54, (byte) 0x5F
+ };
+
+ // G in compressed form / first part of ucompressed
+ public static final byte[] EC409_F2M_G_X = new byte[]{
+ (byte) 0x01, (byte) 0x5D, (byte) 0x48, (byte) 0x60,
+ (byte) 0xD0, (byte) 0x88, (byte) 0xDD, (byte) 0xB3,
+ (byte) 0x49, (byte) 0x6B, (byte) 0x0C, (byte) 0x60,
+ (byte) 0x64, (byte) 0x75, (byte) 0x62, (byte) 0x60,
+ (byte) 0x44, (byte) 0x1C, (byte) 0xDE, (byte) 0x4A,
+ (byte) 0xF1, (byte) 0x77, (byte) 0x1D, (byte) 0x4D,
+ (byte) 0xB0, (byte) 0x1F, (byte) 0xFE, (byte) 0x5B,
+ (byte) 0x34, (byte) 0xE5, (byte) 0x97, (byte) 0x03,
+ (byte) 0xDC, (byte) 0x25, (byte) 0x5A, (byte) 0x86,
+ (byte) 0x8A, (byte) 0x11, (byte) 0x80, (byte) 0x51,
+ (byte) 0x56, (byte) 0x03, (byte) 0xAE, (byte) 0xAB,
+ (byte) 0x60, (byte) 0x79, (byte) 0x4E, (byte) 0x54,
+ (byte) 0xBB, (byte) 0x79, (byte) 0x96, (byte) 0xA7
+ };
+
+ // second part of G uncompressed
+ public static final byte[] EC409_F2M_G_Y = new byte[]{
+ (byte) 0x00, (byte) 0x61, (byte) 0xB1, (byte) 0xCF,
+ (byte) 0xAB, (byte) 0x6B, (byte) 0xE5, (byte) 0xF3,
+ (byte) 0x2B, (byte) 0xBF, (byte) 0xA7, (byte) 0x83,
+ (byte) 0x24, (byte) 0xED, (byte) 0x10, (byte) 0x6A,
+ (byte) 0x76, (byte) 0x36, (byte) 0xB9, (byte) 0xC5,
+ (byte) 0xA7, (byte) 0xBD, (byte) 0x19, (byte) 0x8D,
+ (byte) 0x01, (byte) 0x58, (byte) 0xAA, (byte) 0x4F,
+ (byte) 0x54, (byte) 0x88, (byte) 0xD0, (byte) 0x8F,
+ (byte) 0x38, (byte) 0x51, (byte) 0x4F, (byte) 0x1F,
+ (byte) 0xDF, (byte) 0x4B, (byte) 0x4F, (byte) 0x40,
+ (byte) 0xD2, (byte) 0x18, (byte) 0x1B, (byte) 0x36,
+ (byte) 0x81, (byte) 0xC3, (byte) 0x64, (byte) 0xBA,
+ (byte) 0x02, (byte) 0x73, (byte) 0xC7, (byte) 0x06
+ };
+
+ // order of G
+ public static final byte[] EC409_F2M_R = new byte[]{
+ (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x01, (byte) 0xE2,
+ (byte) 0xAA, (byte) 0xD6, (byte) 0xA6, (byte) 0x12,
+ (byte) 0xF3, (byte) 0x33, (byte) 0x07, (byte) 0xBE,
+ (byte) 0x5F, (byte) 0xA4, (byte) 0x7C, (byte) 0x3C,
+ (byte) 0x9E, (byte) 0x05, (byte) 0x2F, (byte) 0x83,
+ (byte) 0x81, (byte) 0x64, (byte) 0xCD, (byte) 0x37,
+ (byte) 0xD9, (byte) 0xA2, (byte) 0x11, (byte) 0x73
+ };
+
+ // cofactor of G
+ public static final short EC409_F2M_K = 2;
+
+ //sect571r1 from http://www.secg.org/sec2-v2.pdf
+ // [short i1, short i2, short i3] f = x^571 + x^i1 + x^i2 + x^i3 + 1
+ public static final byte[] EC571_F2M_F = new byte[]{
+ (byte) 0x00, (byte) 0x0a,
+ (byte) 0x00, (byte) 0x05,
+ (byte) 0x00, (byte) 0x02,
+ };
+
+ public static final byte[] EC571_F2M_A = new byte[]{
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x01
+ };
+
+ public static final byte[] EC571_F2M_B = new byte[]{
+ (byte) 0x02, (byte) 0xF4, (byte) 0x0E, (byte) 0x7E,
+ (byte) 0x22, (byte) 0x21, (byte) 0xF2, (byte) 0x95,
+ (byte) 0xDE, (byte) 0x29, (byte) 0x71, (byte) 0x17,
+ (byte) 0xB7, (byte) 0xF3, (byte) 0xD6, (byte) 0x2F,
+ (byte) 0x5C, (byte) 0x6A, (byte) 0x97, (byte) 0xFF,
+ (byte) 0xCB, (byte) 0x8C, (byte) 0xEF, (byte) 0xF1,
+ (byte) 0xCD, (byte) 0x6B, (byte) 0xA8, (byte) 0xCE,
+ (byte) 0x4A, (byte) 0x9A, (byte) 0x18, (byte) 0xAD,
+ (byte) 0x84, (byte) 0xFF, (byte) 0xAB, (byte) 0xBD,
+ (byte) 0x8E, (byte) 0xFA, (byte) 0x59, (byte) 0x33,
+ (byte) 0x2B, (byte) 0xE7, (byte) 0xAD, (byte) 0x67,
+ (byte) 0x56, (byte) 0xA6, (byte) 0x6E, (byte) 0x29,
+ (byte) 0x4A, (byte) 0xFD, (byte) 0x18, (byte) 0x5A,
+ (byte) 0x78, (byte) 0xFF, (byte) 0x12, (byte) 0xAA,
+ (byte) 0x52, (byte) 0x0E, (byte) 0x4D, (byte) 0xE7,
+ (byte) 0x39, (byte) 0xBA, (byte) 0xCA, (byte) 0x0C,
+ (byte) 0x7F, (byte) 0xFE, (byte) 0xFF, (byte) 0x7F,
+ (byte) 0x29, (byte) 0x55, (byte) 0x72, (byte) 0x7A
+ };
+
+ // G in compressed form / first part of ucompressed
+ public static final byte[] EC571_F2M_G_X = new byte[]{
+ (byte) 0x03, (byte) 0x03, (byte) 0x00, (byte) 0x1D,
+ (byte) 0x34, (byte) 0xB8, (byte) 0x56, (byte) 0x29,
+ (byte) 0x6C, (byte) 0x16, (byte) 0xC0, (byte) 0xD4,
+ (byte) 0x0D, (byte) 0x3C, (byte) 0xD7, (byte) 0x75,
+ (byte) 0x0A, (byte) 0x93, (byte) 0xD1, (byte) 0xD2,
+ (byte) 0x95, (byte) 0x5F, (byte) 0xA8, (byte) 0x0A,
+ (byte) 0xA5, (byte) 0xF4, (byte) 0x0F, (byte) 0xC8,
+ (byte) 0xDB, (byte) 0x7B, (byte) 0x2A, (byte) 0xBD,
+ (byte) 0xBD, (byte) 0xE5, (byte) 0x39, (byte) 0x50,
+ (byte) 0xF4, (byte) 0xC0, (byte) 0xD2, (byte) 0x93,
+ (byte) 0xCD, (byte) 0xD7, (byte) 0x11, (byte) 0xA3,
+ (byte) 0x5B, (byte) 0x67, (byte) 0xFB, (byte) 0x14,
+ (byte) 0x99, (byte) 0xAE, (byte) 0x60, (byte) 0x03,
+ (byte) 0x86, (byte) 0x14, (byte) 0xF1, (byte) 0x39,
+ (byte) 0x4A, (byte) 0xBF, (byte) 0xA3, (byte) 0xB4,
+ (byte) 0xC8, (byte) 0x50, (byte) 0xD9, (byte) 0x27,
+ (byte) 0xE1, (byte) 0xE7, (byte) 0x76, (byte) 0x9C,
+ (byte) 0x8E, (byte) 0xEC, (byte) 0x2D, (byte) 0x19
+ };
+
+ // second part of G uncompressed
+ public static final byte[] EC571_F2M_G_Y = new byte[]{
+ (byte) 0x03, (byte) 0x7B, (byte) 0xF2, (byte) 0x73,
+ (byte) 0x42, (byte) 0xDA, (byte) 0x63, (byte) 0x9B,
+ (byte) 0x6D, (byte) 0xCC, (byte) 0xFF, (byte) 0xFE,
+ (byte) 0xB7, (byte) 0x3D, (byte) 0x69, (byte) 0xD7,
+ (byte) 0x8C, (byte) 0x6C, (byte) 0x27, (byte) 0xA6,
+ (byte) 0x00, (byte) 0x9C, (byte) 0xBB, (byte) 0xCA,
+ (byte) 0x19, (byte) 0x80, (byte) 0xF8, (byte) 0x53,
+ (byte) 0x39, (byte) 0x21, (byte) 0xE8, (byte) 0xA6,
+ (byte) 0x84, (byte) 0x42, (byte) 0x3E, (byte) 0x43,
+ (byte) 0xBA, (byte) 0xB0, (byte) 0x8A, (byte) 0x57,
+ (byte) 0x62, (byte) 0x91, (byte) 0xAF, (byte) 0x8F,
+ (byte) 0x46, (byte) 0x1B, (byte) 0xB2, (byte) 0xA8,
+ (byte) 0xB3, (byte) 0x53, (byte) 0x1D, (byte) 0x2F,
+ (byte) 0x04, (byte) 0x85, (byte) 0xC1, (byte) 0x9B,
+ (byte) 0x16, (byte) 0xE2, (byte) 0xF1, (byte) 0x51,
+ (byte) 0x6E, (byte) 0x23, (byte) 0xDD, (byte) 0x3C,
+ (byte) 0x1A, (byte) 0x48, (byte) 0x27, (byte) 0xAF,
+ (byte) 0x1B, (byte) 0x8A, (byte) 0xC1, (byte) 0x5B
+ };
+
+ // order of G
+ public static final byte[] EC571_F2M_R = new byte[]{
+ (byte) 0x03, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ (byte) 0xE6, (byte) 0x61, (byte) 0xCE, (byte) 0x18,
+ (byte) 0xFF, (byte) 0x55, (byte) 0x98, (byte) 0x73,
+ (byte) 0x08, (byte) 0x05, (byte) 0x9B, (byte) 0x18,
+ (byte) 0x68, (byte) 0x23, (byte) 0x85, (byte) 0x1E,
+ (byte) 0xC7, (byte) 0xDD, (byte) 0x9C, (byte) 0xA1,
+ (byte) 0x16, (byte) 0x1D, (byte) 0xE9, (byte) 0x3D,
+ (byte) 0x51, (byte) 0x74, (byte) 0xD6, (byte) 0x6E,
+ (byte) 0x83, (byte) 0x82, (byte) 0xE9, (byte) 0xBB,
+ (byte) 0x2F, (byte) 0xE8, (byte) 0x4E, (byte) 0x47
+ };
+
+ // cofactor of G
+ public static final short EC571_F2M_K = 2;
+
+
+ // transformParameter TRANSFORMATION types
+ public static final short TRANSFORMATION_NONE = (short) 0x00;
+ public static final short TRANSFORMATION_FIXED = (short) 0x01;
+ public static final short TRANSFORMATION_FULLRANDOM = (short) 0x02;
+ public static final short TRANSFORMATION_ONEBYTERANDOM = (short) 0x04;
+ public static final short TRANSFORMATION_ZERO = (short) 0x08;
+ public static final short TRANSFORMATION_ONE = (short) 0x10;
+ public static final short TRANSFORMATION_MAX = (short) 0x20;
+ public static final short TRANSFORMATION_INCREMENT = (short) 0x40;
+ public static final short TRANSFORMATION_INFINITY = (short) 0x80;
+ public static final short TRANSFORMATION_COMPRESS = (short) 0x0100;
+ public static final short TRANSFORMATION_COMPRESS_HYBRID = (short) 0x0200;
+ public static final short TRANSFORMATION_04_MASK = (short) 0x0400;
+
+ // toX962 FORM types
+ public static final byte X962_UNCOMPRESSED = (byte) 0x00;
+ public static final byte X962_COMPRESSED = (byte) 0x01;
+ public static final byte X962_HYBRID = (byte) 0x02;
+
+ // Supported embedded curves, getCurveParameter
+ public static final byte CURVE_default = (byte) 0;
+ public static final byte CURVE_external = (byte) 0xff;
+
+ // SECG recommended curves over FP
+ public static final byte CURVE_secp112r1 = (byte) 1;
+ public static final byte CURVE_secp128r1 = (byte) 2;
+ public static final byte CURVE_secp160r1 = (byte) 3;
+ public static final byte CURVE_secp192r1 = (byte) 4;
+ public static final byte CURVE_secp224r1 = (byte) 5;
+ public static final byte CURVE_secp256r1 = (byte) 6;
+ public static final byte CURVE_secp384r1 = (byte) 7;
+ public static final byte CURVE_secp521r1 = (byte) 8;
+
+ public static final byte FP_CURVES = (byte) 8;
+
+ // SECG recommended curves over F2M
+ public static final byte CURVE_sect163r1 = (byte) 9;
+ public static final byte CURVE_sect233r1 = (byte) 10;
+ public static final byte CURVE_sect283r1 = (byte) 11;
+ public static final byte CURVE_sect409r1 = (byte) 12;
+ public static final byte CURVE_sect571r1 = (byte) 13;
+
+ public static final byte F2M_CURVES = (byte) 13;
+
+ public static final short[] FP_SIZES = new short[]{112, 128, 160, 192, 224, 256, 384, 521};
+ public static final short[] F2M_SIZES = new short[]{163, 233, 283, 409, 571};
+
+ public static final byte ALG_EC_F2M = 4;
+ public static final byte ALG_EC_FP = 5;
+
+ // Class javacard.security.KeyAgreement
+ // javacard.security.KeyAgreement Fields:
+ public static final byte KeyAgreement_ALG_EC_SVDP_DH = 1;
+ public static final byte KeyAgreement_ALG_EC_SVDP_DH_KDF = 1;
+ public static final byte KeyAgreement_ALG_EC_SVDP_DHC = 2;
+ public static final byte KeyAgreement_ALG_EC_SVDP_DHC_KDF = 2;
+ public static final byte KeyAgreement_ALG_EC_SVDP_DH_PLAIN = 3;
+ public static final byte KeyAgreement_ALG_EC_SVDP_DHC_PLAIN = 4;
+ public static final byte KeyAgreement_ALG_EC_PACE_GM = 5;
+ public static final byte KeyAgreement_ALG_EC_SVDP_DH_PLAIN_XY = 6;
+
+ public static final byte[] KA_TYPES = new byte[]{
+ KeyAgreement_ALG_EC_SVDP_DH,
+ //KeyAgreement_ALG_EC_SVDP_DH_KDF, //duplicate
+ KeyAgreement_ALG_EC_SVDP_DHC,
+ //KeyAgreement_ALG_EC_SVDP_DHC_KDF, //duplicate
+ KeyAgreement_ALG_EC_SVDP_DH_PLAIN,
+ KeyAgreement_ALG_EC_SVDP_DHC_PLAIN,
+ KeyAgreement_ALG_EC_PACE_GM,
+ KeyAgreement_ALG_EC_SVDP_DH_PLAIN_XY
+ };
+
+ // Class javacard.security.Signature
+ // javacard.security.Signature Fields:
+ public static final byte Signature_ALG_ECDSA_SHA = 17;
+ public static final byte Signature_ALG_ECDSA_SHA_224 = 37;
+ public static final byte Signature_ALG_ECDSA_SHA_256 = 33;
+ public static final byte Signature_ALG_ECDSA_SHA_384 = 34;
+ public static final byte Signature_ALG_ECDSA_SHA_512 = 38;
+
+ public static final byte[] SIG_TYPES = new byte[]{
+ Signature_ALG_ECDSA_SHA,
+ Signature_ALG_ECDSA_SHA_224,
+ Signature_ALG_ECDSA_SHA_256,
+ Signature_ALG_ECDSA_SHA_384,
+ Signature_ALG_ECDSA_SHA_512
+ };
+
+ public static byte getCurve(short keyLength, byte keyClass) {
+ if (keyClass == ALG_EC_FP) {
+ switch (keyLength) {
+ case (short) 112:
+ return CURVE_secp112r1;
+ case (short) 128:
+ return CURVE_secp128r1;
+ case (short) 160:
+ return CURVE_secp160r1;
+ case (short) 192:
+ return CURVE_secp192r1;
+ case (short) 224:
+ return CURVE_secp224r1;
+ case (short) 256:
+ return CURVE_secp256r1;
+ case (short) 384:
+ return CURVE_secp384r1;
+ case (short) 521:
+ return CURVE_secp521r1;
+ default:
+ throw new IllegalArgumentException("Unsupported keyLength and keyClass.");
+ }
+ } else if (keyClass == ALG_EC_F2M) {
+ switch (keyLength) {
+ case (short) 163:
+ return CURVE_sect163r1;
+ case (short) 233:
+ return CURVE_sect233r1;
+ case (short) 283:
+ return CURVE_sect283r1;
+ case (short) 409:
+ return CURVE_sect409r1;
+ case (short) 571:
+ return CURVE_sect571r1;
+ default:
+ throw new IllegalArgumentException("Unsupported keyLength and keyClass.");
+ }
+ } else {
+ throw new IllegalArgumentException("Unsupported keyClass.");
+ }
+ }
+
+ public static byte[] getCurveParameter(byte curve, short param) {
+ byte alg = getCurveType(curve);
+ switch (curve) {
+ case CURVE_secp112r1: {
+ EC_FP_P = EC112_FP_P;
+ EC_A = EC112_FP_A;
+ EC_B = EC112_FP_B;
+ EC_G_X = EC112_FP_G_X;
+ EC_G_Y = EC112_FP_G_Y;
+ EC_R = EC112_FP_R;
+ EC_K = EC112_FP_K;
+ EC_W_X = null;
+ EC_W_Y = null;
+ EC_S = null;
+ break;
+ }
+ case CURVE_secp128r1: {
+ EC_FP_P = EC128_FP_P;
+ EC_A = EC128_FP_A;
+ EC_B = EC128_FP_B;
+ EC_G_X = EC128_FP_G_X;
+ EC_G_Y = EC128_FP_G_Y;
+ EC_R = EC128_FP_R;
+ EC_K = EC128_FP_K;
+ EC_W_X = null;
+ EC_W_Y = null;
+ EC_S = null;
+ break;
+ }
+ case CURVE_secp160r1: {
+ EC_FP_P = EC160_FP_P;
+ EC_A = EC160_FP_A;
+ EC_B = EC160_FP_B;
+ EC_G_X = EC160_FP_G_X;
+ EC_G_Y = EC160_FP_G_Y;
+ EC_R = EC160_FP_R;
+ EC_K = EC160_FP_K;
+ EC_W_X = null;
+ EC_W_Y = null;
+ EC_S = null;
+ break;
+ }
+ case CURVE_secp192r1: {
+ EC_FP_P = EC192_FP_P;
+ EC_A = EC192_FP_A;
+ EC_B = EC192_FP_B;
+ EC_G_X = EC192_FP_G_X;
+ EC_G_Y = EC192_FP_G_Y;
+ EC_R = EC192_FP_R;
+ EC_K = EC192_FP_K;
+ EC_W_X = null;
+ EC_W_Y = null;
+ EC_S = null;
+ break;
+ }
+ case CURVE_secp224r1: {
+ EC_FP_P = EC224_FP_P;
+ EC_A = EC224_FP_A;
+ EC_B = EC224_FP_B;
+ EC_G_X = EC224_FP_G_X;
+ EC_G_Y = EC224_FP_G_Y;
+ EC_R = EC224_FP_R;
+ EC_K = EC224_FP_K;
+ EC_S = null;
+ break;
+ }
+ case CURVE_secp256r1: {
+ EC_FP_P = EC256_FP_P;
+ EC_A = EC256_FP_A;
+ EC_B = EC256_FP_B;
+ EC_G_X = EC256_FP_G_X;
+ EC_G_Y = EC256_FP_G_Y;
+ EC_R = EC256_FP_R;
+ EC_K = EC256_FP_K;
+ EC_W_X = null;
+ EC_W_Y = null;
+ EC_S = null;
+ break;
+ }
+ case CURVE_secp384r1: {
+ EC_FP_P = EC384_FP_P;
+ EC_A = EC384_FP_A;
+ EC_B = EC384_FP_B;
+ EC_G_X = EC384_FP_G_X;
+ EC_G_Y = EC384_FP_G_Y;
+ EC_R = EC384_FP_R;
+ EC_K = EC384_FP_K;
+ EC_W_X = null;
+ EC_W_Y = null;
+ EC_S = null;
+ break;
+ }
+ case CURVE_secp521r1: {
+ EC_FP_P = EC521_FP_P;
+ EC_A = EC521_FP_A;
+ EC_B = EC521_FP_B;
+ EC_G_X = EC521_FP_G_X;
+ EC_G_Y = EC521_FP_G_Y;
+ EC_R = EC521_FP_R;
+ EC_K = EC521_FP_K;
+ EC_W_X = null;
+ EC_W_Y = null;
+ EC_S = null;
+ break;
+ }
+ case CURVE_sect163r1: {
+ EC_F2M_F2M = EC163_F2M_F;
+ EC_A = EC163_F2M_A;
+ EC_B = EC163_F2M_B;
+ EC_G_X = EC163_F2M_G_X;
+ EC_G_Y = EC163_F2M_G_Y;
+ EC_R = EC163_F2M_R;
+ EC_K = EC163_F2M_K;
+ EC_W_X = null;
+ EC_W_Y = null;
+ EC_S = null;
+ break;
+ }
+ case CURVE_sect233r1: {
+ EC_F2M_F2M = EC233_F2M_F;
+ EC_A = EC233_F2M_A;
+ EC_B = EC233_F2M_B;
+ EC_G_X = EC233_F2M_G_X;
+ EC_G_Y = EC233_F2M_G_Y;
+ EC_R = EC233_F2M_R;
+ EC_K = EC233_F2M_K;
+ EC_W_X = null;
+ EC_W_Y = null;
+ EC_S = null;
+ break;
+ }
+ case CURVE_sect283r1: {
+ EC_F2M_F2M = EC283_F2M_F;
+ EC_A = EC283_F2M_A;
+ EC_B = EC283_F2M_B;
+ EC_G_X = EC283_F2M_G_X;
+ EC_G_Y = EC283_F2M_G_Y;
+ EC_R = EC283_F2M_R;
+ EC_K = EC283_F2M_K;
+ EC_W_X = null;
+ EC_W_Y = null;
+ EC_S = null;
+ break;
+ }
+ case CURVE_sect409r1: {
+ EC_F2M_F2M = EC409_F2M_F;
+ EC_A = EC409_F2M_A;
+ EC_B = EC409_F2M_B;
+ EC_G_X = EC409_F2M_G_X;
+ EC_G_Y = EC409_F2M_G_Y;
+ EC_R = EC409_F2M_R;
+ EC_K = EC409_F2M_K;
+ EC_W_X = null;
+ EC_W_Y = null;
+ EC_S = null;
+ break;
+ }
+ case CURVE_sect571r1: {
+ EC_F2M_F2M = EC571_F2M_F;
+ EC_A = EC571_F2M_A;
+ EC_B = EC571_F2M_B;
+ EC_G_X = EC571_F2M_G_X;
+ EC_G_Y = EC571_F2M_G_Y;
+ EC_R = EC571_F2M_R;
+ EC_K = EC571_F2M_K;
+ EC_W_X = null;
+ EC_W_Y = null;
+ EC_S = null;
+ break;
+ }
+ default:
+ throw new IllegalArgumentException("Unknown curve.");
+ }
+ switch (param) {
+ case PARAMETER_FP:
+ if (alg == ALG_EC_FP) {
+ return EC_FP_P.clone();
+ }
+ break;
+ case PARAMETER_F2M:
+ if (alg == ALG_EC_F2M) {
+ return EC_F2M_F2M.clone();
+ }
+ break;
+ case PARAMETER_A:
+ return EC_A.clone();
+ case PARAMETER_B:
+ return EC_B.clone();
+ case PARAMETER_G:
+ return toX962(X962_UNCOMPRESSED, EC_G_X, EC_G_Y);
+ case PARAMETER_R:
+ return EC_R.clone();
+ case PARAMETER_K:
+ return ByteUtil.shortToBytes(EC_K);
+ case PARAMETER_W:
+ if (EC_W_X == null || EC_W_Y == null) {
+ return null;
+ }
+ return toX962(X962_UNCOMPRESSED, EC_W_X, EC_W_Y);
+ case PARAMETER_S:
+ if (EC_S == null) {
+ return null;
+ }
+ return EC_S.clone();
+ default:
+ throw new IllegalArgumentException("Unknown parameter");
+ }
+ return null;
+ }
+
+ public static byte getCurveType(byte curve) {
+ return curve <= FP_CURVES ? ALG_EC_FP : ALG_EC_F2M;
+ }
+
+ public static byte[] toX962(byte form, byte[] xBuffer, byte[] yBuffer) {
+ ByteBuffer bb = ByteBuffer.allocate(xBuffer.length + yBuffer.length + 1);
+ byte yLSB = yBuffer[yBuffer.length - 1];
+ byte yBit = (byte) (yLSB & 0x01);
+
+ switch (form) {
+ case X962_UNCOMPRESSED:
+ bb.put((byte) 4);
+ break;
+ case X962_HYBRID:
+ if (yBit == 1) {
+ bb.put((byte) 7);
+ } else {
+ bb.put((byte) 6);
+ }
+ break;
+ case X962_COMPRESSED:
+ if (yBit == 1) {
+ bb.put((byte) 3);
+ } else {
+ bb.put((byte) 2);
+ }
+ break;
+ default:
+ throw new IllegalArgumentException("Unsupported form.");
+ }
+ bb.put(xBuffer);
+ if (form == X962_HYBRID || form == X962_UNCOMPRESSED) {
+ bb.put(yBuffer);
+ }
+ return bb.array();
+ }
+
+}
diff --git a/src/cz/crcs/ectester/common/ec/EC_Curve.java b/common/src/main/java/cz/crcs/ectester/common/ec/EC_Curve.java
index d188551..e26fc44 100644
--- a/src/cz/crcs/ectester/common/ec/EC_Curve.java
+++ b/common/src/main/java/cz/crcs/ectester/common/ec/EC_Curve.java
@@ -1,8 +1,6 @@
package cz.crcs.ectester.common.ec;
-import cz.crcs.ectester.applet.EC_Consts;
import cz.crcs.ectester.common.util.ByteUtil;
-import javacard.security.KeyPair;
import org.bouncycastle.math.ec.ECCurve;
import java.math.BigInteger;
@@ -20,10 +18,10 @@ public class EC_Curve extends EC_Params {
/**
* @param bits
- * @param field KeyPair.ALG_EC_FP or KeyPair.ALG_EC_F2M
+ * @param field EC_Consts.ALG_EC_FP or EC_Consts.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);
+ super(field == EC_Consts.ALG_EC_FP ? EC_Consts.PARAMETERS_DOMAIN_FP : EC_Consts.PARAMETERS_DOMAIN_F2M);
this.bits = bits;
this.field = field;
}
@@ -52,12 +50,12 @@ public class EC_Curve extends EC_Params {
@Override
public String toString() {
- return "<" + getId() + "> " + (field == KeyPair.ALG_EC_FP ? "Prime" : "Binary") + " field Elliptic curve (" + String.valueOf(bits) + "b)" + (desc == null ? "" : ": " + desc) + System.lineSeparator() + super.toString();
+ return "<" + getId() + "> " + (field == EC_Consts.ALG_EC_FP ? "Prime" : "Binary") + " field Elliptic curve (" + String.valueOf(bits) + "b)" + (desc == null ? "" : ": " + desc) + System.lineSeparator() + super.toString();
}
public EllipticCurve toCurve() {
ECField field;
- if (this.field == KeyPair.ALG_EC_FP) {
+ if (this.field == EC_Consts.ALG_EC_FP) {
field = new ECFieldFp(new BigInteger(1, getData(0)));
} else {
byte[][] fieldData = getParam(EC_Consts.PARAMETER_F2M);
@@ -81,7 +79,7 @@ public class EC_Curve extends EC_Params {
}
public ECCurve toBCCurve() {
- if (this.field == KeyPair.ALG_EC_FP) {
+ if (this.field == EC_Consts.ALG_EC_FP) {
BigInteger p = new BigInteger(1, getParam(EC_Consts.PARAMETER_FP)[0]);
BigInteger a = new BigInteger(1, getParam(EC_Consts.PARAMETER_A)[0]);
BigInteger b = new BigInteger(1, getParam(EC_Consts.PARAMETER_B)[0]);
@@ -128,7 +126,7 @@ public class EC_Curve extends EC_Params {
ECFieldFp primeField = (ECFieldFp) field;
params = new byte[7][];
params[paramIndex++] = primeField.getP().toByteArray();
- fieldType = KeyPair.ALG_EC_FP;
+ fieldType = EC_Consts.ALG_EC_FP;
} else if (field instanceof ECFieldF2m) {
ECFieldF2m binaryField = (ECFieldF2m) field;
params = new byte[10][];
@@ -140,7 +138,7 @@ public class EC_Curve extends EC_Params {
short power = (i < powers.length) ? (short) powers[i] : 0;
ByteUtil.setShort(params[paramIndex++], 0, power);
}
- fieldType = KeyPair.ALG_EC_F2M;
+ fieldType = EC_Consts.ALG_EC_F2M;
} else {
throw new IllegalArgumentException("ECParameterSpec with an unknown field.");
}
diff --git a/src/cz/crcs/ectester/common/ec/EC_Data.java b/common/src/main/java/cz/crcs/ectester/common/ec/EC_Data.java
index 14ae1c5..14ae1c5 100644
--- a/src/cz/crcs/ectester/common/ec/EC_Data.java
+++ b/common/src/main/java/cz/crcs/ectester/common/ec/EC_Data.java
diff --git a/src/cz/crcs/ectester/common/ec/EC_KAResult.java b/common/src/main/java/cz/crcs/ectester/common/ec/EC_KAResult.java
index 4e97950..4e97950 100644
--- a/src/cz/crcs/ectester/common/ec/EC_KAResult.java
+++ b/common/src/main/java/cz/crcs/ectester/common/ec/EC_KAResult.java
diff --git a/src/cz/crcs/ectester/common/ec/EC_Key.java b/common/src/main/java/cz/crcs/ectester/common/ec/EC_Key.java
index 754775d..a9f0c40 100644
--- a/src/cz/crcs/ectester/common/ec/EC_Key.java
+++ b/common/src/main/java/cz/crcs/ectester/common/ec/EC_Key.java
@@ -1,7 +1,5 @@
package cz.crcs.ectester.common.ec;
-import cz.crcs.ectester.applet.EC_Consts;
-
/**
* An abstract-like EC key. Concrete implementations create a public and private keys.
*
diff --git a/src/cz/crcs/ectester/common/ec/EC_Keypair.java b/common/src/main/java/cz/crcs/ectester/common/ec/EC_Keypair.java
index 24ddba7..b1a0cbc 100644
--- a/src/cz/crcs/ectester/common/ec/EC_Keypair.java
+++ b/common/src/main/java/cz/crcs/ectester/common/ec/EC_Keypair.java
@@ -1,7 +1,5 @@
package cz.crcs.ectester.common.ec;
-import cz.crcs.ectester.applet.EC_Consts;
-
/**
* An EC keypair, contains both the W and S parameters.
*
diff --git a/src/cz/crcs/ectester/common/ec/EC_Params.java b/common/src/main/java/cz/crcs/ectester/common/ec/EC_Params.java
index e922feb..146c8d6 100644
--- a/src/cz/crcs/ectester/common/ec/EC_Params.java
+++ b/common/src/main/java/cz/crcs/ectester/common/ec/EC_Params.java
@@ -1,6 +1,5 @@
package cz.crcs.ectester.common.ec;
-import cz.crcs.ectester.applet.EC_Consts;
import cz.crcs.ectester.common.util.ByteUtil;
import java.io.ByteArrayOutputStream;
diff --git a/src/cz/crcs/ectester/common/ec/EC_SigResult.java b/common/src/main/java/cz/crcs/ectester/common/ec/EC_SigResult.java
index d97ced1..d97ced1 100644
--- a/src/cz/crcs/ectester/common/ec/EC_SigResult.java
+++ b/common/src/main/java/cz/crcs/ectester/common/ec/EC_SigResult.java
diff --git a/src/cz/crcs/ectester/common/ec/RawECPrivateKey.java b/common/src/main/java/cz/crcs/ectester/common/ec/RawECPrivateKey.java
index 479118f..479118f 100644
--- a/src/cz/crcs/ectester/common/ec/RawECPrivateKey.java
+++ b/common/src/main/java/cz/crcs/ectester/common/ec/RawECPrivateKey.java
diff --git a/src/cz/crcs/ectester/common/ec/RawECPublicKey.java b/common/src/main/java/cz/crcs/ectester/common/ec/RawECPublicKey.java
index 7888854..7888854 100644
--- a/src/cz/crcs/ectester/common/ec/RawECPublicKey.java
+++ b/common/src/main/java/cz/crcs/ectester/common/ec/RawECPublicKey.java
diff --git a/src/cz/crcs/ectester/common/output/BaseTextTestWriter.java b/common/src/main/java/cz/crcs/ectester/common/output/BaseTextTestWriter.java
index 5c449db..5c449db 100644
--- a/src/cz/crcs/ectester/common/output/BaseTextTestWriter.java
+++ b/common/src/main/java/cz/crcs/ectester/common/output/BaseTextTestWriter.java
diff --git a/src/cz/crcs/ectester/common/output/BaseXMLTestWriter.java b/common/src/main/java/cz/crcs/ectester/common/output/BaseXMLTestWriter.java
index 53970dd..53970dd 100644
--- a/src/cz/crcs/ectester/common/output/BaseXMLTestWriter.java
+++ b/common/src/main/java/cz/crcs/ectester/common/output/BaseXMLTestWriter.java
diff --git a/src/cz/crcs/ectester/common/output/BaseYAMLTestWriter.java b/common/src/main/java/cz/crcs/ectester/common/output/BaseYAMLTestWriter.java
index e054563..e054563 100644
--- a/src/cz/crcs/ectester/common/output/BaseYAMLTestWriter.java
+++ b/common/src/main/java/cz/crcs/ectester/common/output/BaseYAMLTestWriter.java
diff --git a/src/cz/crcs/ectester/common/output/OutputLogger.java b/common/src/main/java/cz/crcs/ectester/common/output/OutputLogger.java
index effd1fd..effd1fd 100644
--- a/src/cz/crcs/ectester/common/output/OutputLogger.java
+++ b/common/src/main/java/cz/crcs/ectester/common/output/OutputLogger.java
diff --git a/src/cz/crcs/ectester/common/output/TeeOutputStream.java b/common/src/main/java/cz/crcs/ectester/common/output/TeeOutputStream.java
index 2401fce..2401fce 100644
--- a/src/cz/crcs/ectester/common/output/TeeOutputStream.java
+++ b/common/src/main/java/cz/crcs/ectester/common/output/TeeOutputStream.java
diff --git a/src/cz/crcs/ectester/common/output/TeeTestWriter.java b/common/src/main/java/cz/crcs/ectester/common/output/TeeTestWriter.java
index 58a0a15..58a0a15 100644
--- a/src/cz/crcs/ectester/common/output/TeeTestWriter.java
+++ b/common/src/main/java/cz/crcs/ectester/common/output/TeeTestWriter.java
diff --git a/src/cz/crcs/ectester/common/output/TestWriter.java b/common/src/main/java/cz/crcs/ectester/common/output/TestWriter.java
index 67aeccb..67aeccb 100644
--- a/src/cz/crcs/ectester/common/output/TestWriter.java
+++ b/common/src/main/java/cz/crcs/ectester/common/output/TestWriter.java
diff --git a/src/cz/crcs/ectester/common/test/BaseTestable.java b/common/src/main/java/cz/crcs/ectester/common/test/BaseTestable.java
index 3c304d9..3c304d9 100644
--- a/src/cz/crcs/ectester/common/test/BaseTestable.java
+++ b/common/src/main/java/cz/crcs/ectester/common/test/BaseTestable.java
diff --git a/src/cz/crcs/ectester/common/test/CompoundTest.java b/common/src/main/java/cz/crcs/ectester/common/test/CompoundTest.java
index ba4ad4f..ba4ad4f 100644
--- a/src/cz/crcs/ectester/common/test/CompoundTest.java
+++ b/common/src/main/java/cz/crcs/ectester/common/test/CompoundTest.java
diff --git a/src/cz/crcs/ectester/common/test/Result.java b/common/src/main/java/cz/crcs/ectester/common/test/Result.java
index f065f9c..f065f9c 100644
--- a/src/cz/crcs/ectester/common/test/Result.java
+++ b/common/src/main/java/cz/crcs/ectester/common/test/Result.java
diff --git a/src/cz/crcs/ectester/common/test/SimpleTest.java b/common/src/main/java/cz/crcs/ectester/common/test/SimpleTest.java
index d2b3e94..d2b3e94 100644
--- a/src/cz/crcs/ectester/common/test/SimpleTest.java
+++ b/common/src/main/java/cz/crcs/ectester/common/test/SimpleTest.java
diff --git a/src/cz/crcs/ectester/common/test/Test.java b/common/src/main/java/cz/crcs/ectester/common/test/Test.java
index 8bf9502..8bf9502 100644
--- a/src/cz/crcs/ectester/common/test/Test.java
+++ b/common/src/main/java/cz/crcs/ectester/common/test/Test.java
diff --git a/src/cz/crcs/ectester/common/test/TestCallback.java b/common/src/main/java/cz/crcs/ectester/common/test/TestCallback.java
index c5a49f3..c5a49f3 100644
--- a/src/cz/crcs/ectester/common/test/TestCallback.java
+++ b/common/src/main/java/cz/crcs/ectester/common/test/TestCallback.java
diff --git a/src/cz/crcs/ectester/common/test/TestException.java b/common/src/main/java/cz/crcs/ectester/common/test/TestException.java
index 0b605eb..0b605eb 100644
--- a/src/cz/crcs/ectester/common/test/TestException.java
+++ b/common/src/main/java/cz/crcs/ectester/common/test/TestException.java
diff --git a/src/cz/crcs/ectester/common/test/TestSuite.java b/common/src/main/java/cz/crcs/ectester/common/test/TestSuite.java
index b12680a..b12680a 100644
--- a/src/cz/crcs/ectester/common/test/TestSuite.java
+++ b/common/src/main/java/cz/crcs/ectester/common/test/TestSuite.java
diff --git a/src/cz/crcs/ectester/common/test/TestSuiteException.java b/common/src/main/java/cz/crcs/ectester/common/test/TestSuiteException.java
index 2d1ea09..2d1ea09 100644
--- a/src/cz/crcs/ectester/common/test/TestSuiteException.java
+++ b/common/src/main/java/cz/crcs/ectester/common/test/TestSuiteException.java
diff --git a/src/cz/crcs/ectester/common/test/Testable.java b/common/src/main/java/cz/crcs/ectester/common/test/Testable.java
index 7b4545c..7b4545c 100644
--- a/src/cz/crcs/ectester/common/test/Testable.java
+++ b/common/src/main/java/cz/crcs/ectester/common/test/Testable.java
diff --git a/src/cz/crcs/ectester/common/util/ByteUtil.java b/common/src/main/java/cz/crcs/ectester/common/util/ByteUtil.java
index 442824a..442824a 100644
--- a/src/cz/crcs/ectester/common/util/ByteUtil.java
+++ b/common/src/main/java/cz/crcs/ectester/common/util/ByteUtil.java
diff --git a/common/src/main/java/cz/crcs/ectester/common/util/CardConsts.java b/common/src/main/java/cz/crcs/ectester/common/util/CardConsts.java
new file mode 100644
index 0000000..1483346
--- /dev/null
+++ b/common/src/main/java/cz/crcs/ectester/common/util/CardConsts.java
@@ -0,0 +1,65 @@
+package cz.crcs.ectester.common.util;
+
+public class CardConsts {
+ // MAIN INSTRUCTION CLASS
+ public static final byte CLA_ECTESTERAPPLET = (byte) 0xB0;
+
+ // INSTRUCTIONS
+ public static final byte INS_ALLOCATE = (byte) 0x5a;
+ public static final byte INS_CLEAR = (byte) 0x5b;
+ public static final byte INS_SET = (byte) 0x5c;
+ public static final byte INS_TRANSFORM = (byte) 0x5d;
+ public static final byte INS_GENERATE = (byte) 0x5e;
+ public static final byte INS_EXPORT = (byte) 0x5f;
+ public static final byte INS_ECDH = (byte) 0x70;
+ public static final byte INS_ECDH_DIRECT = (byte) 0x71;
+ public static final byte INS_ECDSA = (byte) 0x72;
+ public static final byte INS_ECDSA_SIGN = (byte) 0x73;
+ public static final byte INS_ECDSA_VERIFY = (byte) 0x74;
+ public static final byte INS_CLEANUP = (byte) 0x75;
+ public static final byte INS_ALLOCATE_KA = (byte) 0x76;
+ public static final byte INS_ALLOCATE_SIG = (byte) 0x77;
+ public static final byte INS_GET_INFO = (byte) 0x78;
+ public static final byte INS_SET_DRY_RUN_MODE = (byte) 0x79;
+ public static final byte INS_BUFFER = (byte) 0x7a;
+ public static final byte INS_PERFORM = (byte) 0x7b;
+
+ // PARAMETERS for P1 and P2
+ public static final byte KEYPAIR_LOCAL = (byte) 0x01;
+ public static final byte KEYPAIR_REMOTE = (byte) 0x02;
+ public static final byte KEYPAIR_BOTH = KEYPAIR_LOCAL | KEYPAIR_REMOTE;
+ public static final byte BUILD_KEYPAIR = (byte) 0x01;
+ public static final byte BUILD_KEYBUILDER = (byte) 0x02;
+ public static final byte EXPORT_TRUE = (byte) 0xff;
+ public static final byte EXPORT_FALSE = (byte) 0x00;
+ public static final byte MODE_NORMAL = (byte) 0xaa;
+ public static final byte MODE_DRY_RUN = (byte) 0xbb;
+
+ // STATUS WORDS
+ public static final short SW_SIG_VERIFY_FAIL = (short) 0x0ee1;
+ public static final short SW_DH_DHC_MISMATCH = (short) 0x0ee2;
+ public static final short SW_KEYPAIR_NULL = (short) 0x0ee3;
+ public static final short SW_KA_NULL = (short) 0x0ee4;
+ public static final short SW_SIGNATURE_NULL = (short) 0x0ee5;
+ public static final short SW_OBJECT_NULL = (short) 0x0ee6;
+ public static final short SW_CANNOT_FIT = (short) 0x0ee7;
+ public static final short SW_Exception = (short) 0xff01;
+ public static final short SW_ArrayIndexOutOfBoundsException = (short) 0xff02;
+ public static final short SW_ArithmeticException = (short) 0xff03;
+ public static final short SW_ArrayStoreException = (short) 0xff04;
+ public static final short SW_NullPointerException = (short) 0xff05;
+ public static final short SW_NegativeArraySizeException = (short) 0xff06;
+ public static final short SW_CryptoException_prefix = (short) 0xf100;
+ public static final short SW_SystemException_prefix = (short) 0xf200;
+ public static final short SW_PINException_prefix = (short) 0xf300;
+ public static final short SW_TransactionException_prefix = (short) 0xf400;
+ public static final short SW_CardRuntimeException_prefix = (short) 0xf500;
+
+ //
+ public static final short BASE_221 = (short) 0x0221;
+ public static final short BASE_222 = (short) 0x0222;
+
+ //
+ public static final short CDATA_BASIC = (short) 5;
+ public static final short CDATA_EXTENDED = (short) 7;
+}
diff --git a/src/cz/crcs/ectester/common/util/CardUtil.java b/common/src/main/java/cz/crcs/ectester/common/util/CardUtil.java
index 72963cf..eeb2159 100644
--- a/src/cz/crcs/ectester/common/util/CardUtil.java
+++ b/common/src/main/java/cz/crcs/ectester/common/util/CardUtil.java
@@ -1,10 +1,6 @@
package cz.crcs.ectester.common.util;
-import cz.crcs.ectester.applet.ECTesterApplet;
-import cz.crcs.ectester.applet.EC_Consts;
-import javacard.framework.ISO7816;
-import javacard.security.CryptoException;
-import javacard.security.KeyPair;
+import cz.crcs.ectester.common.ec.EC_Consts;
import java.util.LinkedList;
import java.util.List;
@@ -14,6 +10,42 @@ import java.util.List;
* @author Jan Jancar johny@neuromancer.sk
*/
public class CardUtil {
+ public class ISO7816 {
+ public static final short SW_APPLET_SELECT_FAILED = 27033;
+ public static final short SW_BYTES_REMAINING_00 = 24832;
+ public static final short SW_CLA_NOT_SUPPORTED = 28160;
+ public static final short SW_COMMAND_CHAINING_NOT_SUPPORTED = 26756;
+ public static final short SW_COMMAND_NOT_ALLOWED = 27014;
+ public static final short SW_CONDITIONS_NOT_SATISFIED = 27013;
+ public static final short SW_CORRECT_LENGTH_00 = 27648;
+ public static final short SW_DATA_INVALID = 27012;
+ public static final short SW_FILE_FULL = 27268;
+ public static final short SW_FILE_INVALID = 27011;
+ public static final short SW_FILE_NOT_FOUND = 27266;
+ public static final short SW_FUNC_NOT_SUPPORTED = 27265;
+ public static final short SW_INCORRECT_P1P2 = 27270;
+ public static final short SW_INS_NOT_SUPPORTED = 27904;
+ public static final short SW_LAST_COMMAND_EXPECTED = 26755;
+ public static final short SW_LOGICAL_CHANNEL_NOT_SUPPORTED = 26753;
+ public static final short SW_NO_ERROR = -28672;
+ public static final short SW_RECORD_NOT_FOUND = 27267;
+ public static final short SW_SECURE_MESSAGING_NOT_SUPPORTED = 26754;
+ public static final short SW_SECURITY_STATUS_NOT_SATISFIED = 27010;
+ public static final short SW_UNKNOWN = 28416;
+ public static final short SW_WARNING_STATE_UNCHANGED = 25088;
+ public static final short SW_WRONG_DATA = 27264;
+ public static final short SW_WRONG_LENGTH = 26368;
+ public static final short SW_WRONG_P1P2 = 27392;
+ }
+
+ public class CryptoException {
+ public static final short ILLEGAL_VALUE = 1;
+ public static final short UNINITIALIZED_KEY = 2;
+ public static final short NO_SUCH_ALGORITHM = 3;
+ public static final short INVALID_INIT = 4;
+ public static final short ILLEGAL_USE = 5;
+ }
+
public static byte getSig(String name) {
switch (name) {
case "SHA1":
@@ -101,6 +133,7 @@ public class CardUtil {
case ISO7816.SW_BYTES_REMAINING_00:
case ISO7816.SW_CLA_NOT_SUPPORTED:
case ISO7816.SW_COMMAND_NOT_ALLOWED:
+ case ISO7816.SW_COMMAND_CHAINING_NOT_SUPPORTED:
case ISO7816.SW_CONDITIONS_NOT_SATISFIED:
case ISO7816.SW_CORRECT_LENGTH_00:
case ISO7816.SW_DATA_INVALID:
@@ -126,12 +159,12 @@ public class CardUtil {
case CryptoException.INVALID_INIT:
case CryptoException.ILLEGAL_USE:
return "CryptoException";
- case ECTesterApplet.SW_SIG_VERIFY_FAIL:
- case ECTesterApplet.SW_DH_DHC_MISMATCH:
- case ECTesterApplet.SW_KEYPAIR_NULL:
- case ECTesterApplet.SW_KA_NULL:
- case ECTesterApplet.SW_SIGNATURE_NULL:
- case ECTesterApplet.SW_OBJECT_NULL:
+ case CardConsts.SW_SIG_VERIFY_FAIL:
+ case CardConsts.SW_DH_DHC_MISMATCH:
+ case CardConsts.SW_KEYPAIR_NULL:
+ case CardConsts.SW_KA_NULL:
+ case CardConsts.SW_SIGNATURE_NULL:
+ case CardConsts.SW_OBJECT_NULL:
return "ECTesterApplet";
default:
return "?";
@@ -162,6 +195,8 @@ public class CardUtil {
return "CLA_NOT_SUPPORTED";
case ISO7816.SW_COMMAND_NOT_ALLOWED:
return "COMMAND_NOT_ALLOWED";
+ case ISO7816.SW_COMMAND_CHAINING_NOT_SUPPORTED:
+ return "COMMAND_CHAINING_NOT_SUPPORTED";
case ISO7816.SW_CONDITIONS_NOT_SATISFIED:
return "CONDITIONS_NOT_SATISFIED";
case ISO7816.SW_CORRECT_LENGTH_00:
@@ -208,29 +243,29 @@ public class CardUtil {
return "INVALID_INIT";
case CryptoException.ILLEGAL_USE:
return "ILLEGAL_USE";
- case ECTesterApplet.SW_SIG_VERIFY_FAIL:
+ case CardConsts.SW_SIG_VERIFY_FAIL:
return "SIG_VERIFY_FAIL";
- case ECTesterApplet.SW_DH_DHC_MISMATCH:
+ case CardConsts.SW_DH_DHC_MISMATCH:
return "DH_DHC_MISMATCH";
- case ECTesterApplet.SW_KEYPAIR_NULL:
+ case CardConsts.SW_KEYPAIR_NULL:
return "KEYPAIR_NULL";
- case ECTesterApplet.SW_KA_NULL:
+ case CardConsts.SW_KA_NULL:
return "KA_NULL";
- case ECTesterApplet.SW_SIGNATURE_NULL:
+ case CardConsts.SW_SIGNATURE_NULL:
return "SIGNATURE_NULL";
- case ECTesterApplet.SW_OBJECT_NULL:
+ case CardConsts.SW_OBJECT_NULL:
return "OBJECT_NULL";
- case ECTesterApplet.SW_Exception:
+ case CardConsts.SW_Exception:
return "Exception";
- case ECTesterApplet.SW_ArrayIndexOutOfBoundsException:
+ case CardConsts.SW_ArrayIndexOutOfBoundsException:
return "ArrayIndexOutOfBoundsException";
- case ECTesterApplet.SW_ArithmeticException:
+ case CardConsts.SW_ArithmeticException:
return "ArithmeticException";
- case ECTesterApplet.SW_ArrayStoreException:
+ case CardConsts.SW_ArrayStoreException:
return "ArrayStoreException";
- case ECTesterApplet.SW_NullPointerException:
+ case CardConsts.SW_NullPointerException:
return "NullPointerException";
- case ECTesterApplet.SW_NegativeArraySizeException:
+ case CardConsts.SW_NegativeArraySizeException:
return "NegativeArraySizeException";
default:
return "unknown";
@@ -455,9 +490,9 @@ public class CardUtil {
public static String getKeyTypeString(byte keyClass) {
switch (keyClass) {
- case KeyPair.ALG_EC_FP:
+ case EC_Consts.ALG_EC_FP:
return "ALG_EC_FP";
- case KeyPair.ALG_EC_F2M:
+ case EC_Consts.ALG_EC_F2M:
return "ALG_EC_F2M";
default:
return "";
diff --git a/src/cz/crcs/ectester/common/util/ECUtil.java b/common/src/main/java/cz/crcs/ectester/common/util/ECUtil.java
index e8c0a11..773644b 100644
--- a/src/cz/crcs/ectester/common/util/ECUtil.java
+++ b/common/src/main/java/cz/crcs/ectester/common/util/ECUtil.java
@@ -1,15 +1,11 @@
package cz.crcs.ectester.common.util;
-import cz.crcs.ectester.applet.EC_Consts;
import cz.crcs.ectester.common.ec.*;
import cz.crcs.ectester.data.EC_Store;
-import cz.crcs.ectester.standalone.consts.SignatureIdent;
-import org.bouncycastle.asn1.*;
import org.bouncycastle.crypto.digests.SHA1Digest;
import org.bouncycastle.crypto.signers.PlainDSAEncoding;
import org.bouncycastle.crypto.signers.StandardDSAEncoding;
-import java.io.ByteArrayInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.math.BigInteger;
@@ -349,20 +345,6 @@ public class ECUtil {
}
public static BigInteger recoverSignatureNonce(byte[] signature, byte[] data, BigInteger privkey, ECParameterSpec params, String hashAlgo, String sigType) {
- SignatureIdent sigIdent = SignatureIdent.get(hashAlgo + "with" + sigType);
- if (sigIdent == null) {
- return null;
- }
- return recoverSignatureNonce(signature, data, privkey, params, sigIdent);
- }
-
- public static BigInteger recoverSignatureNonce(byte[] signature, byte[] data, BigInteger privkey, ECParameterSpec params, SignatureIdent sigIdent) {
- // Parse the types out of SignatureIdent.
- String hashAlgo = sigIdent.getHashAlgo();
- String sigType = sigIdent.getSigType();
- if (sigType == null) {
- sigType = sigIdent.toString();
- }
// We do not know how to reconstruct those nonces so far.
// sigType.contains("ECKCDSA") || sigType.contains("ECNR") || sigType.contains("SM2")
if (!sigType.contains("ECDSA")) {
diff --git a/src/cz/crcs/ectester/common/util/FileUtil.java b/common/src/main/java/cz/crcs/ectester/common/util/FileUtil.java
index e6e319b..e6e319b 100644
--- a/src/cz/crcs/ectester/common/util/FileUtil.java
+++ b/common/src/main/java/cz/crcs/ectester/common/util/FileUtil.java
diff --git a/src/cz/crcs/ectester/common/util/Util.java b/common/src/main/java/cz/crcs/ectester/common/util/Util.java
index 5b0cd79..5b0cd79 100644
--- a/src/cz/crcs/ectester/common/util/Util.java
+++ b/common/src/main/java/cz/crcs/ectester/common/util/Util.java
diff --git a/src/cz/crcs/ectester/data/EC_Store.java b/common/src/main/java/cz/crcs/ectester/data/EC_Store.java
index bcadf80..ad25b1d 100644
--- a/src/cz/crcs/ectester/data/EC_Store.java
+++ b/common/src/main/java/cz/crcs/ectester/data/EC_Store.java
@@ -2,7 +2,6 @@ package cz.crcs.ectester.data;
import cz.crcs.ectester.common.ec.*;
import cz.crcs.ectester.common.util.Util;
-import javacard.security.KeyPair;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -152,9 +151,9 @@ public class EC_Store {
byte alg;
if (field.getTextContent().equalsIgnoreCase("prime")) {
- alg = KeyPair.ALG_EC_FP;
+ alg = EC_Consts.ALG_EC_FP;
} else {
- alg = KeyPair.ALG_EC_F2M;
+ alg = EC_Consts.ALG_EC_F2M;
}
short bitsize = Short.parseShort(bits.getTextContent());
diff --git a/src/cz/crcs/ectester/data/anomalous/anomalous112.csv b/common/src/main/resources/cz/crcs/ectester/data/anomalous/anomalous112.csv
index 6711b71..6711b71 100644
--- a/src/cz/crcs/ectester/data/anomalous/anomalous112.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/anomalous/anomalous112.csv
diff --git a/src/cz/crcs/ectester/data/anomalous/anomalous128.csv b/common/src/main/resources/cz/crcs/ectester/data/anomalous/anomalous128.csv
index 2dcf172..2dcf172 100644
--- a/src/cz/crcs/ectester/data/anomalous/anomalous128.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/anomalous/anomalous128.csv
diff --git a/src/cz/crcs/ectester/data/anomalous/anomalous160.csv b/common/src/main/resources/cz/crcs/ectester/data/anomalous/anomalous160.csv
index bc50f6d..bc50f6d 100644
--- a/src/cz/crcs/ectester/data/anomalous/anomalous160.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/anomalous/anomalous160.csv
diff --git a/src/cz/crcs/ectester/data/anomalous/anomalous192.csv b/common/src/main/resources/cz/crcs/ectester/data/anomalous/anomalous192.csv
index 35a5c07..35a5c07 100644
--- a/src/cz/crcs/ectester/data/anomalous/anomalous192.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/anomalous/anomalous192.csv
diff --git a/src/cz/crcs/ectester/data/anomalous/anomalous224.csv b/common/src/main/resources/cz/crcs/ectester/data/anomalous/anomalous224.csv
index bf24496..bf24496 100644
--- a/src/cz/crcs/ectester/data/anomalous/anomalous224.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/anomalous/anomalous224.csv
diff --git a/src/cz/crcs/ectester/data/anomalous/anomalous256.csv b/common/src/main/resources/cz/crcs/ectester/data/anomalous/anomalous256.csv
index 24d7454..24d7454 100644
--- a/src/cz/crcs/ectester/data/anomalous/anomalous256.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/anomalous/anomalous256.csv
diff --git a/src/cz/crcs/ectester/data/anomalous/anomalous320.csv b/common/src/main/resources/cz/crcs/ectester/data/anomalous/anomalous320.csv
index 96e98e5..96e98e5 100644
--- a/src/cz/crcs/ectester/data/anomalous/anomalous320.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/anomalous/anomalous320.csv
diff --git a/src/cz/crcs/ectester/data/anomalous/anomalous384.csv b/common/src/main/resources/cz/crcs/ectester/data/anomalous/anomalous384.csv
index 6034b4a..6034b4a 100644
--- a/src/cz/crcs/ectester/data/anomalous/anomalous384.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/anomalous/anomalous384.csv
diff --git a/src/cz/crcs/ectester/data/anomalous/anomalous512.csv b/common/src/main/resources/cz/crcs/ectester/data/anomalous/anomalous512.csv
index ed7ee5b..ed7ee5b 100644
--- a/src/cz/crcs/ectester/data/anomalous/anomalous512.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/anomalous/anomalous512.csv
diff --git a/src/cz/crcs/ectester/data/anomalous/anomalous521.csv b/common/src/main/resources/cz/crcs/ectester/data/anomalous/anomalous521.csv
index e0d935e..e0d935e 100644
--- a/src/cz/crcs/ectester/data/anomalous/anomalous521.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/anomalous/anomalous521.csv
diff --git a/src/cz/crcs/ectester/data/anomalous/curves.xml b/common/src/main/resources/cz/crcs/ectester/data/anomalous/curves.xml
index 5486f35..5486f35 100644
--- a/src/cz/crcs/ectester/data/anomalous/curves.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/anomalous/curves.xml
diff --git a/src/cz/crcs/ectester/data/anomalous/miyaji128a1.csv b/common/src/main/resources/cz/crcs/ectester/data/anomalous/miyaji128a1.csv
index 20f2863..20f2863 100644
--- a/src/cz/crcs/ectester/data/anomalous/miyaji128a1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/anomalous/miyaji128a1.csv
diff --git a/src/cz/crcs/ectester/data/anomalous/miyaji128a2.csv b/common/src/main/resources/cz/crcs/ectester/data/anomalous/miyaji128a2.csv
index 4c0f6bc..4c0f6bc 100644
--- a/src/cz/crcs/ectester/data/anomalous/miyaji128a2.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/anomalous/miyaji128a2.csv
diff --git a/src/cz/crcs/ectester/data/anomalous/miyaji128b1.csv b/common/src/main/resources/cz/crcs/ectester/data/anomalous/miyaji128b1.csv
index 678ce90..678ce90 100644
--- a/src/cz/crcs/ectester/data/anomalous/miyaji128b1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/anomalous/miyaji128b1.csv
diff --git a/src/cz/crcs/ectester/data/anomalous/miyaji128b2.csv b/common/src/main/resources/cz/crcs/ectester/data/anomalous/miyaji128b2.csv
index 73bf5aa..73bf5aa 100644
--- a/src/cz/crcs/ectester/data/anomalous/miyaji128b2.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/anomalous/miyaji128b2.csv
diff --git a/src/cz/crcs/ectester/data/anssi/curves.xml b/common/src/main/resources/cz/crcs/ectester/data/anssi/curves.xml
index 0456e67..0456e67 100644
--- a/src/cz/crcs/ectester/data/anssi/curves.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/anssi/curves.xml
diff --git a/src/cz/crcs/ectester/data/anssi/frp256v1.csv b/common/src/main/resources/cz/crcs/ectester/data/anssi/frp256v1.csv
index 3e5428d..3e5428d 100644
--- a/src/cz/crcs/ectester/data/anssi/frp256v1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/anssi/frp256v1.csv
diff --git a/src/cz/crcs/ectester/data/bn/bn158.csv b/common/src/main/resources/cz/crcs/ectester/data/bn/bn158.csv
index 2e3b6b7..2e3b6b7 100644
--- a/src/cz/crcs/ectester/data/bn/bn158.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/bn/bn158.csv
diff --git a/src/cz/crcs/ectester/data/bn/bn190.csv b/common/src/main/resources/cz/crcs/ectester/data/bn/bn190.csv
index feb225b..feb225b 100644
--- a/src/cz/crcs/ectester/data/bn/bn190.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/bn/bn190.csv
diff --git a/src/cz/crcs/ectester/data/bn/bn222.csv b/common/src/main/resources/cz/crcs/ectester/data/bn/bn222.csv
index 89038b3..89038b3 100644
--- a/src/cz/crcs/ectester/data/bn/bn222.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/bn/bn222.csv
diff --git a/src/cz/crcs/ectester/data/bn/bn254.csv b/common/src/main/resources/cz/crcs/ectester/data/bn/bn254.csv
index de71c5d..de71c5d 100644
--- a/src/cz/crcs/ectester/data/bn/bn254.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/bn/bn254.csv
diff --git a/src/cz/crcs/ectester/data/bn/bn286.csv b/common/src/main/resources/cz/crcs/ectester/data/bn/bn286.csv
index 46d677e..46d677e 100644
--- a/src/cz/crcs/ectester/data/bn/bn286.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/bn/bn286.csv
diff --git a/src/cz/crcs/ectester/data/bn/bn318.csv b/common/src/main/resources/cz/crcs/ectester/data/bn/bn318.csv
index bc431fe..bc431fe 100644
--- a/src/cz/crcs/ectester/data/bn/bn318.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/bn/bn318.csv
diff --git a/src/cz/crcs/ectester/data/bn/bn350.csv b/common/src/main/resources/cz/crcs/ectester/data/bn/bn350.csv
index 237a255..237a255 100644
--- a/src/cz/crcs/ectester/data/bn/bn350.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/bn/bn350.csv
diff --git a/src/cz/crcs/ectester/data/bn/bn382.csv b/common/src/main/resources/cz/crcs/ectester/data/bn/bn382.csv
index 955882a..955882a 100644
--- a/src/cz/crcs/ectester/data/bn/bn382.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/bn/bn382.csv
diff --git a/src/cz/crcs/ectester/data/bn/bn414.csv b/common/src/main/resources/cz/crcs/ectester/data/bn/bn414.csv
index 0c7eb66..0c7eb66 100644
--- a/src/cz/crcs/ectester/data/bn/bn414.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/bn/bn414.csv
diff --git a/src/cz/crcs/ectester/data/bn/bn446.csv b/common/src/main/resources/cz/crcs/ectester/data/bn/bn446.csv
index a0a525e..a0a525e 100644
--- a/src/cz/crcs/ectester/data/bn/bn446.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/bn/bn446.csv
diff --git a/src/cz/crcs/ectester/data/bn/bn478.csv b/common/src/main/resources/cz/crcs/ectester/data/bn/bn478.csv
index 9c2640a..9c2640a 100644
--- a/src/cz/crcs/ectester/data/bn/bn478.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/bn/bn478.csv
diff --git a/src/cz/crcs/ectester/data/bn/bn510.csv b/common/src/main/resources/cz/crcs/ectester/data/bn/bn510.csv
index 9dc79b3..9dc79b3 100644
--- a/src/cz/crcs/ectester/data/bn/bn510.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/bn/bn510.csv
diff --git a/src/cz/crcs/ectester/data/bn/bn542.csv b/common/src/main/resources/cz/crcs/ectester/data/bn/bn542.csv
index 1a50175..1a50175 100644
--- a/src/cz/crcs/ectester/data/bn/bn542.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/bn/bn542.csv
diff --git a/src/cz/crcs/ectester/data/bn/bn574.csv b/common/src/main/resources/cz/crcs/ectester/data/bn/bn574.csv
index 1d547c7..1d547c7 100644
--- a/src/cz/crcs/ectester/data/bn/bn574.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/bn/bn574.csv
diff --git a/src/cz/crcs/ectester/data/bn/bn606.csv b/common/src/main/resources/cz/crcs/ectester/data/bn/bn606.csv
index f488ab2..f488ab2 100644
--- a/src/cz/crcs/ectester/data/bn/bn606.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/bn/bn606.csv
diff --git a/src/cz/crcs/ectester/data/bn/bn638.csv b/common/src/main/resources/cz/crcs/ectester/data/bn/bn638.csv
index cb54f9b..cb54f9b 100644
--- a/src/cz/crcs/ectester/data/bn/bn638.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/bn/bn638.csv
diff --git a/src/cz/crcs/ectester/data/bn/curves.xml b/common/src/main/resources/cz/crcs/ectester/data/bn/curves.xml
index c5ca22f..c5ca22f 100644
--- a/src/cz/crcs/ectester/data/bn/curves.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/bn/curves.xml
diff --git a/src/cz/crcs/ectester/data/brainpool/brainpoolP160r1.csv b/common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP160r1.csv
index a6734e9..a6734e9 100644
--- a/src/cz/crcs/ectester/data/brainpool/brainpoolP160r1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP160r1.csv
diff --git a/src/cz/crcs/ectester/data/brainpool/brainpoolP160t1.csv b/common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP160t1.csv
index b045237..b045237 100644
--- a/src/cz/crcs/ectester/data/brainpool/brainpoolP160t1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP160t1.csv
diff --git a/src/cz/crcs/ectester/data/brainpool/brainpoolP192r1.csv b/common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP192r1.csv
index d7fcf54..d7fcf54 100644
--- a/src/cz/crcs/ectester/data/brainpool/brainpoolP192r1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP192r1.csv
diff --git a/src/cz/crcs/ectester/data/brainpool/brainpoolP192t1.csv b/common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP192t1.csv
index 45ed451..45ed451 100644
--- a/src/cz/crcs/ectester/data/brainpool/brainpoolP192t1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP192t1.csv
diff --git a/src/cz/crcs/ectester/data/brainpool/brainpoolP224r1.csv b/common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP224r1.csv
index 411ff99..411ff99 100644
--- a/src/cz/crcs/ectester/data/brainpool/brainpoolP224r1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP224r1.csv
diff --git a/src/cz/crcs/ectester/data/brainpool/brainpoolP224t1.csv b/common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP224t1.csv
index d0e2610..d0e2610 100644
--- a/src/cz/crcs/ectester/data/brainpool/brainpoolP224t1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP224t1.csv
diff --git a/src/cz/crcs/ectester/data/brainpool/brainpoolP256r1.csv b/common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP256r1.csv
index f88728d..f88728d 100644
--- a/src/cz/crcs/ectester/data/brainpool/brainpoolP256r1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP256r1.csv
diff --git a/src/cz/crcs/ectester/data/brainpool/brainpoolP256t1.csv b/common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP256t1.csv
index 9c21eac..9c21eac 100644
--- a/src/cz/crcs/ectester/data/brainpool/brainpoolP256t1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP256t1.csv
diff --git a/src/cz/crcs/ectester/data/brainpool/brainpoolP320r1.csv b/common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP320r1.csv
index a5ea90d..a5ea90d 100644
--- a/src/cz/crcs/ectester/data/brainpool/brainpoolP320r1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP320r1.csv
diff --git a/src/cz/crcs/ectester/data/brainpool/brainpoolP320t1.csv b/common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP320t1.csv
index cda7844..cda7844 100644
--- a/src/cz/crcs/ectester/data/brainpool/brainpoolP320t1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP320t1.csv
diff --git a/src/cz/crcs/ectester/data/brainpool/brainpoolP384r1.csv b/common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP384r1.csv
index 4469585..4469585 100644
--- a/src/cz/crcs/ectester/data/brainpool/brainpoolP384r1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP384r1.csv
diff --git a/src/cz/crcs/ectester/data/brainpool/brainpoolP384t1.csv b/common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP384t1.csv
index 8a9a6ac..8a9a6ac 100644
--- a/src/cz/crcs/ectester/data/brainpool/brainpoolP384t1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP384t1.csv
diff --git a/src/cz/crcs/ectester/data/brainpool/brainpoolP512r1.csv b/common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP512r1.csv
index 20299d6..20299d6 100644
--- a/src/cz/crcs/ectester/data/brainpool/brainpoolP512r1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP512r1.csv
diff --git a/src/cz/crcs/ectester/data/brainpool/brainpoolP512t1.csv b/common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP512t1.csv
index 4a7c891..4a7c891 100644
--- a/src/cz/crcs/ectester/data/brainpool/brainpoolP512t1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/brainpool/brainpoolP512t1.csv
diff --git a/src/cz/crcs/ectester/data/brainpool/curves.xml b/common/src/main/resources/cz/crcs/ectester/data/brainpool/curves.xml
index 2cb7fc5..2cb7fc5 100644
--- a/src/cz/crcs/ectester/data/brainpool/curves.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/brainpool/curves.xml
diff --git a/src/cz/crcs/ectester/data/categories.xml b/common/src/main/resources/cz/crcs/ectester/data/categories.xml
index 0776b99..0776b99 100644
--- a/src/cz/crcs/ectester/data/categories.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/categories.xml
diff --git a/src/cz/crcs/ectester/data/cofactor/cofactor128p128.csv b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor128p128.csv
index 58459f6..58459f6 100644
--- a/src/cz/crcs/ectester/data/cofactor/cofactor128p128.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor128p128.csv
diff --git a/src/cz/crcs/ectester/data/cofactor/cofactor128p16.csv b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor128p16.csv
index 181c47c..181c47c 100644
--- a/src/cz/crcs/ectester/data/cofactor/cofactor128p16.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor128p16.csv
diff --git a/src/cz/crcs/ectester/data/cofactor/cofactor128p2.csv b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor128p2.csv
index d9857d8..d9857d8 100644
--- a/src/cz/crcs/ectester/data/cofactor/cofactor128p2.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor128p2.csv
diff --git a/src/cz/crcs/ectester/data/cofactor/cofactor128p32.csv b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor128p32.csv
index 9673835..9673835 100644
--- a/src/cz/crcs/ectester/data/cofactor/cofactor128p32.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor128p32.csv
diff --git a/src/cz/crcs/ectester/data/cofactor/cofactor128p4.csv b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor128p4.csv
index 44363ad..44363ad 100644
--- a/src/cz/crcs/ectester/data/cofactor/cofactor128p4.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor128p4.csv
diff --git a/src/cz/crcs/ectester/data/cofactor/cofactor128p56467.csv b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor128p56467.csv
index 193f6a7..193f6a7 100644
--- a/src/cz/crcs/ectester/data/cofactor/cofactor128p56467.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor128p56467.csv
diff --git a/src/cz/crcs/ectester/data/cofactor/cofactor128p64.csv b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor128p64.csv
index 35a5ecc..35a5ecc 100644
--- a/src/cz/crcs/ectester/data/cofactor/cofactor128p64.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor128p64.csv
diff --git a/src/cz/crcs/ectester/data/cofactor/cofactor128p65521.csv b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor128p65521.csv
index 80a1eb3..80a1eb3 100644
--- a/src/cz/crcs/ectester/data/cofactor/cofactor128p65521.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor128p65521.csv
diff --git a/src/cz/crcs/ectester/data/cofactor/cofactor128p65535.csv b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor128p65535.csv
index 54da6cc..54da6cc 100644
--- a/src/cz/crcs/ectester/data/cofactor/cofactor128p65535.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor128p65535.csv
diff --git a/src/cz/crcs/ectester/data/cofactor/cofactor128p8.csv b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor128p8.csv
index 94d4b4e..94d4b4e 100644
--- a/src/cz/crcs/ectester/data/cofactor/cofactor128p8.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor128p8.csv
diff --git a/src/cz/crcs/ectester/data/cofactor/cofactor160p16.csv b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor160p16.csv
index 4d82274..4d82274 100644
--- a/src/cz/crcs/ectester/data/cofactor/cofactor160p16.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor160p16.csv
diff --git a/src/cz/crcs/ectester/data/cofactor/cofactor160p2.csv b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor160p2.csv
index 54717af..54717af 100644
--- a/src/cz/crcs/ectester/data/cofactor/cofactor160p2.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor160p2.csv
diff --git a/src/cz/crcs/ectester/data/cofactor/cofactor160p32.csv b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor160p32.csv
index 75238ea..75238ea 100644
--- a/src/cz/crcs/ectester/data/cofactor/cofactor160p32.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor160p32.csv
diff --git a/src/cz/crcs/ectester/data/cofactor/cofactor160p4.csv b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor160p4.csv
index 760dbef..760dbef 100644
--- a/src/cz/crcs/ectester/data/cofactor/cofactor160p4.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor160p4.csv
diff --git a/src/cz/crcs/ectester/data/cofactor/cofactor160p56467.csv b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor160p56467.csv
index f5355bf..f5355bf 100644
--- a/src/cz/crcs/ectester/data/cofactor/cofactor160p56467.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor160p56467.csv
diff --git a/src/cz/crcs/ectester/data/cofactor/cofactor160p64.csv b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor160p64.csv
index 4cdcfdc..4cdcfdc 100644
--- a/src/cz/crcs/ectester/data/cofactor/cofactor160p64.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor160p64.csv
diff --git a/src/cz/crcs/ectester/data/cofactor/cofactor160p65521.csv b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor160p65521.csv
index 10e3605..10e3605 100644
--- a/src/cz/crcs/ectester/data/cofactor/cofactor160p65521.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor160p65521.csv
diff --git a/src/cz/crcs/ectester/data/cofactor/cofactor160p65535.csv b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor160p65535.csv
index bd47372..bd47372 100644
--- a/src/cz/crcs/ectester/data/cofactor/cofactor160p65535.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor160p65535.csv
diff --git a/src/cz/crcs/ectester/data/cofactor/cofactor160p8.csv b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor160p8.csv
index 60ca98e..60ca98e 100644
--- a/src/cz/crcs/ectester/data/cofactor/cofactor160p8.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor160p8.csv
diff --git a/src/cz/crcs/ectester/data/cofactor/cofactor163t128.csv b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor163t128.csv
index c748587..c748587 100644
--- a/src/cz/crcs/ectester/data/cofactor/cofactor163t128.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor163t128.csv
diff --git a/src/cz/crcs/ectester/data/cofactor/cofactor163t16.csv b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor163t16.csv
index decdad3..decdad3 100644
--- a/src/cz/crcs/ectester/data/cofactor/cofactor163t16.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor163t16.csv
diff --git a/src/cz/crcs/ectester/data/cofactor/cofactor163t2.csv b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor163t2.csv
index d837a28..d837a28 100644
--- a/src/cz/crcs/ectester/data/cofactor/cofactor163t2.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor163t2.csv
diff --git a/src/cz/crcs/ectester/data/cofactor/cofactor163t32.csv b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor163t32.csv
index 2b88982..2b88982 100644
--- a/src/cz/crcs/ectester/data/cofactor/cofactor163t32.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor163t32.csv
diff --git a/src/cz/crcs/ectester/data/cofactor/cofactor163t4.csv b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor163t4.csv
index 61f7b03..61f7b03 100644
--- a/src/cz/crcs/ectester/data/cofactor/cofactor163t4.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor163t4.csv
diff --git a/src/cz/crcs/ectester/data/cofactor/cofactor163t64.csv b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor163t64.csv
index 6d3ee91..6d3ee91 100644
--- a/src/cz/crcs/ectester/data/cofactor/cofactor163t64.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor163t64.csv
diff --git a/src/cz/crcs/ectester/data/cofactor/cofactor163t8.csv b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor163t8.csv
index 349e874..349e874 100644
--- a/src/cz/crcs/ectester/data/cofactor/cofactor163t8.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor163t8.csv
diff --git a/src/cz/crcs/ectester/data/cofactor/cofactor192p2.csv b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor192p2.csv
index 4de7049..4de7049 100644
--- a/src/cz/crcs/ectester/data/cofactor/cofactor192p2.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor192p2.csv
diff --git a/src/cz/crcs/ectester/data/cofactor/cofactor192p4.csv b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor192p4.csv
index 645f031..645f031 100644
--- a/src/cz/crcs/ectester/data/cofactor/cofactor192p4.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor192p4.csv
diff --git a/src/cz/crcs/ectester/data/cofactor/cofactor192p8.csv b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor192p8.csv
index ee39445..ee39445 100644
--- a/src/cz/crcs/ectester/data/cofactor/cofactor192p8.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor192p8.csv
diff --git a/src/cz/crcs/ectester/data/cofactor/cofactor233t128.csv b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor233t128.csv
index 48505d4..48505d4 100644
--- a/src/cz/crcs/ectester/data/cofactor/cofactor233t128.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor233t128.csv
diff --git a/src/cz/crcs/ectester/data/cofactor/cofactor233t16.csv b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor233t16.csv
index d838407..d838407 100644
--- a/src/cz/crcs/ectester/data/cofactor/cofactor233t16.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor233t16.csv
diff --git a/src/cz/crcs/ectester/data/cofactor/cofactor233t2.csv b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor233t2.csv
index 61a945f..61a945f 100644
--- a/src/cz/crcs/ectester/data/cofactor/cofactor233t2.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor233t2.csv
diff --git a/src/cz/crcs/ectester/data/cofactor/cofactor233t32.csv b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor233t32.csv
index 4f14dfe..4f14dfe 100644
--- a/src/cz/crcs/ectester/data/cofactor/cofactor233t32.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor233t32.csv
diff --git a/src/cz/crcs/ectester/data/cofactor/cofactor233t4.csv b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor233t4.csv
index 1972de2..1972de2 100644
--- a/src/cz/crcs/ectester/data/cofactor/cofactor233t4.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor233t4.csv
diff --git a/src/cz/crcs/ectester/data/cofactor/cofactor233t64.csv b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor233t64.csv
index df9e357..df9e357 100644
--- a/src/cz/crcs/ectester/data/cofactor/cofactor233t64.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor233t64.csv
diff --git a/src/cz/crcs/ectester/data/cofactor/cofactor233t8.csv b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor233t8.csv
index 43f6705..43f6705 100644
--- a/src/cz/crcs/ectester/data/cofactor/cofactor233t8.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/cofactor/cofactor233t8.csv
diff --git a/src/cz/crcs/ectester/data/cofactor/curves.xml b/common/src/main/resources/cz/crcs/ectester/data/cofactor/curves.xml
index 30204e8..30204e8 100644
--- a/src/cz/crcs/ectester/data/cofactor/curves.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/cofactor/curves.xml
diff --git a/src/cz/crcs/ectester/data/cofactor/keys.xml b/common/src/main/resources/cz/crcs/ectester/data/cofactor/keys.xml
index d6058f0..d6058f0 100644
--- a/src/cz/crcs/ectester/data/cofactor/keys.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/cofactor/keys.xml
diff --git a/src/cz/crcs/ectester/data/cofactor/secg_keys.xml b/common/src/main/resources/cz/crcs/ectester/data/cofactor/secg_keys.xml
index 9634e9d..9634e9d 100644
--- a/src/cz/crcs/ectester/data/cofactor/secg_keys.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/cofactor/secg_keys.xml
diff --git a/src/cz/crcs/ectester/data/composite/carmichael_128.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/carmichael_128.csv
index 400abca..400abca 100644
--- a/src/cz/crcs/ectester/data/composite/carmichael_128.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/carmichael_128.csv
diff --git a/src/cz/crcs/ectester/data/composite/carmichael_192.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/carmichael_192.csv
index 7c21982..7c21982 100644
--- a/src/cz/crcs/ectester/data/composite/carmichael_192.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/carmichael_192.csv
diff --git a/src/cz/crcs/ectester/data/composite/carmichael_224.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/carmichael_224.csv
index d72a30c..d72a30c 100644
--- a/src/cz/crcs/ectester/data/composite/carmichael_224.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/carmichael_224.csv
diff --git a/src/cz/crcs/ectester/data/composite/carmichael_256.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/carmichael_256.csv
index fea4281..fea4281 100644
--- a/src/cz/crcs/ectester/data/composite/carmichael_256.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/carmichael_256.csv
diff --git a/src/cz/crcs/ectester/data/composite/carmichael_384.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/carmichael_384.csv
index 3002514..3002514 100644
--- a/src/cz/crcs/ectester/data/composite/carmichael_384.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/carmichael_384.csv
diff --git a/src/cz/crcs/ectester/data/composite/carmichael_512.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/carmichael_512.csv
index 59d0b03..59d0b03 100644
--- a/src/cz/crcs/ectester/data/composite/carmichael_512.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/carmichael_512.csv
diff --git a/src/cz/crcs/ectester/data/composite/carmichael_521.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/carmichael_521.csv
index 47ec1c3..47ec1c3 100644
--- a/src/cz/crcs/ectester/data/composite/carmichael_521.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/carmichael_521.csv
diff --git a/src/cz/crcs/ectester/data/composite/composite128.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/composite128.csv
index 66b7011..66b7011 100644
--- a/src/cz/crcs/ectester/data/composite/composite128.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/composite128.csv
diff --git a/src/cz/crcs/ectester/data/composite/composite128_pq.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/composite128_pq.csv
index 8aea6b2..8aea6b2 100644
--- a/src/cz/crcs/ectester/data/composite/composite128_pq.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/composite128_pq.csv
diff --git a/src/cz/crcs/ectester/data/composite/composite128_pq1.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/composite128_pq1.csv
index a551487..a551487 100644
--- a/src/cz/crcs/ectester/data/composite/composite128_pq1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/composite128_pq1.csv
diff --git a/src/cz/crcs/ectester/data/composite/composite128_pq2.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/composite128_pq2.csv
index 69181df..69181df 100644
--- a/src/cz/crcs/ectester/data/composite/composite128_pq2.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/composite128_pq2.csv
diff --git a/src/cz/crcs/ectester/data/composite/composite128_rg0.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/composite128_rg0.csv
index 2e039f4..2e039f4 100644
--- a/src/cz/crcs/ectester/data/composite/composite128_rg0.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/composite128_rg0.csv
diff --git a/src/cz/crcs/ectester/data/composite/composite128_small.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/composite128_small.csv
index fbcbdca..fbcbdca 100644
--- a/src/cz/crcs/ectester/data/composite/composite128_small.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/composite128_small.csv
diff --git a/src/cz/crcs/ectester/data/composite/composite160.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/composite160.csv
index a78d77c..a78d77c 100644
--- a/src/cz/crcs/ectester/data/composite/composite160.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/composite160.csv
diff --git a/src/cz/crcs/ectester/data/composite/composite160_pq.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/composite160_pq.csv
index 3f43b50..3f43b50 100644
--- a/src/cz/crcs/ectester/data/composite/composite160_pq.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/composite160_pq.csv
diff --git a/src/cz/crcs/ectester/data/composite/composite160_pq1.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/composite160_pq1.csv
index debd466..debd466 100644
--- a/src/cz/crcs/ectester/data/composite/composite160_pq1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/composite160_pq1.csv
diff --git a/src/cz/crcs/ectester/data/composite/composite160_pq2.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/composite160_pq2.csv
index efd7475..efd7475 100644
--- a/src/cz/crcs/ectester/data/composite/composite160_pq2.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/composite160_pq2.csv
diff --git a/src/cz/crcs/ectester/data/composite/composite160_rg0.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/composite160_rg0.csv
index e6a1a95..e6a1a95 100644
--- a/src/cz/crcs/ectester/data/composite/composite160_rg0.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/composite160_rg0.csv
diff --git a/src/cz/crcs/ectester/data/composite/composite160_small.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/composite160_small.csv
index 2adaa8b..2adaa8b 100644
--- a/src/cz/crcs/ectester/data/composite/composite160_small.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/composite160_small.csv
diff --git a/src/cz/crcs/ectester/data/composite/composite192.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/composite192.csv
index a9fbe1f..a9fbe1f 100644
--- a/src/cz/crcs/ectester/data/composite/composite192.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/composite192.csv
diff --git a/src/cz/crcs/ectester/data/composite/composite192_pq.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/composite192_pq.csv
index 47b8a13..47b8a13 100644
--- a/src/cz/crcs/ectester/data/composite/composite192_pq.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/composite192_pq.csv
diff --git a/src/cz/crcs/ectester/data/composite/composite192_pq1.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/composite192_pq1.csv
index 664d35e..664d35e 100644
--- a/src/cz/crcs/ectester/data/composite/composite192_pq1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/composite192_pq1.csv
diff --git a/src/cz/crcs/ectester/data/composite/composite192_pq2.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/composite192_pq2.csv
index 33fe0f3..33fe0f3 100644
--- a/src/cz/crcs/ectester/data/composite/composite192_pq2.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/composite192_pq2.csv
diff --git a/src/cz/crcs/ectester/data/composite/composite192_rg0.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/composite192_rg0.csv
index a55a994..a55a994 100644
--- a/src/cz/crcs/ectester/data/composite/composite192_rg0.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/composite192_rg0.csv
diff --git a/src/cz/crcs/ectester/data/composite/composite192_small.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/composite192_small.csv
index a90364d..a90364d 100644
--- a/src/cz/crcs/ectester/data/composite/composite192_small.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/composite192_small.csv
diff --git a/src/cz/crcs/ectester/data/composite/composite224.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/composite224.csv
index 7902f2b..7902f2b 100644
--- a/src/cz/crcs/ectester/data/composite/composite224.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/composite224.csv
diff --git a/src/cz/crcs/ectester/data/composite/composite224_pq.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/composite224_pq.csv
index ffa2cc1..ffa2cc1 100644
--- a/src/cz/crcs/ectester/data/composite/composite224_pq.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/composite224_pq.csv
diff --git a/src/cz/crcs/ectester/data/composite/composite224_pq1.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/composite224_pq1.csv
index 6a01e2d..6a01e2d 100644
--- a/src/cz/crcs/ectester/data/composite/composite224_pq1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/composite224_pq1.csv
diff --git a/src/cz/crcs/ectester/data/composite/composite224_pq2.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/composite224_pq2.csv
index f8bc6df..f8bc6df 100644
--- a/src/cz/crcs/ectester/data/composite/composite224_pq2.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/composite224_pq2.csv
diff --git a/src/cz/crcs/ectester/data/composite/composite224_rg0.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/composite224_rg0.csv
index 835676d..835676d 100644
--- a/src/cz/crcs/ectester/data/composite/composite224_rg0.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/composite224_rg0.csv
diff --git a/src/cz/crcs/ectester/data/composite/composite224_small.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/composite224_small.csv
index ea18b96..ea18b96 100644
--- a/src/cz/crcs/ectester/data/composite/composite224_small.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/composite224_small.csv
diff --git a/src/cz/crcs/ectester/data/composite/composite256.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/composite256.csv
index 7769ef2..7769ef2 100644
--- a/src/cz/crcs/ectester/data/composite/composite256.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/composite256.csv
diff --git a/src/cz/crcs/ectester/data/composite/composite256_pq.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/composite256_pq.csv
index 380f756..380f756 100644
--- a/src/cz/crcs/ectester/data/composite/composite256_pq.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/composite256_pq.csv
diff --git a/src/cz/crcs/ectester/data/composite/composite256_pq1.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/composite256_pq1.csv
index 9ac845f..9ac845f 100644
--- a/src/cz/crcs/ectester/data/composite/composite256_pq1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/composite256_pq1.csv
diff --git a/src/cz/crcs/ectester/data/composite/composite256_pq2.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/composite256_pq2.csv
index b8b5e9b..b8b5e9b 100644
--- a/src/cz/crcs/ectester/data/composite/composite256_pq2.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/composite256_pq2.csv
diff --git a/src/cz/crcs/ectester/data/composite/composite256_rg0.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/composite256_rg0.csv
index 0c2d123..0c2d123 100644
--- a/src/cz/crcs/ectester/data/composite/composite256_rg0.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/composite256_rg0.csv
diff --git a/src/cz/crcs/ectester/data/composite/composite256_small.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/composite256_small.csv
index 58c0a75..58c0a75 100644
--- a/src/cz/crcs/ectester/data/composite/composite256_small.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/composite256_small.csv
diff --git a/src/cz/crcs/ectester/data/composite/composite384.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/composite384.csv
index 4e9d058..4e9d058 100644
--- a/src/cz/crcs/ectester/data/composite/composite384.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/composite384.csv
diff --git a/src/cz/crcs/ectester/data/composite/composite384_small.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/composite384_small.csv
index 00b643b..00b643b 100644
--- a/src/cz/crcs/ectester/data/composite/composite384_small.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/composite384_small.csv
diff --git a/src/cz/crcs/ectester/data/composite/composite521.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/composite521.csv
index 8681273..8681273 100644
--- a/src/cz/crcs/ectester/data/composite/composite521.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/composite521.csv
diff --git a/src/cz/crcs/ectester/data/composite/composite521_small.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/composite521_small.csv
index 15df9c8..15df9c8 100644
--- a/src/cz/crcs/ectester/data/composite/composite521_small.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/composite521_small.csv
diff --git a/src/cz/crcs/ectester/data/composite/curves.xml b/common/src/main/resources/cz/crcs/ectester/data/composite/curves.xml
index 34ad33a..34ad33a 100644
--- a/src/cz/crcs/ectester/data/composite/curves.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/curves.xml
diff --git a/src/cz/crcs/ectester/data/composite/keys.xml b/common/src/main/resources/cz/crcs/ectester/data/composite/keys.xml
index da770d8..da770d8 100644
--- a/src/cz/crcs/ectester/data/composite/keys.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/keys.xml
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/first/10.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/10.csv
index 5fa842a..5fa842a 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/first/10.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/10.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/first/112.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/112.csv
index 633ccd5..633ccd5 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/first/112.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/112.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/first/12.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/12.csv
index 62bb1a0..62bb1a0 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/first/12.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/12.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/first/128.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/128.csv
index 5f8c532..5f8c532 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/first/128.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/128.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/first/135.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/135.csv
index 232abff..232abff 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/first/135.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/135.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/first/14.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/14.csv
index c8df53e..c8df53e 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/first/14.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/14.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/first/140.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/140.csv
index 4d59858..4d59858 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/first/140.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/140.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/first/144.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/144.csv
index e8c6492..e8c6492 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/first/144.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/144.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/first/146.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/146.csv
index f656c72..f656c72 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/first/146.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/146.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/first/148.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/148.csv
index b292889..b292889 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/first/148.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/148.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/first/150.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/150.csv
index c1bf12e..c1bf12e 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/first/150.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/150.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/first/152.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/152.csv
index 24a03ba..24a03ba 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/first/152.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/152.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/first/152_cofactor.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/152_cofactor.csv
index 7861bbd..7861bbd 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/first/152_cofactor.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/152_cofactor.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/first/16.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/16.csv
index fd76ff7..fd76ff7 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/first/16.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/16.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/first/20.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/20.csv
index 940d10c..940d10c 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/first/20.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/20.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/first/25.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/25.csv
index 318099b..318099b 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/first/25.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/25.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/first/2a.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/2a.csv
index 670f4bc..670f4bc 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/first/2a.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/2a.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/first/2b.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/2b.csv
index 216827b..216827b 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/first/2b.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/2b.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/first/3.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/3.csv
index 18ec491..18ec491 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/first/3.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/3.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/first/32.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/32.csv
index fddfeee..fddfeee 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/first/32.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/32.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/first/4.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/4.csv
index a5b9e09..a5b9e09 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/first/4.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/4.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/first/48.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/48.csv
index 202a15b..202a15b 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/first/48.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/48.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/first/5.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/5.csv
index 5f0597c..5f0597c 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/first/5.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/5.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/first/6.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/6.csv
index 9c1528f..9c1528f 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/first/6.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/6.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/first/64.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/64.csv
index 94a2709..94a2709 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/first/64.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/64.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/first/7.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/7.csv
index 170b180..170b180 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/first/7.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/7.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/first/70.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/70.csv
index 1dbf9c0..1dbf9c0 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/first/70.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/70.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/first/8.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/8.csv
index 232df05..232df05 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/first/8.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/8.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/first/80.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/80.csv
index da082ef..da082ef 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/first/80.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/80.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/first/90.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/90.csv
index d67e673..d67e673 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/first/90.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/90.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/first/96.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/96.csv
index 5dd2d5c..5dd2d5c 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/first/96.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/first/96.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/second/140.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/140.csv
index 08f5ba1..08f5ba1 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/second/140.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/140.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/second/141.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/141.csv
index 896493f..896493f 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/second/141.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/141.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/second/142.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/142.csv
index cc5fd67..cc5fd67 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/second/142.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/142.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/second/143.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/143.csv
index 9c4861e..9c4861e 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/second/143.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/143.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/second/144.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/144.csv
index db68fad..db68fad 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/second/144.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/144.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/second/145.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/145.csv
index 08c8c4f..08c8c4f 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/second/145.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/145.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/second/146.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/146.csv
index 3afd1a0..3afd1a0 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/second/146.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/146.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/second/147.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/147.csv
index 895acfe..895acfe 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/second/147.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/147.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/second/148.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/148.csv
index 0e2221f..0e2221f 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/second/148.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/148.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/second/149.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/149.csv
index 2fb41e3..2fb41e3 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/second/149.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/149.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/second/150.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/150.csv
index e38fe99..e38fe99 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/second/150.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/150.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/second/151.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/151.csv
index 9b665bc..9b665bc 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/second/151.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/151.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/second/152.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/152.csv
index 854a93f..854a93f 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/second/152.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/152.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/second/153.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/153.csv
index 90ff712..90ff712 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/second/153.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/153.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/second/154.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/154.csv
index 1c45df7..1c45df7 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/second/154.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/154.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/second/155.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/155.csv
index a3dcc8c..a3dcc8c 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/second/155.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/155.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/second/156.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/156.csv
index 7614b13..7614b13 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/second/156.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/156.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/second/157.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/157.csv
index 06cd933..06cd933 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/second/157.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/157.csv
diff --git a/src/cz/crcs/ectester/data/composite/varying/160/second/158.csv b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/158.csv
index c35a628..c35a628 100644
--- a/src/cz/crcs/ectester/data/composite/varying/160/second/158.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/composite/varying/160/second/158.csv
diff --git a/src/cz/crcs/ectester/data/degenerate/brainpool.xml b/common/src/main/resources/cz/crcs/ectester/data/degenerate/brainpool.xml
index 3dd2f54..3dd2f54 100644
--- a/src/cz/crcs/ectester/data/degenerate/brainpool.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/degenerate/brainpool.xml
diff --git a/src/cz/crcs/ectester/data/degenerate/cofactor.xml b/common/src/main/resources/cz/crcs/ectester/data/degenerate/cofactor.xml
index 647515b..647515b 100644
--- a/src/cz/crcs/ectester/data/degenerate/cofactor.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/degenerate/cofactor.xml
diff --git a/src/cz/crcs/ectester/data/degenerate/keys.xml b/common/src/main/resources/cz/crcs/ectester/data/degenerate/keys.xml
index 498cf26..498cf26 100644
--- a/src/cz/crcs/ectester/data/degenerate/keys.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/degenerate/keys.xml
diff --git a/src/cz/crcs/ectester/data/degenerate/secg.xml b/common/src/main/resources/cz/crcs/ectester/data/degenerate/secg.xml
index 2cf81e7..2cf81e7 100644
--- a/src/cz/crcs/ectester/data/degenerate/secg.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/degenerate/secg.xml
diff --git a/src/cz/crcs/ectester/data/gost/curves.xml b/common/src/main/resources/cz/crcs/ectester/data/gost/curves.xml
index 2b83c5e..2b83c5e 100644
--- a/src/cz/crcs/ectester/data/gost/curves.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/gost/curves.xml
diff --git a/src/cz/crcs/ectester/data/gost/gost256.csv b/common/src/main/resources/cz/crcs/ectester/data/gost/gost256.csv
index baea45a..baea45a 100644
--- a/src/cz/crcs/ectester/data/gost/gost256.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/gost/gost256.csv
diff --git a/src/cz/crcs/ectester/data/gost/gost512.csv b/common/src/main/resources/cz/crcs/ectester/data/gost/gost512.csv
index 5b24d59..5b24d59 100644
--- a/src/cz/crcs/ectester/data/gost/gost512.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/gost/gost512.csv
diff --git a/src/cz/crcs/ectester/data/invalid/brainpool/brainpoolP160r1.xml b/common/src/main/resources/cz/crcs/ectester/data/invalid/brainpool/brainpoolP160r1.xml
index 7656432..7656432 100644
--- a/src/cz/crcs/ectester/data/invalid/brainpool/brainpoolP160r1.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/invalid/brainpool/brainpoolP160r1.xml
diff --git a/src/cz/crcs/ectester/data/invalid/brainpool/brainpoolP160t1.xml b/common/src/main/resources/cz/crcs/ectester/data/invalid/brainpool/brainpoolP160t1.xml
index ffac676..ffac676 100644
--- a/src/cz/crcs/ectester/data/invalid/brainpool/brainpoolP160t1.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/invalid/brainpool/brainpoolP160t1.xml
diff --git a/src/cz/crcs/ectester/data/invalid/brainpool/brainpoolP192r1.xml b/common/src/main/resources/cz/crcs/ectester/data/invalid/brainpool/brainpoolP192r1.xml
index 4ceb20c..4ceb20c 100644
--- a/src/cz/crcs/ectester/data/invalid/brainpool/brainpoolP192r1.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/invalid/brainpool/brainpoolP192r1.xml
diff --git a/src/cz/crcs/ectester/data/invalid/brainpool/brainpoolP192t1.xml b/common/src/main/resources/cz/crcs/ectester/data/invalid/brainpool/brainpoolP192t1.xml
index fe06dcf..fe06dcf 100644
--- a/src/cz/crcs/ectester/data/invalid/brainpool/brainpoolP192t1.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/invalid/brainpool/brainpoolP192t1.xml
diff --git a/src/cz/crcs/ectester/data/invalid/brainpool/brainpoolP224r1.xml b/common/src/main/resources/cz/crcs/ectester/data/invalid/brainpool/brainpoolP224r1.xml
index c708160..c708160 100644
--- a/src/cz/crcs/ectester/data/invalid/brainpool/brainpoolP224r1.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/invalid/brainpool/brainpoolP224r1.xml
diff --git a/src/cz/crcs/ectester/data/invalid/brainpool/brainpoolP224t1.xml b/common/src/main/resources/cz/crcs/ectester/data/invalid/brainpool/brainpoolP224t1.xml
index c7ae75b..c7ae75b 100644
--- a/src/cz/crcs/ectester/data/invalid/brainpool/brainpoolP224t1.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/invalid/brainpool/brainpoolP224t1.xml
diff --git a/src/cz/crcs/ectester/data/invalid/brainpool/brainpoolP256r1.xml b/common/src/main/resources/cz/crcs/ectester/data/invalid/brainpool/brainpoolP256r1.xml
index 30343e6..30343e6 100644
--- a/src/cz/crcs/ectester/data/invalid/brainpool/brainpoolP256r1.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/invalid/brainpool/brainpoolP256r1.xml
diff --git a/src/cz/crcs/ectester/data/invalid/brainpool/brainpoolP256t1.xml b/common/src/main/resources/cz/crcs/ectester/data/invalid/brainpool/brainpoolP256t1.xml
index 8b0a544..8b0a544 100644
--- a/src/cz/crcs/ectester/data/invalid/brainpool/brainpoolP256t1.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/invalid/brainpool/brainpoolP256t1.xml
diff --git a/src/cz/crcs/ectester/data/invalid/keys.xml b/common/src/main/resources/cz/crcs/ectester/data/invalid/keys.xml
index d630129..d630129 100644
--- a/src/cz/crcs/ectester/data/invalid/keys.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/invalid/keys.xml
diff --git a/src/cz/crcs/ectester/data/invalid/nist/b163.xml b/common/src/main/resources/cz/crcs/ectester/data/invalid/nist/b163.xml
index e3df992..e3df992 100644
--- a/src/cz/crcs/ectester/data/invalid/nist/b163.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/invalid/nist/b163.xml
diff --git a/src/cz/crcs/ectester/data/invalid/nist/b233.xml b/common/src/main/resources/cz/crcs/ectester/data/invalid/nist/b233.xml
index f1ebb74..f1ebb74 100644
--- a/src/cz/crcs/ectester/data/invalid/nist/b233.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/invalid/nist/b233.xml
diff --git a/src/cz/crcs/ectester/data/invalid/nist/b283.xml b/common/src/main/resources/cz/crcs/ectester/data/invalid/nist/b283.xml
index b925891..b925891 100644
--- a/src/cz/crcs/ectester/data/invalid/nist/b283.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/invalid/nist/b283.xml
diff --git a/src/cz/crcs/ectester/data/invalid/nist/k163.xml b/common/src/main/resources/cz/crcs/ectester/data/invalid/nist/k163.xml
index baa9ef5..baa9ef5 100644
--- a/src/cz/crcs/ectester/data/invalid/nist/k163.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/invalid/nist/k163.xml
diff --git a/src/cz/crcs/ectester/data/invalid/nist/k233.xml b/common/src/main/resources/cz/crcs/ectester/data/invalid/nist/k233.xml
index 250c9df..250c9df 100644
--- a/src/cz/crcs/ectester/data/invalid/nist/k233.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/invalid/nist/k233.xml
diff --git a/src/cz/crcs/ectester/data/invalid/nist/k283.xml b/common/src/main/resources/cz/crcs/ectester/data/invalid/nist/k283.xml
index 38e3659..38e3659 100644
--- a/src/cz/crcs/ectester/data/invalid/nist/k283.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/invalid/nist/k283.xml
diff --git a/src/cz/crcs/ectester/data/invalid/secg/secp112r1.xml b/common/src/main/resources/cz/crcs/ectester/data/invalid/secg/secp112r1.xml
index c93b236..c93b236 100644
--- a/src/cz/crcs/ectester/data/invalid/secg/secp112r1.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/invalid/secg/secp112r1.xml
diff --git a/src/cz/crcs/ectester/data/invalid/secg/secp112r2.xml b/common/src/main/resources/cz/crcs/ectester/data/invalid/secg/secp112r2.xml
index 49f869a..49f869a 100644
--- a/src/cz/crcs/ectester/data/invalid/secg/secp112r2.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/invalid/secg/secp112r2.xml
diff --git a/src/cz/crcs/ectester/data/invalid/secg/secp128r1.xml b/common/src/main/resources/cz/crcs/ectester/data/invalid/secg/secp128r1.xml
index e010003..e010003 100644
--- a/src/cz/crcs/ectester/data/invalid/secg/secp128r1.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/invalid/secg/secp128r1.xml
diff --git a/src/cz/crcs/ectester/data/invalid/secg/secp128r2.xml b/common/src/main/resources/cz/crcs/ectester/data/invalid/secg/secp128r2.xml
index 1bf0e19..1bf0e19 100644
--- a/src/cz/crcs/ectester/data/invalid/secg/secp128r2.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/invalid/secg/secp128r2.xml
diff --git a/src/cz/crcs/ectester/data/invalid/secg/secp160r1.xml b/common/src/main/resources/cz/crcs/ectester/data/invalid/secg/secp160r1.xml
index c0ac9f5..c0ac9f5 100644
--- a/src/cz/crcs/ectester/data/invalid/secg/secp160r1.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/invalid/secg/secp160r1.xml
diff --git a/src/cz/crcs/ectester/data/invalid/secg/secp160r2.xml b/common/src/main/resources/cz/crcs/ectester/data/invalid/secg/secp160r2.xml
index 5a0afdc..5a0afdc 100644
--- a/src/cz/crcs/ectester/data/invalid/secg/secp160r2.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/invalid/secg/secp160r2.xml
diff --git a/src/cz/crcs/ectester/data/invalid/secg/secp192r1.xml b/common/src/main/resources/cz/crcs/ectester/data/invalid/secg/secp192r1.xml
index 6ecf018..6ecf018 100644
--- a/src/cz/crcs/ectester/data/invalid/secg/secp192r1.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/invalid/secg/secp192r1.xml
diff --git a/src/cz/crcs/ectester/data/invalid/secg/secp224r1.xml b/common/src/main/resources/cz/crcs/ectester/data/invalid/secg/secp224r1.xml
index 9ce561d..9ce561d 100644
--- a/src/cz/crcs/ectester/data/invalid/secg/secp224r1.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/invalid/secg/secp224r1.xml
diff --git a/src/cz/crcs/ectester/data/invalid/secg/secp256r1.xml b/common/src/main/resources/cz/crcs/ectester/data/invalid/secg/secp256r1.xml
index 6a30210..6a30210 100644
--- a/src/cz/crcs/ectester/data/invalid/secg/secp256r1.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/invalid/secg/secp256r1.xml
diff --git a/src/cz/crcs/ectester/data/misc/keys.xml b/common/src/main/resources/cz/crcs/ectester/data/misc/keys.xml
index e17b45b..e17b45b 100644
--- a/src/cz/crcs/ectester/data/misc/keys.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/misc/keys.xml
diff --git a/src/cz/crcs/ectester/data/misc/results.xml b/common/src/main/resources/cz/crcs/ectester/data/misc/results.xml
index 07601b1..07601b1 100644
--- a/src/cz/crcs/ectester/data/misc/results.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/misc/results.xml
diff --git a/src/cz/crcs/ectester/data/mnt/curves.xml b/common/src/main/resources/cz/crcs/ectester/data/mnt/curves.xml
index 0087a5a..0087a5a 100644
--- a/src/cz/crcs/ectester/data/mnt/curves.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/mnt/curves.xml
diff --git a/src/cz/crcs/ectester/data/mnt/mnt1.csv b/common/src/main/resources/cz/crcs/ectester/data/mnt/mnt1.csv
index 7ff5784..7ff5784 100644
--- a/src/cz/crcs/ectester/data/mnt/mnt1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/mnt/mnt1.csv
diff --git a/src/cz/crcs/ectester/data/mnt/mnt2_1.csv b/common/src/main/resources/cz/crcs/ectester/data/mnt/mnt2_1.csv
index a53376f..a53376f 100644
--- a/src/cz/crcs/ectester/data/mnt/mnt2_1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/mnt/mnt2_1.csv
diff --git a/src/cz/crcs/ectester/data/mnt/mnt2_2.csv b/common/src/main/resources/cz/crcs/ectester/data/mnt/mnt2_2.csv
index 20dd8f4..20dd8f4 100644
--- a/src/cz/crcs/ectester/data/mnt/mnt2_2.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/mnt/mnt2_2.csv
diff --git a/src/cz/crcs/ectester/data/mnt/mnt3_1.csv b/common/src/main/resources/cz/crcs/ectester/data/mnt/mnt3_1.csv
index d00719d..d00719d 100644
--- a/src/cz/crcs/ectester/data/mnt/mnt3_1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/mnt/mnt3_1.csv
diff --git a/src/cz/crcs/ectester/data/mnt/mnt3_2.csv b/common/src/main/resources/cz/crcs/ectester/data/mnt/mnt3_2.csv
index 86d8191..86d8191 100644
--- a/src/cz/crcs/ectester/data/mnt/mnt3_2.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/mnt/mnt3_2.csv
diff --git a/src/cz/crcs/ectester/data/mnt/mnt3_3.csv b/common/src/main/resources/cz/crcs/ectester/data/mnt/mnt3_3.csv
index 348b30d..348b30d 100644
--- a/src/cz/crcs/ectester/data/mnt/mnt3_3.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/mnt/mnt3_3.csv
diff --git a/src/cz/crcs/ectester/data/mnt/mnt4.csv b/common/src/main/resources/cz/crcs/ectester/data/mnt/mnt4.csv
index ea5eaa1..ea5eaa1 100644
--- a/src/cz/crcs/ectester/data/mnt/mnt4.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/mnt/mnt4.csv
diff --git a/src/cz/crcs/ectester/data/mnt/mnt5_1.csv b/common/src/main/resources/cz/crcs/ectester/data/mnt/mnt5_1.csv
index 2fd1622..2fd1622 100644
--- a/src/cz/crcs/ectester/data/mnt/mnt5_1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/mnt/mnt5_1.csv
diff --git a/src/cz/crcs/ectester/data/mnt/mnt5_2.csv b/common/src/main/resources/cz/crcs/ectester/data/mnt/mnt5_2.csv
index 18ec3a5..18ec3a5 100644
--- a/src/cz/crcs/ectester/data/mnt/mnt5_2.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/mnt/mnt5_2.csv
diff --git a/src/cz/crcs/ectester/data/mnt/mnt5_3.csv b/common/src/main/resources/cz/crcs/ectester/data/mnt/mnt5_3.csv
index 73fce1d..73fce1d 100644
--- a/src/cz/crcs/ectester/data/mnt/mnt5_3.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/mnt/mnt5_3.csv
diff --git a/src/cz/crcs/ectester/data/nist/b163.csv b/common/src/main/resources/cz/crcs/ectester/data/nist/b163.csv
index 85b777b..85b777b 100644
--- a/src/cz/crcs/ectester/data/nist/b163.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/nist/b163.csv
diff --git a/src/cz/crcs/ectester/data/nist/b233.csv b/common/src/main/resources/cz/crcs/ectester/data/nist/b233.csv
index a9c2711..a9c2711 100644
--- a/src/cz/crcs/ectester/data/nist/b233.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/nist/b233.csv
diff --git a/src/cz/crcs/ectester/data/nist/b283.csv b/common/src/main/resources/cz/crcs/ectester/data/nist/b283.csv
index 06cc151..06cc151 100644
--- a/src/cz/crcs/ectester/data/nist/b283.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/nist/b283.csv
diff --git a/src/cz/crcs/ectester/data/nist/b409.csv b/common/src/main/resources/cz/crcs/ectester/data/nist/b409.csv
index 66523a7..66523a7 100644
--- a/src/cz/crcs/ectester/data/nist/b409.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/nist/b409.csv
diff --git a/src/cz/crcs/ectester/data/nist/b571.csv b/common/src/main/resources/cz/crcs/ectester/data/nist/b571.csv
index 7d824c4..7d824c4 100644
--- a/src/cz/crcs/ectester/data/nist/b571.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/nist/b571.csv
diff --git a/src/cz/crcs/ectester/data/nist/curves.xml b/common/src/main/resources/cz/crcs/ectester/data/nist/curves.xml
index 2abf72f..2abf72f 100644
--- a/src/cz/crcs/ectester/data/nist/curves.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/nist/curves.xml
diff --git a/src/cz/crcs/ectester/data/nist/k163.csv b/common/src/main/resources/cz/crcs/ectester/data/nist/k163.csv
index e35fbda..e35fbda 100644
--- a/src/cz/crcs/ectester/data/nist/k163.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/nist/k163.csv
diff --git a/src/cz/crcs/ectester/data/nist/k233.csv b/common/src/main/resources/cz/crcs/ectester/data/nist/k233.csv
index a429d81..a429d81 100644
--- a/src/cz/crcs/ectester/data/nist/k233.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/nist/k233.csv
diff --git a/src/cz/crcs/ectester/data/nist/k283.csv b/common/src/main/resources/cz/crcs/ectester/data/nist/k283.csv
index 32dcc3e..32dcc3e 100644
--- a/src/cz/crcs/ectester/data/nist/k283.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/nist/k283.csv
diff --git a/src/cz/crcs/ectester/data/nist/k409.csv b/common/src/main/resources/cz/crcs/ectester/data/nist/k409.csv
index 119754a..119754a 100644
--- a/src/cz/crcs/ectester/data/nist/k409.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/nist/k409.csv
diff --git a/src/cz/crcs/ectester/data/nist/k571.csv b/common/src/main/resources/cz/crcs/ectester/data/nist/k571.csv
index 7fb1431..7fb1431 100644
--- a/src/cz/crcs/ectester/data/nist/k571.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/nist/k571.csv
diff --git a/src/cz/crcs/ectester/data/nist/p192.csv b/common/src/main/resources/cz/crcs/ectester/data/nist/p192.csv
index 07f9154..07f9154 100644
--- a/src/cz/crcs/ectester/data/nist/p192.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/nist/p192.csv
diff --git a/src/cz/crcs/ectester/data/nist/p224.csv b/common/src/main/resources/cz/crcs/ectester/data/nist/p224.csv
index 4b206d4..4b206d4 100644
--- a/src/cz/crcs/ectester/data/nist/p224.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/nist/p224.csv
diff --git a/src/cz/crcs/ectester/data/nist/p256.csv b/common/src/main/resources/cz/crcs/ectester/data/nist/p256.csv
index c5a2440..c5a2440 100644
--- a/src/cz/crcs/ectester/data/nist/p256.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/nist/p256.csv
diff --git a/src/cz/crcs/ectester/data/nist/p384.csv b/common/src/main/resources/cz/crcs/ectester/data/nist/p384.csv
index eeba9fa..eeba9fa 100644
--- a/src/cz/crcs/ectester/data/nist/p384.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/nist/p384.csv
diff --git a/src/cz/crcs/ectester/data/nist/p521.csv b/common/src/main/resources/cz/crcs/ectester/data/nist/p521.csv
index 609672f..609672f 100644
--- a/src/cz/crcs/ectester/data/nist/p521.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/nist/p521.csv
diff --git a/src/cz/crcs/ectester/data/other/curve25519.csv b/common/src/main/resources/cz/crcs/ectester/data/other/curve25519.csv
index 2e62d80..2e62d80 100644
--- a/src/cz/crcs/ectester/data/other/curve25519.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/other/curve25519.csv
diff --git a/src/cz/crcs/ectester/data/other/curves.xml b/common/src/main/resources/cz/crcs/ectester/data/other/curves.xml
index f200d9c..f200d9c 100644
--- a/src/cz/crcs/ectester/data/other/curves.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/other/curves.xml
diff --git a/src/cz/crcs/ectester/data/other/m221.csv b/common/src/main/resources/cz/crcs/ectester/data/other/m221.csv
index 0a74263..0a74263 100644
--- a/src/cz/crcs/ectester/data/other/m221.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/other/m221.csv
diff --git a/src/cz/crcs/ectester/data/other/m383.csv b/common/src/main/resources/cz/crcs/ectester/data/other/m383.csv
index 9a8890d..9a8890d 100644
--- a/src/cz/crcs/ectester/data/other/m383.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/other/m383.csv
diff --git a/src/cz/crcs/ectester/data/other/m511.csv b/common/src/main/resources/cz/crcs/ectester/data/other/m511.csv
index 815714c..815714c 100644
--- a/src/cz/crcs/ectester/data/other/m511.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/other/m511.csv
diff --git a/src/cz/crcs/ectester/data/schema.xsd b/common/src/main/resources/cz/crcs/ectester/data/schema.xsd
index 99c9b76..99c9b76 100644
--- a/src/cz/crcs/ectester/data/schema.xsd
+++ b/common/src/main/resources/cz/crcs/ectester/data/schema.xsd
diff --git a/src/cz/crcs/ectester/data/secg/curves.xml b/common/src/main/resources/cz/crcs/ectester/data/secg/curves.xml
index c04fe38..c04fe38 100644
--- a/src/cz/crcs/ectester/data/secg/curves.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/secg/curves.xml
diff --git a/src/cz/crcs/ectester/data/secg/secp112r1.csv b/common/src/main/resources/cz/crcs/ectester/data/secg/secp112r1.csv
index 00d64d6..00d64d6 100644
--- a/src/cz/crcs/ectester/data/secg/secp112r1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/secg/secp112r1.csv
diff --git a/src/cz/crcs/ectester/data/secg/secp112r2.csv b/common/src/main/resources/cz/crcs/ectester/data/secg/secp112r2.csv
index 0513e72..0513e72 100644
--- a/src/cz/crcs/ectester/data/secg/secp112r2.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/secg/secp112r2.csv
diff --git a/src/cz/crcs/ectester/data/secg/secp128r1.csv b/common/src/main/resources/cz/crcs/ectester/data/secg/secp128r1.csv
index eea5fed..eea5fed 100644
--- a/src/cz/crcs/ectester/data/secg/secp128r1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/secg/secp128r1.csv
diff --git a/src/cz/crcs/ectester/data/secg/secp128r2.csv b/common/src/main/resources/cz/crcs/ectester/data/secg/secp128r2.csv
index 6f2d098..6f2d098 100644
--- a/src/cz/crcs/ectester/data/secg/secp128r2.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/secg/secp128r2.csv
diff --git a/src/cz/crcs/ectester/data/secg/secp160k1.csv b/common/src/main/resources/cz/crcs/ectester/data/secg/secp160k1.csv
index 7d14c99..7d14c99 100644
--- a/src/cz/crcs/ectester/data/secg/secp160k1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/secg/secp160k1.csv
diff --git a/src/cz/crcs/ectester/data/secg/secp160r1.csv b/common/src/main/resources/cz/crcs/ectester/data/secg/secp160r1.csv
index ed37d81..ed37d81 100644
--- a/src/cz/crcs/ectester/data/secg/secp160r1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/secg/secp160r1.csv
diff --git a/src/cz/crcs/ectester/data/secg/secp160r2.csv b/common/src/main/resources/cz/crcs/ectester/data/secg/secp160r2.csv
index 2121fc1..2121fc1 100644
--- a/src/cz/crcs/ectester/data/secg/secp160r2.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/secg/secp160r2.csv
diff --git a/src/cz/crcs/ectester/data/secg/secp192k1.csv b/common/src/main/resources/cz/crcs/ectester/data/secg/secp192k1.csv
index 550093b..550093b 100644
--- a/src/cz/crcs/ectester/data/secg/secp192k1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/secg/secp192k1.csv
diff --git a/src/cz/crcs/ectester/data/secg/secp192r1.csv b/common/src/main/resources/cz/crcs/ectester/data/secg/secp192r1.csv
index 07f9154..07f9154 100644
--- a/src/cz/crcs/ectester/data/secg/secp192r1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/secg/secp192r1.csv
diff --git a/src/cz/crcs/ectester/data/secg/secp224r1.csv b/common/src/main/resources/cz/crcs/ectester/data/secg/secp224r1.csv
index 4b206d4..4b206d4 100644
--- a/src/cz/crcs/ectester/data/secg/secp224r1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/secg/secp224r1.csv
diff --git a/src/cz/crcs/ectester/data/secg/secp256k1.csv b/common/src/main/resources/cz/crcs/ectester/data/secg/secp256k1.csv
index 7835afc..7835afc 100644
--- a/src/cz/crcs/ectester/data/secg/secp256k1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/secg/secp256k1.csv
diff --git a/src/cz/crcs/ectester/data/secg/secp256r1.csv b/common/src/main/resources/cz/crcs/ectester/data/secg/secp256r1.csv
index c5a2440..c5a2440 100644
--- a/src/cz/crcs/ectester/data/secg/secp256r1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/secg/secp256r1.csv
diff --git a/src/cz/crcs/ectester/data/secg/secp384r1.csv b/common/src/main/resources/cz/crcs/ectester/data/secg/secp384r1.csv
index eeba9fa..eeba9fa 100644
--- a/src/cz/crcs/ectester/data/secg/secp384r1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/secg/secp384r1.csv
diff --git a/src/cz/crcs/ectester/data/secg/secp521r1.csv b/common/src/main/resources/cz/crcs/ectester/data/secg/secp521r1.csv
index 609672f..609672f 100644
--- a/src/cz/crcs/ectester/data/secg/secp521r1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/secg/secp521r1.csv
diff --git a/src/cz/crcs/ectester/data/secg/sect163k1.csv b/common/src/main/resources/cz/crcs/ectester/data/secg/sect163k1.csv
index e35fbda..e35fbda 100644
--- a/src/cz/crcs/ectester/data/secg/sect163k1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/secg/sect163k1.csv
diff --git a/src/cz/crcs/ectester/data/secg/sect163r1.csv b/common/src/main/resources/cz/crcs/ectester/data/secg/sect163r1.csv
index fa7a328..fa7a328 100644
--- a/src/cz/crcs/ectester/data/secg/sect163r1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/secg/sect163r1.csv
diff --git a/src/cz/crcs/ectester/data/secg/sect163r2.csv b/common/src/main/resources/cz/crcs/ectester/data/secg/sect163r2.csv
index 85b777b..85b777b 100644
--- a/src/cz/crcs/ectester/data/secg/sect163r2.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/secg/sect163r2.csv
diff --git a/src/cz/crcs/ectester/data/secg/sect233k1.csv b/common/src/main/resources/cz/crcs/ectester/data/secg/sect233k1.csv
index a429d81..a429d81 100644
--- a/src/cz/crcs/ectester/data/secg/sect233k1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/secg/sect233k1.csv
diff --git a/src/cz/crcs/ectester/data/secg/sect233r1.csv b/common/src/main/resources/cz/crcs/ectester/data/secg/sect233r1.csv
index faba42b..faba42b 100644
--- a/src/cz/crcs/ectester/data/secg/sect233r1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/secg/sect233r1.csv
diff --git a/src/cz/crcs/ectester/data/secg/sect239k1.csv b/common/src/main/resources/cz/crcs/ectester/data/secg/sect239k1.csv
index 8b2e58a..8b2e58a 100644
--- a/src/cz/crcs/ectester/data/secg/sect239k1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/secg/sect239k1.csv
diff --git a/src/cz/crcs/ectester/data/secg/sect283k1.csv b/common/src/main/resources/cz/crcs/ectester/data/secg/sect283k1.csv
index 9a3a8f6..9a3a8f6 100644
--- a/src/cz/crcs/ectester/data/secg/sect283k1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/secg/sect283k1.csv
diff --git a/src/cz/crcs/ectester/data/secg/sect283r1.csv b/common/src/main/resources/cz/crcs/ectester/data/secg/sect283r1.csv
index 68c17f6..68c17f6 100644
--- a/src/cz/crcs/ectester/data/secg/sect283r1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/secg/sect283r1.csv
diff --git a/src/cz/crcs/ectester/data/secg/sect409k1.csv b/common/src/main/resources/cz/crcs/ectester/data/secg/sect409k1.csv
index e39e076..e39e076 100644
--- a/src/cz/crcs/ectester/data/secg/sect409k1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/secg/sect409k1.csv
diff --git a/src/cz/crcs/ectester/data/secg/sect409r1.csv b/common/src/main/resources/cz/crcs/ectester/data/secg/sect409r1.csv
index 727fb25..727fb25 100644
--- a/src/cz/crcs/ectester/data/secg/sect409r1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/secg/sect409r1.csv
diff --git a/src/cz/crcs/ectester/data/secg/sect571k1.csv b/common/src/main/resources/cz/crcs/ectester/data/secg/sect571k1.csv
index 0c94778..0c94778 100644
--- a/src/cz/crcs/ectester/data/secg/sect571k1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/secg/sect571k1.csv
diff --git a/src/cz/crcs/ectester/data/secg/sect571r1.csv b/common/src/main/resources/cz/crcs/ectester/data/secg/sect571r1.csv
index 739cbb0..739cbb0 100644
--- a/src/cz/crcs/ectester/data/secg/sect571r1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/secg/sect571r1.csv
diff --git a/src/cz/crcs/ectester/data/supersingular/curves.xml b/common/src/main/resources/cz/crcs/ectester/data/supersingular/curves.xml
index 186a8a7..186a8a7 100644
--- a/src/cz/crcs/ectester/data/supersingular/curves.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/supersingular/curves.xml
diff --git a/src/cz/crcs/ectester/data/supersingular/ss128.csv b/common/src/main/resources/cz/crcs/ectester/data/supersingular/ss128.csv
index 9dd4f13..9dd4f13 100644
--- a/src/cz/crcs/ectester/data/supersingular/ss128.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/supersingular/ss128.csv
diff --git a/src/cz/crcs/ectester/data/supersingular/ss192.csv b/common/src/main/resources/cz/crcs/ectester/data/supersingular/ss192.csv
index 0c8ae8b..0c8ae8b 100644
--- a/src/cz/crcs/ectester/data/supersingular/ss192.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/supersingular/ss192.csv
diff --git a/src/cz/crcs/ectester/data/supersingular/ss224.csv b/common/src/main/resources/cz/crcs/ectester/data/supersingular/ss224.csv
index 01eaa35..01eaa35 100644
--- a/src/cz/crcs/ectester/data/supersingular/ss224.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/supersingular/ss224.csv
diff --git a/src/cz/crcs/ectester/data/supersingular/ss256.csv b/common/src/main/resources/cz/crcs/ectester/data/supersingular/ss256.csv
index 47a8174..47a8174 100644
--- a/src/cz/crcs/ectester/data/supersingular/ss256.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/supersingular/ss256.csv
diff --git a/src/cz/crcs/ectester/data/test/brainpool/brainpoolP224r1-dh-raw.csv b/common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP224r1-dh-raw.csv
index 36c396a..36c396a 100644
--- a/src/cz/crcs/ectester/data/test/brainpool/brainpoolP224r1-dh-raw.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP224r1-dh-raw.csv
diff --git a/src/cz/crcs/ectester/data/test/brainpool/brainpoolP224r1-dh-sha1.csv b/common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP224r1-dh-sha1.csv
index f9abc47..f9abc47 100644
--- a/src/cz/crcs/ectester/data/test/brainpool/brainpoolP224r1-dh-sha1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP224r1-dh-sha1.csv
diff --git a/src/cz/crcs/ectester/data/test/brainpool/brainpoolP224r1-keyA.csv b/common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP224r1-keyA.csv
index a2f0525..a2f0525 100644
--- a/src/cz/crcs/ectester/data/test/brainpool/brainpoolP224r1-keyA.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP224r1-keyA.csv
diff --git a/src/cz/crcs/ectester/data/test/brainpool/brainpoolP224r1-keyB.csv b/common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP224r1-keyB.csv
index b397506..b397506 100644
--- a/src/cz/crcs/ectester/data/test/brainpool/brainpoolP224r1-keyB.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP224r1-keyB.csv
diff --git a/src/cz/crcs/ectester/data/test/brainpool/brainpoolP256r1-dh-raw.csv b/common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP256r1-dh-raw.csv
index 1d7ab37..1d7ab37 100644
--- a/src/cz/crcs/ectester/data/test/brainpool/brainpoolP256r1-dh-raw.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP256r1-dh-raw.csv
diff --git a/src/cz/crcs/ectester/data/test/brainpool/brainpoolP256r1-dh-sha1.csv b/common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP256r1-dh-sha1.csv
index 45a851b..45a851b 100644
--- a/src/cz/crcs/ectester/data/test/brainpool/brainpoolP256r1-dh-sha1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP256r1-dh-sha1.csv
diff --git a/src/cz/crcs/ectester/data/test/brainpool/brainpoolP256r1-keyA.csv b/common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP256r1-keyA.csv
index 597d3fe..597d3fe 100644
--- a/src/cz/crcs/ectester/data/test/brainpool/brainpoolP256r1-keyA.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP256r1-keyA.csv
diff --git a/src/cz/crcs/ectester/data/test/brainpool/brainpoolP256r1-keyB.csv b/common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP256r1-keyB.csv
index 110f6b5..110f6b5 100644
--- a/src/cz/crcs/ectester/data/test/brainpool/brainpoolP256r1-keyB.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP256r1-keyB.csv
diff --git a/src/cz/crcs/ectester/data/test/brainpool/brainpoolP384r1-dh-raw.csv b/common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP384r1-dh-raw.csv
index 392d962..392d962 100644
--- a/src/cz/crcs/ectester/data/test/brainpool/brainpoolP384r1-dh-raw.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP384r1-dh-raw.csv
diff --git a/src/cz/crcs/ectester/data/test/brainpool/brainpoolP384r1-dh-sha1.csv b/common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP384r1-dh-sha1.csv
index b293a59..b293a59 100644
--- a/src/cz/crcs/ectester/data/test/brainpool/brainpoolP384r1-dh-sha1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP384r1-dh-sha1.csv
diff --git a/src/cz/crcs/ectester/data/test/brainpool/brainpoolP384r1-keyA.csv b/common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP384r1-keyA.csv
index 6746753..6746753 100644
--- a/src/cz/crcs/ectester/data/test/brainpool/brainpoolP384r1-keyA.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP384r1-keyA.csv
diff --git a/src/cz/crcs/ectester/data/test/brainpool/brainpoolP384r1-keyB.csv b/common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP384r1-keyB.csv
index 83289fd..83289fd 100644
--- a/src/cz/crcs/ectester/data/test/brainpool/brainpoolP384r1-keyB.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP384r1-keyB.csv
diff --git a/src/cz/crcs/ectester/data/test/brainpool/brainpoolP512r1-dh-raw.csv b/common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP512r1-dh-raw.csv
index fe6c294..fe6c294 100644
--- a/src/cz/crcs/ectester/data/test/brainpool/brainpoolP512r1-dh-raw.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP512r1-dh-raw.csv
diff --git a/src/cz/crcs/ectester/data/test/brainpool/brainpoolP512r1-dh-sha1.csv b/common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP512r1-dh-sha1.csv
index ff8d321..ff8d321 100644
--- a/src/cz/crcs/ectester/data/test/brainpool/brainpoolP512r1-dh-sha1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP512r1-dh-sha1.csv
diff --git a/src/cz/crcs/ectester/data/test/brainpool/brainpoolP512r1-keyA.csv b/common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP512r1-keyA.csv
index 3648a36..3648a36 100644
--- a/src/cz/crcs/ectester/data/test/brainpool/brainpoolP512r1-keyA.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP512r1-keyA.csv
diff --git a/src/cz/crcs/ectester/data/test/brainpool/brainpoolP512r1-keyB.csv b/common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP512r1-keyB.csv
index 9684984..9684984 100644
--- a/src/cz/crcs/ectester/data/test/brainpool/brainpoolP512r1-keyB.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/brainpool/brainpoolP512r1-keyB.csv
diff --git a/src/cz/crcs/ectester/data/test/keys.xml b/common/src/main/resources/cz/crcs/ectester/data/test/keys.xml
index 380aef1..380aef1 100644
--- a/src/cz/crcs/ectester/data/test/keys.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/keys.xml
diff --git a/src/cz/crcs/ectester/data/test/nist/b163-dhc-raw.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b163-dhc-raw.csv
index 25233c1..25233c1 100644
--- a/src/cz/crcs/ectester/data/test/nist/b163-dhc-raw.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b163-dhc-raw.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/b163-dhc-sha1.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b163-dhc-sha1.csv
index 0ad84c1..0ad84c1 100644
--- a/src/cz/crcs/ectester/data/test/nist/b163-dhc-sha1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b163-dhc-sha1.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/b163-keyCAVS.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b163-keyCAVS.csv
index 4d85a19..4d85a19 100644
--- a/src/cz/crcs/ectester/data/test/nist/b163-keyCAVS.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b163-keyCAVS.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/b163-keyIUT.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b163-keyIUT.csv
index e56e6c4..e56e6c4 100644
--- a/src/cz/crcs/ectester/data/test/nist/b163-keyIUT.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b163-keyIUT.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/b233-dhc-raw.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b233-dhc-raw.csv
index 5e703be..5e703be 100644
--- a/src/cz/crcs/ectester/data/test/nist/b233-dhc-raw.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b233-dhc-raw.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/b233-dhc-sha1.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b233-dhc-sha1.csv
index 8c6886f..8c6886f 100644
--- a/src/cz/crcs/ectester/data/test/nist/b233-dhc-sha1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b233-dhc-sha1.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/b233-keyCAVS.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b233-keyCAVS.csv
index 591bfe1..591bfe1 100644
--- a/src/cz/crcs/ectester/data/test/nist/b233-keyCAVS.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b233-keyCAVS.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/b233-keyIUT.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b233-keyIUT.csv
index eb7b5e6..eb7b5e6 100644
--- a/src/cz/crcs/ectester/data/test/nist/b233-keyIUT.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b233-keyIUT.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/b283-dhc-raw.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b283-dhc-raw.csv
index 6bc719a..6bc719a 100644
--- a/src/cz/crcs/ectester/data/test/nist/b283-dhc-raw.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b283-dhc-raw.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/b283-dhc-sha1.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b283-dhc-sha1.csv
index 6980f80..6980f80 100644
--- a/src/cz/crcs/ectester/data/test/nist/b283-dhc-sha1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b283-dhc-sha1.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/b283-keyCAVS.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b283-keyCAVS.csv
index 52b33fc..52b33fc 100644
--- a/src/cz/crcs/ectester/data/test/nist/b283-keyCAVS.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b283-keyCAVS.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/b283-keyIUT.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b283-keyIUT.csv
index 8d2d534..8d2d534 100644
--- a/src/cz/crcs/ectester/data/test/nist/b283-keyIUT.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b283-keyIUT.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/b409-dhc-raw.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b409-dhc-raw.csv
index f84d029..f84d029 100644
--- a/src/cz/crcs/ectester/data/test/nist/b409-dhc-raw.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b409-dhc-raw.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/b409-dhc-sha1.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b409-dhc-sha1.csv
index f6db38b..f6db38b 100644
--- a/src/cz/crcs/ectester/data/test/nist/b409-dhc-sha1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b409-dhc-sha1.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/b409-keyCAVS.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b409-keyCAVS.csv
index cecb5f3..cecb5f3 100644
--- a/src/cz/crcs/ectester/data/test/nist/b409-keyCAVS.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b409-keyCAVS.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/b409-keyIUT.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b409-keyIUT.csv
index 066d220..066d220 100644
--- a/src/cz/crcs/ectester/data/test/nist/b409-keyIUT.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b409-keyIUT.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/b571-dhc-raw.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b571-dhc-raw.csv
index ffef41d..ffef41d 100644
--- a/src/cz/crcs/ectester/data/test/nist/b571-dhc-raw.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b571-dhc-raw.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/b571-dhc-sha1.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b571-dhc-sha1.csv
index d75a7ff..d75a7ff 100644
--- a/src/cz/crcs/ectester/data/test/nist/b571-dhc-sha1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b571-dhc-sha1.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/b571-keyCAVS.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b571-keyCAVS.csv
index 20b1816..20b1816 100644
--- a/src/cz/crcs/ectester/data/test/nist/b571-keyCAVS.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b571-keyCAVS.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/b571-keyIUT.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b571-keyIUT.csv
index 8e3973d..8e3973d 100644
--- a/src/cz/crcs/ectester/data/test/nist/b571-keyIUT.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/b571-keyIUT.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/k163-dhc-raw.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k163-dhc-raw.csv
index 5001502..5001502 100644
--- a/src/cz/crcs/ectester/data/test/nist/k163-dhc-raw.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k163-dhc-raw.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/k163-dhc-sha1.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k163-dhc-sha1.csv
index e03aa60..e03aa60 100644
--- a/src/cz/crcs/ectester/data/test/nist/k163-dhc-sha1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k163-dhc-sha1.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/k163-keyCAVS.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k163-keyCAVS.csv
index 6f03652..6f03652 100644
--- a/src/cz/crcs/ectester/data/test/nist/k163-keyCAVS.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k163-keyCAVS.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/k163-keyIUT.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k163-keyIUT.csv
index b34189e..b34189e 100644
--- a/src/cz/crcs/ectester/data/test/nist/k163-keyIUT.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k163-keyIUT.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/k233-dhc-raw.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k233-dhc-raw.csv
index 03193ae..03193ae 100644
--- a/src/cz/crcs/ectester/data/test/nist/k233-dhc-raw.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k233-dhc-raw.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/k233-dhc-sha1.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k233-dhc-sha1.csv
index c6c68ac..c6c68ac 100644
--- a/src/cz/crcs/ectester/data/test/nist/k233-dhc-sha1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k233-dhc-sha1.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/k233-keyCAVS.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k233-keyCAVS.csv
index 7c60338..7c60338 100644
--- a/src/cz/crcs/ectester/data/test/nist/k233-keyCAVS.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k233-keyCAVS.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/k233-keyIUT.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k233-keyIUT.csv
index d8cc078..d8cc078 100644
--- a/src/cz/crcs/ectester/data/test/nist/k233-keyIUT.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k233-keyIUT.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/k283-dhc-raw.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k283-dhc-raw.csv
index 0e14373..0e14373 100644
--- a/src/cz/crcs/ectester/data/test/nist/k283-dhc-raw.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k283-dhc-raw.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/k283-dhc-sha1.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k283-dhc-sha1.csv
index 6852d2f..6852d2f 100644
--- a/src/cz/crcs/ectester/data/test/nist/k283-dhc-sha1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k283-dhc-sha1.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/k283-keyCAVS.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k283-keyCAVS.csv
index f91e05a..f91e05a 100644
--- a/src/cz/crcs/ectester/data/test/nist/k283-keyCAVS.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k283-keyCAVS.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/k283-keyIUT.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k283-keyIUT.csv
index 2b19347..2b19347 100644
--- a/src/cz/crcs/ectester/data/test/nist/k283-keyIUT.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k283-keyIUT.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/k409-dhc-raw.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k409-dhc-raw.csv
index f02c0dd..f02c0dd 100644
--- a/src/cz/crcs/ectester/data/test/nist/k409-dhc-raw.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k409-dhc-raw.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/k409-dhc-sha1.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k409-dhc-sha1.csv
index f4f5cdc..f4f5cdc 100644
--- a/src/cz/crcs/ectester/data/test/nist/k409-dhc-sha1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k409-dhc-sha1.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/k409-keyCAVS.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k409-keyCAVS.csv
index cc40c76..cc40c76 100644
--- a/src/cz/crcs/ectester/data/test/nist/k409-keyCAVS.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k409-keyCAVS.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/k409-keyIUT.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k409-keyIUT.csv
index e8d0c97..e8d0c97 100644
--- a/src/cz/crcs/ectester/data/test/nist/k409-keyIUT.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k409-keyIUT.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/k571-dhc-raw.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k571-dhc-raw.csv
index eca4a7b..eca4a7b 100644
--- a/src/cz/crcs/ectester/data/test/nist/k571-dhc-raw.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k571-dhc-raw.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/k571-dhc-sha1.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k571-dhc-sha1.csv
index 938ba18..938ba18 100644
--- a/src/cz/crcs/ectester/data/test/nist/k571-dhc-sha1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k571-dhc-sha1.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/k571-keyCAVS.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k571-keyCAVS.csv
index 71d1e64..71d1e64 100644
--- a/src/cz/crcs/ectester/data/test/nist/k571-keyCAVS.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k571-keyCAVS.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/k571-keyIUT.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k571-keyIUT.csv
index 6222122..6222122 100644
--- a/src/cz/crcs/ectester/data/test/nist/k571-keyIUT.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/k571-keyIUT.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/p192-dhc-raw.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p192-dhc-raw.csv
index 4f139f7..4f139f7 100644
--- a/src/cz/crcs/ectester/data/test/nist/p192-dhc-raw.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p192-dhc-raw.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/p192-dhc-sha1.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p192-dhc-sha1.csv
index f3e01bf..f3e01bf 100644
--- a/src/cz/crcs/ectester/data/test/nist/p192-dhc-sha1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p192-dhc-sha1.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/p192-keyCAVS.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p192-keyCAVS.csv
index d8a3fab..d8a3fab 100644
--- a/src/cz/crcs/ectester/data/test/nist/p192-keyCAVS.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p192-keyCAVS.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/p192-keyIUT.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p192-keyIUT.csv
index fb58f03..fb58f03 100644
--- a/src/cz/crcs/ectester/data/test/nist/p192-keyIUT.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p192-keyIUT.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/p224-dhc-raw.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p224-dhc-raw.csv
index 5a3bb67..5a3bb67 100644
--- a/src/cz/crcs/ectester/data/test/nist/p224-dhc-raw.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p224-dhc-raw.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/p224-dhc-sha1.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p224-dhc-sha1.csv
index 8e0e8ec..8e0e8ec 100644
--- a/src/cz/crcs/ectester/data/test/nist/p224-dhc-sha1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p224-dhc-sha1.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/p224-keyCAVS.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p224-keyCAVS.csv
index 183d654..183d654 100644
--- a/src/cz/crcs/ectester/data/test/nist/p224-keyCAVS.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p224-keyCAVS.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/p224-keyIUT.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p224-keyIUT.csv
index 24b992b..24b992b 100644
--- a/src/cz/crcs/ectester/data/test/nist/p224-keyIUT.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p224-keyIUT.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/p256-dhc-raw.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p256-dhc-raw.csv
index cd8291f..cd8291f 100644
--- a/src/cz/crcs/ectester/data/test/nist/p256-dhc-raw.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p256-dhc-raw.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/p256-dhc-sha1.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p256-dhc-sha1.csv
index 021f92b..021f92b 100644
--- a/src/cz/crcs/ectester/data/test/nist/p256-dhc-sha1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p256-dhc-sha1.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/p256-keyCAVS.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p256-keyCAVS.csv
index e7b0176..e7b0176 100644
--- a/src/cz/crcs/ectester/data/test/nist/p256-keyCAVS.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p256-keyCAVS.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/p256-keyIUT.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p256-keyIUT.csv
index 0df2f99..0df2f99 100644
--- a/src/cz/crcs/ectester/data/test/nist/p256-keyIUT.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p256-keyIUT.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/p384-dhc-raw.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p384-dhc-raw.csv
index 725e299..725e299 100644
--- a/src/cz/crcs/ectester/data/test/nist/p384-dhc-raw.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p384-dhc-raw.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/p384-dhc-sha1.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p384-dhc-sha1.csv
index 765e6de..765e6de 100644
--- a/src/cz/crcs/ectester/data/test/nist/p384-dhc-sha1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p384-dhc-sha1.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/p384-keyCAVS.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p384-keyCAVS.csv
index 64c6328..64c6328 100644
--- a/src/cz/crcs/ectester/data/test/nist/p384-keyCAVS.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p384-keyCAVS.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/p384-keyIUT.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p384-keyIUT.csv
index 65cf43d..65cf43d 100644
--- a/src/cz/crcs/ectester/data/test/nist/p384-keyIUT.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p384-keyIUT.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/p521-dhc-raw.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p521-dhc-raw.csv
index 6467649..6467649 100644
--- a/src/cz/crcs/ectester/data/test/nist/p521-dhc-raw.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p521-dhc-raw.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/p521-dhc-sha1.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p521-dhc-sha1.csv
index 2f4f557..2f4f557 100644
--- a/src/cz/crcs/ectester/data/test/nist/p521-dhc-sha1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p521-dhc-sha1.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/p521-keyCAVS.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p521-keyCAVS.csv
index c00148e..c00148e 100644
--- a/src/cz/crcs/ectester/data/test/nist/p521-keyCAVS.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p521-keyCAVS.csv
diff --git a/src/cz/crcs/ectester/data/test/nist/p521-keyIUT.csv b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p521-keyIUT.csv
index b36b3b6..b36b3b6 100644
--- a/src/cz/crcs/ectester/data/test/nist/p521-keyIUT.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/nist/p521-keyIUT.csv
diff --git a/src/cz/crcs/ectester/data/test/results.xml b/common/src/main/resources/cz/crcs/ectester/data/test/results.xml
index fa43e4b..fa43e4b 100644
--- a/src/cz/crcs/ectester/data/test/results.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/results.xml
diff --git a/src/cz/crcs/ectester/data/test/secg/secp160r1-dh-kdf.csv b/common/src/main/resources/cz/crcs/ectester/data/test/secg/secp160r1-dh-kdf.csv
index eb56e26..eb56e26 100644
--- a/src/cz/crcs/ectester/data/test/secg/secp160r1-dh-kdf.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/secg/secp160r1-dh-kdf.csv
diff --git a/src/cz/crcs/ectester/data/test/secg/secp160r1-dh-raw.csv b/common/src/main/resources/cz/crcs/ectester/data/test/secg/secp160r1-dh-raw.csv
index c246c32..c246c32 100644
--- a/src/cz/crcs/ectester/data/test/secg/secp160r1-dh-raw.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/secg/secp160r1-dh-raw.csv
diff --git a/src/cz/crcs/ectester/data/test/secg/secp160r1-dh-sha1.csv b/common/src/main/resources/cz/crcs/ectester/data/test/secg/secp160r1-dh-sha1.csv
index d83d932..d83d932 100644
--- a/src/cz/crcs/ectester/data/test/secg/secp160r1-dh-sha1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/secg/secp160r1-dh-sha1.csv
diff --git a/src/cz/crcs/ectester/data/test/secg/secp160r1-keyU.csv b/common/src/main/resources/cz/crcs/ectester/data/test/secg/secp160r1-keyU.csv
index dcbe885..dcbe885 100644
--- a/src/cz/crcs/ectester/data/test/secg/secp160r1-keyU.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/secg/secp160r1-keyU.csv
diff --git a/src/cz/crcs/ectester/data/test/secg/secp160r1-keyV.csv b/common/src/main/resources/cz/crcs/ectester/data/test/secg/secp160r1-keyV.csv
index 59aacda..59aacda 100644
--- a/src/cz/crcs/ectester/data/test/secg/secp160r1-keyV.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/secg/secp160r1-keyV.csv
diff --git a/src/cz/crcs/ectester/data/test/secg/sect163k1-dh-kdf.csv b/common/src/main/resources/cz/crcs/ectester/data/test/secg/sect163k1-dh-kdf.csv
index 06a416f..06a416f 100644
--- a/src/cz/crcs/ectester/data/test/secg/sect163k1-dh-kdf.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/secg/sect163k1-dh-kdf.csv
diff --git a/src/cz/crcs/ectester/data/test/secg/sect163k1-dh-raw.csv b/common/src/main/resources/cz/crcs/ectester/data/test/secg/sect163k1-dh-raw.csv
index 94eacd8..94eacd8 100644
--- a/src/cz/crcs/ectester/data/test/secg/sect163k1-dh-raw.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/secg/sect163k1-dh-raw.csv
diff --git a/src/cz/crcs/ectester/data/test/secg/sect163k1-dh-sha1.csv b/common/src/main/resources/cz/crcs/ectester/data/test/secg/sect163k1-dh-sha1.csv
index 651b80c..651b80c 100644
--- a/src/cz/crcs/ectester/data/test/secg/sect163k1-dh-sha1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/secg/sect163k1-dh-sha1.csv
diff --git a/src/cz/crcs/ectester/data/test/secg/sect163k1-dhc-kdf.csv b/common/src/main/resources/cz/crcs/ectester/data/test/secg/sect163k1-dhc-kdf.csv
index c234f31..c234f31 100644
--- a/src/cz/crcs/ectester/data/test/secg/sect163k1-dhc-kdf.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/secg/sect163k1-dhc-kdf.csv
diff --git a/src/cz/crcs/ectester/data/test/secg/sect163k1-dhc-raw.csv b/common/src/main/resources/cz/crcs/ectester/data/test/secg/sect163k1-dhc-raw.csv
index 46a0a0f..46a0a0f 100644
--- a/src/cz/crcs/ectester/data/test/secg/sect163k1-dhc-raw.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/secg/sect163k1-dhc-raw.csv
diff --git a/src/cz/crcs/ectester/data/test/secg/sect163k1-dhc-sha1.csv b/common/src/main/resources/cz/crcs/ectester/data/test/secg/sect163k1-dhc-sha1.csv
index 4839c25..4839c25 100644
--- a/src/cz/crcs/ectester/data/test/secg/sect163k1-dhc-sha1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/secg/sect163k1-dhc-sha1.csv
diff --git a/src/cz/crcs/ectester/data/test/secg/sect163k1-keyU.csv b/common/src/main/resources/cz/crcs/ectester/data/test/secg/sect163k1-keyU.csv
index b516f3b..b516f3b 100644
--- a/src/cz/crcs/ectester/data/test/secg/sect163k1-keyU.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/secg/sect163k1-keyU.csv
diff --git a/src/cz/crcs/ectester/data/test/secg/sect163k1-keyV.csv b/common/src/main/resources/cz/crcs/ectester/data/test/secg/sect163k1-keyV.csv
index 00ab019..00ab019 100644
--- a/src/cz/crcs/ectester/data/test/secg/sect163k1-keyV.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/test/secg/sect163k1-keyV.csv
diff --git a/src/cz/crcs/ectester/data/twist/cofactor/cofactor128p4.xml b/common/src/main/resources/cz/crcs/ectester/data/twist/cofactor/cofactor128p4.xml
index b558f8e..b558f8e 100644
--- a/src/cz/crcs/ectester/data/twist/cofactor/cofactor128p4.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/twist/cofactor/cofactor128p4.xml
diff --git a/src/cz/crcs/ectester/data/twist/cofactor/cofactor160p4.xml b/common/src/main/resources/cz/crcs/ectester/data/twist/cofactor/cofactor160p4.xml
index bb712af..bb712af 100644
--- a/src/cz/crcs/ectester/data/twist/cofactor/cofactor160p4.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/twist/cofactor/cofactor160p4.xml
diff --git a/src/cz/crcs/ectester/data/twist/keys.xml b/common/src/main/resources/cz/crcs/ectester/data/twist/keys.xml
index 3292004..3292004 100644
--- a/src/cz/crcs/ectester/data/twist/keys.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/twist/keys.xml
diff --git a/src/cz/crcs/ectester/data/twist/nist/b163.xml b/common/src/main/resources/cz/crcs/ectester/data/twist/nist/b163.xml
index 03690ac..03690ac 100644
--- a/src/cz/crcs/ectester/data/twist/nist/b163.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/twist/nist/b163.xml
diff --git a/src/cz/crcs/ectester/data/twist/nist/b233.xml b/common/src/main/resources/cz/crcs/ectester/data/twist/nist/b233.xml
index 7a0b579..7a0b579 100644
--- a/src/cz/crcs/ectester/data/twist/nist/b233.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/twist/nist/b233.xml
diff --git a/src/cz/crcs/ectester/data/twist/nist/b283.xml b/common/src/main/resources/cz/crcs/ectester/data/twist/nist/b283.xml
index 7f57585..7f57585 100644
--- a/src/cz/crcs/ectester/data/twist/nist/b283.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/twist/nist/b283.xml
diff --git a/src/cz/crcs/ectester/data/twist/nist/k163.xml b/common/src/main/resources/cz/crcs/ectester/data/twist/nist/k163.xml
index 31040c0..31040c0 100644
--- a/src/cz/crcs/ectester/data/twist/nist/k163.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/twist/nist/k163.xml
diff --git a/src/cz/crcs/ectester/data/twist/nist/k233.xml b/common/src/main/resources/cz/crcs/ectester/data/twist/nist/k233.xml
index 6354ff9..6354ff9 100644
--- a/src/cz/crcs/ectester/data/twist/nist/k233.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/twist/nist/k233.xml
diff --git a/src/cz/crcs/ectester/data/twist/nist/k283.xml b/common/src/main/resources/cz/crcs/ectester/data/twist/nist/k283.xml
index 48a2dd9..48a2dd9 100644
--- a/src/cz/crcs/ectester/data/twist/nist/k283.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/twist/nist/k283.xml
diff --git a/src/cz/crcs/ectester/data/twist/nist/p192.xml b/common/src/main/resources/cz/crcs/ectester/data/twist/nist/p192.xml
index d1fdf49..d1fdf49 100644
--- a/src/cz/crcs/ectester/data/twist/nist/p192.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/twist/nist/p192.xml
diff --git a/src/cz/crcs/ectester/data/twist/nist/p224.xml b/common/src/main/resources/cz/crcs/ectester/data/twist/nist/p224.xml
index 3ae34ff..3ae34ff 100644
--- a/src/cz/crcs/ectester/data/twist/nist/p224.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/twist/nist/p224.xml
diff --git a/src/cz/crcs/ectester/data/twist/nist/p256.xml b/common/src/main/resources/cz/crcs/ectester/data/twist/nist/p256.xml
index 2e1c55e..2e1c55e 100644
--- a/src/cz/crcs/ectester/data/twist/nist/p256.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/twist/nist/p256.xml
diff --git a/src/cz/crcs/ectester/data/twist/nist/p384.xml b/common/src/main/resources/cz/crcs/ectester/data/twist/nist/p384.xml
index 8e0d2b6..8e0d2b6 100644
--- a/src/cz/crcs/ectester/data/twist/nist/p384.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/twist/nist/p384.xml
diff --git a/src/cz/crcs/ectester/data/twist/nist/p521.xml b/common/src/main/resources/cz/crcs/ectester/data/twist/nist/p521.xml
index 1564c80..1564c80 100644
--- a/src/cz/crcs/ectester/data/twist/nist/p521.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/twist/nist/p521.xml
diff --git a/src/cz/crcs/ectester/data/twist/secg/secp112r1.xml b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp112r1.xml
index bea215a..bea215a 100644
--- a/src/cz/crcs/ectester/data/twist/secg/secp112r1.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp112r1.xml
diff --git a/src/cz/crcs/ectester/data/twist/secg/secp112r2.xml b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp112r2.xml
index f1d0fee..f1d0fee 100644
--- a/src/cz/crcs/ectester/data/twist/secg/secp112r2.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp112r2.xml
diff --git a/src/cz/crcs/ectester/data/twist/secg/secp128r1.xml b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp128r1.xml
index e9bf07b..e9bf07b 100644
--- a/src/cz/crcs/ectester/data/twist/secg/secp128r1.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp128r1.xml
diff --git a/src/cz/crcs/ectester/data/twist/secg/secp128r2.xml b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp128r2.xml
index fdd9028..fdd9028 100644
--- a/src/cz/crcs/ectester/data/twist/secg/secp128r2.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp128r2.xml
diff --git a/src/cz/crcs/ectester/data/twist/secg/secp160k1.xml b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp160k1.xml
index 8d1cc53..8d1cc53 100644
--- a/src/cz/crcs/ectester/data/twist/secg/secp160k1.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp160k1.xml
diff --git a/src/cz/crcs/ectester/data/twist/secg/secp160r1.xml b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp160r1.xml
index dece980..dece980 100644
--- a/src/cz/crcs/ectester/data/twist/secg/secp160r1.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp160r1.xml
diff --git a/src/cz/crcs/ectester/data/twist/secg/secp160r2.xml b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp160r2.xml
index bdb8a03..bdb8a03 100644
--- a/src/cz/crcs/ectester/data/twist/secg/secp160r2.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp160r2.xml
diff --git a/src/cz/crcs/ectester/data/twist/secg/secp192k1.xml b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp192k1.xml
index 457a414..457a414 100644
--- a/src/cz/crcs/ectester/data/twist/secg/secp192k1.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp192k1.xml
diff --git a/src/cz/crcs/ectester/data/twist/secg/secp192r1.xml b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp192r1.xml
index 16ba7db..16ba7db 100644
--- a/src/cz/crcs/ectester/data/twist/secg/secp192r1.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp192r1.xml
diff --git a/src/cz/crcs/ectester/data/twist/secg/secp224r1.xml b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp224r1.xml
index ee6782e..ee6782e 100644
--- a/src/cz/crcs/ectester/data/twist/secg/secp224r1.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp224r1.xml
diff --git a/src/cz/crcs/ectester/data/twist/secg/secp256k1.xml b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp256k1.xml
index 467641e..467641e 100644
--- a/src/cz/crcs/ectester/data/twist/secg/secp256k1.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp256k1.xml
diff --git a/src/cz/crcs/ectester/data/twist/secg/secp256r1.xml b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp256r1.xml
index b385548..b385548 100644
--- a/src/cz/crcs/ectester/data/twist/secg/secp256r1.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp256r1.xml
diff --git a/src/cz/crcs/ectester/data/twist/secg/secp384r1.xml b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp384r1.xml
index 2ddbe9b..2ddbe9b 100644
--- a/src/cz/crcs/ectester/data/twist/secg/secp384r1.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp384r1.xml
diff --git a/src/cz/crcs/ectester/data/twist/secg/secp521r1.xml b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp521r1.xml
index 105efa3..105efa3 100644
--- a/src/cz/crcs/ectester/data/twist/secg/secp521r1.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/secp521r1.xml
diff --git a/src/cz/crcs/ectester/data/twist/secg/sect163k1.xml b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/sect163k1.xml
index 754e8e6..754e8e6 100644
--- a/src/cz/crcs/ectester/data/twist/secg/sect163k1.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/sect163k1.xml
diff --git a/src/cz/crcs/ectester/data/twist/secg/sect163r1.xml b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/sect163r1.xml
index dd7d798..dd7d798 100644
--- a/src/cz/crcs/ectester/data/twist/secg/sect163r1.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/sect163r1.xml
diff --git a/src/cz/crcs/ectester/data/twist/secg/sect163r2.xml b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/sect163r2.xml
index 421887d..421887d 100644
--- a/src/cz/crcs/ectester/data/twist/secg/sect163r2.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/sect163r2.xml
diff --git a/src/cz/crcs/ectester/data/twist/secg/sect233k1.xml b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/sect233k1.xml
index cf8524c..cf8524c 100644
--- a/src/cz/crcs/ectester/data/twist/secg/sect233k1.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/sect233k1.xml
diff --git a/src/cz/crcs/ectester/data/twist/secg/sect233r1.xml b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/sect233r1.xml
index 45eecf4..45eecf4 100644
--- a/src/cz/crcs/ectester/data/twist/secg/sect233r1.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/sect233r1.xml
diff --git a/src/cz/crcs/ectester/data/twist/secg/sect239k1.xml b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/sect239k1.xml
index bc17d4f..bc17d4f 100644
--- a/src/cz/crcs/ectester/data/twist/secg/sect239k1.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/sect239k1.xml
diff --git a/src/cz/crcs/ectester/data/twist/secg/sect283k1.xml b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/sect283k1.xml
index 65ecb63..65ecb63 100644
--- a/src/cz/crcs/ectester/data/twist/secg/sect283k1.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/sect283k1.xml
diff --git a/src/cz/crcs/ectester/data/twist/secg/sect283r1.xml b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/sect283r1.xml
index e2913a0..e2913a0 100644
--- a/src/cz/crcs/ectester/data/twist/secg/sect283r1.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/twist/secg/sect283r1.xml
diff --git a/src/cz/crcs/ectester/data/wrong/curves.xml b/common/src/main/resources/cz/crcs/ectester/data/wrong/curves.xml
index 2a51474..2a51474 100644
--- a/src/cz/crcs/ectester/data/wrong/curves.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/wrong/curves.xml
diff --git a/src/cz/crcs/ectester/data/wrong/keys.xml b/common/src/main/resources/cz/crcs/ectester/data/wrong/keys.xml
index 4be8b4d..4be8b4d 100644
--- a/src/cz/crcs/ectester/data/wrong/keys.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/wrong/keys.xml
diff --git a/src/cz/crcs/ectester/data/wrong/results.xml b/common/src/main/resources/cz/crcs/ectester/data/wrong/results.xml
index e3f0967..e3f0967 100644
--- a/src/cz/crcs/ectester/data/wrong/results.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/wrong/results.xml
diff --git a/src/cz/crcs/ectester/data/wrong/wrongp128.csv b/common/src/main/resources/cz/crcs/ectester/data/wrong/wrongp128.csv
index d24da0e..d24da0e 100644
--- a/src/cz/crcs/ectester/data/wrong/wrongp128.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/wrong/wrongp128.csv
diff --git a/src/cz/crcs/ectester/data/wrong/wrongp160.csv b/common/src/main/resources/cz/crcs/ectester/data/wrong/wrongp160.csv
index 20dea88..20dea88 100644
--- a/src/cz/crcs/ectester/data/wrong/wrongp160.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/wrong/wrongp160.csv
diff --git a/src/cz/crcs/ectester/data/wrong/wrongp192.csv b/common/src/main/resources/cz/crcs/ectester/data/wrong/wrongp192.csv
index 7d2241c..7d2241c 100644
--- a/src/cz/crcs/ectester/data/wrong/wrongp192.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/wrong/wrongp192.csv
diff --git a/src/cz/crcs/ectester/data/wrong/wrongp224.csv b/common/src/main/resources/cz/crcs/ectester/data/wrong/wrongp224.csv
index aeaaae4..aeaaae4 100644
--- a/src/cz/crcs/ectester/data/wrong/wrongp224.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/wrong/wrongp224.csv
diff --git a/src/cz/crcs/ectester/data/wrong/wrongp256.csv b/common/src/main/resources/cz/crcs/ectester/data/wrong/wrongp256.csv
index 6902618..6902618 100644
--- a/src/cz/crcs/ectester/data/wrong/wrongp256.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/wrong/wrongp256.csv
diff --git a/src/cz/crcs/ectester/data/wrong/wrongp384.csv b/common/src/main/resources/cz/crcs/ectester/data/wrong/wrongp384.csv
index 694ae78..694ae78 100644
--- a/src/cz/crcs/ectester/data/wrong/wrongp384.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/wrong/wrongp384.csv
diff --git a/src/cz/crcs/ectester/data/wrong/wrongp521.csv b/common/src/main/resources/cz/crcs/ectester/data/wrong/wrongp521.csv
index 76fe2f2..76fe2f2 100644
--- a/src/cz/crcs/ectester/data/wrong/wrongp521.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/wrong/wrongp521.csv
diff --git a/src/cz/crcs/ectester/data/wrong/wrongt163.csv b/common/src/main/resources/cz/crcs/ectester/data/wrong/wrongt163.csv
index 88b142e..88b142e 100644
--- a/src/cz/crcs/ectester/data/wrong/wrongt163.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/wrong/wrongt163.csv
diff --git a/src/cz/crcs/ectester/data/wrong/wrongt233.csv b/common/src/main/resources/cz/crcs/ectester/data/wrong/wrongt233.csv
index 291cdfe..291cdfe 100644
--- a/src/cz/crcs/ectester/data/wrong/wrongt233.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/wrong/wrongt233.csv
diff --git a/src/cz/crcs/ectester/data/wrong/wrongt239.csv b/common/src/main/resources/cz/crcs/ectester/data/wrong/wrongt239.csv
index bef2e14..bef2e14 100644
--- a/src/cz/crcs/ectester/data/wrong/wrongt239.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/wrong/wrongt239.csv
diff --git a/src/cz/crcs/ectester/data/wrong/wrongt283.csv b/common/src/main/resources/cz/crcs/ectester/data/wrong/wrongt283.csv
index 736fe15..736fe15 100644
--- a/src/cz/crcs/ectester/data/wrong/wrongt283.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/wrong/wrongt283.csv
diff --git a/src/cz/crcs/ectester/data/wrong/wrongt409.csv b/common/src/main/resources/cz/crcs/ectester/data/wrong/wrongt409.csv
index fe7e040..fe7e040 100644
--- a/src/cz/crcs/ectester/data/wrong/wrongt409.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/wrong/wrongt409.csv
diff --git a/src/cz/crcs/ectester/data/wrong/wrongt571.csv b/common/src/main/resources/cz/crcs/ectester/data/wrong/wrongt571.csv
index 2fcd0df..2fcd0df 100644
--- a/src/cz/crcs/ectester/data/wrong/wrongt571.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/wrong/wrongt571.csv
diff --git a/src/cz/crcs/ectester/data/wycheproof/keys.xml b/common/src/main/resources/cz/crcs/ectester/data/wycheproof/keys.xml
index ee7280c..ee7280c 100644
--- a/src/cz/crcs/ectester/data/wycheproof/keys.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/wycheproof/keys.xml
diff --git a/src/cz/crcs/ectester/data/wycheproof/results.xml b/common/src/main/resources/cz/crcs/ectester/data/wycheproof/results.xml
index 094043c..094043c 100644
--- a/src/cz/crcs/ectester/data/wycheproof/results.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/wycheproof/results.xml
diff --git a/src/cz/crcs/ectester/data/x962/curves.xml b/common/src/main/resources/cz/crcs/ectester/data/x962/curves.xml
index eee64ad..eee64ad 100644
--- a/src/cz/crcs/ectester/data/x962/curves.xml
+++ b/common/src/main/resources/cz/crcs/ectester/data/x962/curves.xml
diff --git a/src/cz/crcs/ectester/data/x962/prime192v1.csv b/common/src/main/resources/cz/crcs/ectester/data/x962/prime192v1.csv
index 07f9154..07f9154 100644
--- a/src/cz/crcs/ectester/data/x962/prime192v1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/x962/prime192v1.csv
diff --git a/src/cz/crcs/ectester/data/x962/prime192v2.csv b/common/src/main/resources/cz/crcs/ectester/data/x962/prime192v2.csv
index ee6f1a2..ee6f1a2 100644
--- a/src/cz/crcs/ectester/data/x962/prime192v2.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/x962/prime192v2.csv
diff --git a/src/cz/crcs/ectester/data/x962/prime192v3.csv b/common/src/main/resources/cz/crcs/ectester/data/x962/prime192v3.csv
index f80fd5b..f80fd5b 100644
--- a/src/cz/crcs/ectester/data/x962/prime192v3.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/x962/prime192v3.csv
diff --git a/src/cz/crcs/ectester/data/x962/prime239v1.csv b/common/src/main/resources/cz/crcs/ectester/data/x962/prime239v1.csv
index c9d704b..c9d704b 100644
--- a/src/cz/crcs/ectester/data/x962/prime239v1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/x962/prime239v1.csv
diff --git a/src/cz/crcs/ectester/data/x962/prime239v2.csv b/common/src/main/resources/cz/crcs/ectester/data/x962/prime239v2.csv
index 100e60b..100e60b 100644
--- a/src/cz/crcs/ectester/data/x962/prime239v2.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/x962/prime239v2.csv
diff --git a/src/cz/crcs/ectester/data/x962/prime239v3.csv b/common/src/main/resources/cz/crcs/ectester/data/x962/prime239v3.csv
index ce8b38a..ce8b38a 100644
--- a/src/cz/crcs/ectester/data/x962/prime239v3.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/x962/prime239v3.csv
diff --git a/src/cz/crcs/ectester/data/x962/prime256v1.csv b/common/src/main/resources/cz/crcs/ectester/data/x962/prime256v1.csv
index c5a2440..c5a2440 100644
--- a/src/cz/crcs/ectester/data/x962/prime256v1.csv
+++ b/common/src/main/resources/cz/crcs/ectester/data/x962/prime256v1.csv
diff --git a/dist/README.TXT b/dist/README.TXT
deleted file mode 100644
index 64c76a6..0000000
--- a/dist/README.TXT
+++ /dev/null
@@ -1,16 +0,0 @@
-========================
-BUILD OUTPUT DESCRIPTION
-========================
-
-After building (with package target) this directory should contain the files:
-
-- ECTesterReader.jar
-- ECTesterReader-dist.jar
-- ECTesterStandalone.jar
-- ECTesterStandalone-dist.jar
-- ectester-reader.sh
-- ectester-reader.bat
-
-The *-dist.jar variants of JAR files are self-contained executable JAR files with
-all the dependencies inside them.
-
diff --git a/docs/DEVELOPING.md b/docs/DEVELOPING.md
index 863361b..a5eda6c 100644
--- a/docs/DEVELOPING.md
+++ b/docs/DEVELOPING.md
@@ -6,9 +6,10 @@ developing the ECTester tool itself.
## Developing ECTester standalone modules
- Create Java classes inheriting Native{ECPrivateKey,ECPublicKey,KeyPairGeneratorSpi,KeyAgreementSpi,SignatureSpi}.
- - Add those classes to `build-standalone.xml` header generation.
- - Generate `native.h` headers for new classes using `build-standalone.xml`.
- - Create module file (C/C++) in `cz/crcs/ectester/standalone/libs/jni`, and add it to the Makefile.
+ - Run `gradle :standalone:compileJava` to compile the classes and obtain a native header file. It will be in
+ `standalone/build/generated/sources/headers/java/main`. Ideally, copy the generated function declarations into
+ the `native.h` file found in the `standalone/src/java/resources/cz/crcs/ectester/standalone/libs/jni` directory.
+ - Create module file (C/C++) in `standalone/src/java/resources/cz/crcs/ectester/standalone/libs/jni`, and add it to the Makefile.
- Implement the required JNI functions, look at existing modules for what is expected, what the contract
of the function is, use the `native_timing_*` functions around points that should be measurable.
- Compile and run ECTester using your new module. \ No newline at end of file
diff --git a/ext/ant-javacard.jar b/ext/ant-javacard.jar
deleted file mode 100644
index a9c8656..0000000
--- a/ext/ant-javacard.jar
+++ /dev/null
Binary files differ
diff --git a/ext/libressl b/ext/libressl
-Subproject 5a590f8e0c1bb3b3bf7ba02ee7d3ac0c1e09a1a
+Subproject 577970ab842f7e352048d45fe930ddd21f4190f
diff --git a/ext/sdks b/ext/sdks
-Subproject 494164ea8470f49f44be19f49dab3af7c83e39e
+Subproject 6025a1d48060b2a72df2d862de310be434f4227
diff --git a/lib/wolfcrypt-jni.jar b/ext/wolfcrypt-jni.jar
index 890ae14..890ae14 100644
--- a/lib/wolfcrypt-jni.jar
+++ b/ext/wolfcrypt-jni.jar
Binary files differ
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..d64cd49
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..a80b22c
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,7 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
+networkTimeout=10000
+validateDistributionUrl=true
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/gradlew b/gradlew
new file mode 100755
index 0000000..1aa94a4
--- /dev/null
+++ b/gradlew
@@ -0,0 +1,249 @@
+#!/bin/sh
+
+#
+# Copyright © 2015-2021 the original authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##############################################################################
+#
+# Gradle start up script for POSIX generated by Gradle.
+#
+# Important for running:
+#
+# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
+# noncompliant, but you have some other compliant shell such as ksh or
+# bash, then to run this script, type that shell name before the whole
+# command line, like:
+#
+# ksh Gradle
+#
+# Busybox and similar reduced shells will NOT work, because this script
+# requires all of these POSIX shell features:
+# * functions;
+# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
+# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
+# * compound commands having a testable exit status, especially «case»;
+# * various built-in commands including «command», «set», and «ulimit».
+#
+# Important for patching:
+#
+# (2) This script targets any POSIX shell, so it avoids extensions provided
+# by Bash, Ksh, etc; in particular arrays are avoided.
+#
+# The "traditional" practice of packing multiple parameters into a
+# space-separated string is a well documented source of bugs and security
+# problems, so this is (mostly) avoided, by progressively accumulating
+# options in "$@", and eventually passing that to Java.
+#
+# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
+# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
+# see the in-line comments for details.
+#
+# There are tweaks for specific operating systems such as AIX, CygWin,
+# Darwin, MinGW, and NonStop.
+#
+# (3) This script is generated from the Groovy template
+# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+# within the Gradle project.
+#
+# You can find Gradle at https://github.com/gradle/gradle/.
+#
+##############################################################################
+
+# Attempt to set APP_HOME
+
+# Resolve links: $0 may be a link
+app_path=$0
+
+# Need this for daisy-chained symlinks.
+while
+ APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
+ [ -h "$app_path" ]
+do
+ ls=$( ls -ld "$app_path" )
+ link=${ls#*' -> '}
+ case $link in #(
+ /*) app_path=$link ;; #(
+ *) app_path=$APP_HOME$link ;;
+ esac
+done
+
+# This is normally unused
+# shellcheck disable=SC2034
+APP_BASE_NAME=${0##*/}
+# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
+APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD=maximum
+
+warn () {
+ echo "$*"
+} >&2
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+} >&2
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "$( uname )" in #(
+ CYGWIN* ) cygwin=true ;; #(
+ Darwin* ) darwin=true ;; #(
+ MSYS* | MINGW* ) msys=true ;; #(
+ NONSTOP* ) nonstop=true ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD=$JAVA_HOME/jre/sh/java
+ else
+ JAVACMD=$JAVA_HOME/bin/java
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD=java
+ if ! command -v java >/dev/null 2>&1
+ then
+ die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+fi
+
+# Increase the maximum file descriptors if we can.
+if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
+ case $MAX_FD in #(
+ max*)
+ # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
+ # shellcheck disable=SC2039,SC3045
+ MAX_FD=$( ulimit -H -n ) ||
+ warn "Could not query maximum file descriptor limit"
+ esac
+ case $MAX_FD in #(
+ '' | soft) :;; #(
+ *)
+ # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
+ # shellcheck disable=SC2039,SC3045
+ ulimit -n "$MAX_FD" ||
+ warn "Could not set maximum file descriptor limit to $MAX_FD"
+ esac
+fi
+
+# Collect all arguments for the java command, stacking in reverse order:
+# * args from the command line
+# * the main class name
+# * -classpath
+# * -D...appname settings
+# * --module-path (only if needed)
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if "$cygwin" || "$msys" ; then
+ APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
+ CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
+
+ JAVACMD=$( cygpath --unix "$JAVACMD" )
+
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ for arg do
+ if
+ case $arg in #(
+ -*) false ;; # don't mess with options #(
+ /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
+ [ -e "$t" ] ;; #(
+ *) false ;;
+ esac
+ then
+ arg=$( cygpath --path --ignore --mixed "$arg" )
+ fi
+ # Roll the args list around exactly as many times as the number of
+ # args, so each arg winds up back in the position where it started, but
+ # possibly modified.
+ #
+ # NB: a `for` loop captures its iteration list before it begins, so
+ # changing the positional parameters here affects neither the number of
+ # iterations, nor the values presented in `arg`.
+ shift # remove old arg
+ set -- "$@" "$arg" # push replacement arg
+ done
+fi
+
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Collect all arguments for the java command:
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
+# and any embedded shellness will be escaped.
+# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
+# treated as '${Hostname}' itself on the command line.
+
+set -- \
+ "-Dorg.gradle.appname=$APP_BASE_NAME" \
+ -classpath "$CLASSPATH" \
+ org.gradle.wrapper.GradleWrapperMain \
+ "$@"
+
+# Stop when "xargs" is not available.
+if ! command -v xargs >/dev/null 2>&1
+then
+ die "xargs is not available"
+fi
+
+# Use "xargs" to parse quoted args.
+#
+# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
+#
+# In Bash we could simply go:
+#
+# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
+# set -- "${ARGS[@]}" "$@"
+#
+# but POSIX shell has neither arrays nor command substitution, so instead we
+# post-process each arg (as a line of input to sed) to backslash-escape any
+# character that might be a shell metacharacter, then use eval to reverse
+# that process (while maintaining the separation between arguments), and wrap
+# the whole thing up as a single "set" statement.
+#
+# This will of course break if any of these variables contains a newline or
+# an unmatched quote.
+#
+
+eval "set -- $(
+ printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
+ xargs -n1 |
+ sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
+ tr '\n' ' '
+ )" '"$@"'
+
+exec "$JAVACMD" "$@"
diff --git a/gradlew.bat b/gradlew.bat
new file mode 100644
index 0000000..25da30d
--- /dev/null
+++ b/gradlew.bat
@@ -0,0 +1,92 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
+@if "%DEBUG%"=="" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%"=="" set DIRNAME=.
+@rem This is normally unused
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if %ERRORLEVEL% equ 0 goto execute
+
+echo. 1>&2
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto execute
+
+echo. 1>&2
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
+
+goto fail
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
+
+:end
+@rem End local scope for the variables with windows NT shell
+if %ERRORLEVEL% equ 0 goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+set EXIT_CODE=%ERRORLEVEL%
+if %EXIT_CODE% equ 0 set EXIT_CODE=1
+if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
+exit /b %EXIT_CODE%
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/lib/bcprov-jdk18on-177.jar b/lib/bcprov-jdk18on-177.jar
deleted file mode 100644
index 651d2fb..0000000
--- a/lib/bcprov-jdk18on-177.jar
+++ /dev/null
Binary files differ
diff --git a/lib/commons-cli-1.5.0-javadoc.jar b/lib/commons-cli-1.5.0-javadoc.jar
deleted file mode 100644
index 651dac3..0000000
--- a/lib/commons-cli-1.5.0-javadoc.jar
+++ /dev/null
Binary files differ
diff --git a/lib/commons-cli-1.5.0.jar b/lib/commons-cli-1.5.0.jar
deleted file mode 100644
index e036456..0000000
--- a/lib/commons-cli-1.5.0.jar
+++ /dev/null
Binary files differ
diff --git a/lib/jcardsim-3.0.5.11.jar b/lib/jcardsim-3.0.5.11.jar
deleted file mode 100644
index 90be8a0..0000000
--- a/lib/jcardsim-3.0.5.11.jar
+++ /dev/null
Binary files differ
diff --git a/lib/snakeyaml-1.19.jar b/lib/snakeyaml-1.19.jar
deleted file mode 100644
index 7c73a76..0000000
--- a/lib/snakeyaml-1.19.jar
+++ /dev/null
Binary files differ
diff --git a/nbproject/copylibstask.jar b/nbproject/copylibstask.jar
deleted file mode 100644
index 45fdbe1..0000000
--- a/nbproject/copylibstask.jar
+++ /dev/null
Binary files differ
diff --git a/nbproject/dist-build.xml b/nbproject/dist-build.xml
deleted file mode 100644
index b1bfadf..0000000
--- a/nbproject/dist-build.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="dist-build">
- <description>.</description>
- <target name="package">
- <property name="store.dir" value="dist"/>
- <property name="store.jar" value="${store.dir}/${store.jar.name}.jar"/>
-
- <echo message="Packaging ${application.title} into a single JAR at ${store.jar}"/>
-
- <tempfile property="temp.file" destDir="${java.io.tmpdir}" suffix=".jar"/>
- <tempfile property="temp.previous_jar" destdir="${java.io.tmpdir}" suffix=".jar"/>
-
- <exec executable="git" outputproperty="git.commit" failifexecutionfails="false">
- <arg line="rev-parse --short HEAD"/>
- </exec>
-
- <copy file="${store.jar}" tofile="${temp.previous_jar}" failonerror="false"/>
- <echo message="Backed up ${store.jar} into ${temp.previous_jar}"/>
-
- <delete file="${store.jar}" failonerror="false"/>
- <jar destfile="${temp.file}" filesetmanifest="skip" compress="true" level="8">
- <zipgroupfileset dir="dist" includes="*.jar"/>
- <zipgroupfileset dir="dist/lib" includes="*.jar"/>
-
- <manifest>
- <attribute name="Main-Class" value="${main.class}"/>
- <attribute name="Git-Commit" value="${git.commit}"/>
- </manifest>
- </jar>
-
- <zip destfile="${store.jar}" compress="true" level="8">
- <zipfileset src="${temp.file}"
- excludes="META-INF/*.SF, META-INF/*.DSA, META-INF/*.RSA, ${dist.archive.excludes}"/>
- </zip>
-
- <delete file="${temp.file}"/>
- <delete file="${temp.previous_jar}"/>
- </target>
-</project> \ No newline at end of file
diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties
deleted file mode 100644
index 133840f..0000000
--- a/nbproject/genfiles.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-build.xml.data.CRC32=314f40b8
-build.xml.script.CRC32=5d85f1b1
-build.xml.stylesheet.CRC32=8064a381@1.75.2.48
-# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
-# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
-nbproject/build-impl.xml.data.CRC32=667fcbc9
-nbproject/build-impl.xml.script.CRC32=e6bea23e
-nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.75.2.48
diff --git a/nbproject/keystore b/nbproject/keystore
deleted file mode 100755
index 7c9c8e4..0000000
--- a/nbproject/keystore
+++ /dev/null
Binary files differ
diff --git a/nbproject/reader/build-impl.xml b/nbproject/reader/build-impl.xml
deleted file mode 100644
index f7c43a2..0000000
--- a/nbproject/reader/build-impl.xml
+++ /dev/null
@@ -1,1413 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-*** GENERATED FROM project.xml - DO NOT EDIT ***
-*** EDIT ../build.xml INSTEAD ***
-
-For the purpose of easier reading the script
-is divided into following sections:
-
- - initialization
- - compilation
- - jar
- - execution
- - debugging
- - javadoc
- - test compilation
- - test execution
- - test debugging
- - applet
- - cleanup
-
- -->
-<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir="../../../" default="default" name="ECTesterReader-impl">
- <fail message="Please build using Ant 1.8.0 or higher.">
- <condition>
- <not>
- <antversion atleast="1.8.0"/>
- </not>
- </condition>
- </fail>
- <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
- <!--
- ======================
- INITIALIZATION SECTION
- ======================
- -->
- <target name="-pre-init">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="-pre-init" name="-init-private">
- <property file="nbproject/private/config.properties"/>
- <property file="nbproject/private/configs/${config}.properties"/>
- <property file="nbproject/private/private.properties"/>
- </target>
- <target depends="-pre-init,-init-private" name="-init-user">
- <property file="${user.properties.file}"/>
- <!-- The two properties below are usually overridden -->
- <!-- by the active platform. Just a fallback. -->
- <property name="default.javac.source" value="1.4"/>
- <property name="default.javac.target" value="1.4"/>
- </target>
- <target depends="-pre-init,-init-private,-init-user" name="-init-project">
- <property file="nbproject/configs/${config}.properties"/>
- <property file="nbproject/reader/project.properties"/>
- </target>
- <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
- <property name="platform.java" value="${java.home}/bin/java"/>
- <available file="${manifest.file}" property="manifest.available"/>
- <condition property="splashscreen.available">
- <and>
- <not>
- <equals arg1="${application.splash}" arg2="" trim="true"/>
- </not>
- <available file="${application.splash}"/>
- </and>
- </condition>
- <condition property="main.class.available">
- <and>
- <isset property="main.class"/>
- <not>
- <equals arg1="${main.class}" arg2="" trim="true"/>
- </not>
- </and>
- </condition>
- <condition property="profile.available">
- <and>
- <isset property="javac.profile"/>
- <length length="0" string="${javac.profile}" when="greater"/>
- <matches pattern="1\.[89](\..*)?" string="${javac.source}"/>
- </and>
- </condition>
- <condition property="do.archive">
- <or>
- <not>
- <istrue value="${jar.archive.disabled}"/>
- </not>
- <istrue value="${not.archive.disabled}"/>
- </or>
- </condition>
- <condition property="do.mkdist">
- <and>
- <isset property="do.archive"/>
- <isset property="libs.CopyLibs.classpath"/>
- <not>
- <istrue value="${mkdist.disabled}"/>
- </not>
- </and>
- </condition>
- <condition property="do.archive+manifest.available">
- <and>
- <isset property="manifest.available"/>
- <istrue value="${do.archive}"/>
- </and>
- </condition>
- <condition property="do.archive+main.class.available">
- <and>
- <isset property="main.class.available"/>
- <istrue value="${do.archive}"/>
- </and>
- </condition>
- <condition property="do.archive+splashscreen.available">
- <and>
- <isset property="splashscreen.available"/>
- <istrue value="${do.archive}"/>
- </and>
- </condition>
- <condition property="do.archive+profile.available">
- <and>
- <isset property="profile.available"/>
- <istrue value="${do.archive}"/>
- </and>
- </condition>
- <condition property="have.tests">
- <or>
- <available file="${test.src.dir}"/>
- </or>
- </condition>
- <condition property="have.sources">
- <or>
- <available file="${src.dir}"/>
- </or>
- </condition>
- <condition property="netbeans.home+have.tests">
- <and>
- <isset property="netbeans.home"/>
- <isset property="have.tests"/>
- </and>
- </condition>
- <condition property="no.javadoc.preview">
- <and>
- <isset property="javadoc.preview"/>
- <isfalse value="${javadoc.preview}"/>
- </and>
- </condition>
- <property name="run.jvmargs" value=""/>
- <property name="run.jvmargs.ide" value=""/>
- <property name="javac.compilerargs" value=""/>
- <property name="work.dir" value="${basedir}"/>
- <condition property="no.deps">
- <and>
- <istrue value="${no.dependencies}"/>
- </and>
- </condition>
- <property name="javac.debug" value="true"/>
- <property name="javadoc.preview" value="true"/>
- <property name="application.args" value=""/>
- <property name="source.encoding" value="${file.encoding}"/>
- <property name="runtime.encoding" value="${source.encoding}"/>
- <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
- <and>
- <isset property="javadoc.encoding"/>
- <not>
- <equals arg1="${javadoc.encoding}" arg2=""/>
- </not>
- </and>
- </condition>
- <property name="javadoc.encoding.used" value="${source.encoding}"/>
- <property name="includes" value="**"/>
- <property name="excludes" value=""/>
- <property name="do.depend" value="false"/>
- <condition property="do.depend.true">
- <istrue value="${do.depend}"/>
- </condition>
- <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
- <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
- <and>
- <isset property="endorsed.classpath"/>
- <not>
- <equals arg1="${endorsed.classpath}" arg2="" trim="true"/>
- </not>
- </and>
- </condition>
- <condition else="" property="javac.profile.cmd.line.arg" value="-profile ${javac.profile}">
- <isset property="profile.available"/>
- </condition>
- <condition else="false" property="jdkBug6558476">
- <and>
- <matches pattern="1\.[56]" string="${java.specification.version}"/>
- <not>
- <os family="unix"/>
- </not>
- </and>
- </condition>
- <property name="javac.fork" value="${jdkBug6558476}"/>
- <property name="jar.index" value="false"/>
- <property name="jar.index.metainf" value="${jar.index}"/>
- <property name="copylibs.rebase" value="true"/>
- <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
- <condition property="junit.available">
- <or>
- <available classname="org.junit.Test" classpath="${run.test.classpath}"/>
- <available classname="junit.framework.Test" classpath="${run.test.classpath}"/>
- </or>
- </condition>
- <condition property="testng.available">
- <available classname="org.testng.annotations.Test" classpath="${run.test.classpath}"/>
- </condition>
- <condition property="junit+testng.available">
- <and>
- <istrue value="${junit.available}"/>
- <istrue value="${testng.available}"/>
- </and>
- </condition>
- <condition else="testng" property="testng.mode" value="mixed">
- <istrue value="${junit+testng.available}"/>
- </condition>
- <condition else="" property="testng.debug.mode" value="-mixed">
- <istrue value="${junit+testng.available}"/>
- </condition>
- </target>
- <target name="-post-init">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
- <fail unless="src.dir">Must set src.dir</fail>
- <fail unless="test.src.dir">Must set test.src.dir</fail>
- <fail unless="build.dir">Must set build.dir</fail>
- <fail unless="dist.dir">Must set dist.dir</fail>
- <fail unless="build.classes.dir">Must set build.classes.dir</fail>
- <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
- <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
- <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
- <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
- <fail unless="dist.jar">Must set dist.jar</fail>
- </target>
- <target name="-init-macrodef-property">
- <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
- <attribute name="name"/>
- <attribute name="value"/>
- <sequential>
- <property name="@{name}" value="${@{value}}"/>
- </sequential>
- </macrodef>
- </target>
- <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
- <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${src.dir}" name="srcdir"/>
- <attribute default="${build.classes.dir}" name="destdir"/>
- <attribute default="${javac.classpath}" name="classpath"/>
- <attribute default="${javac.processorpath}" name="processorpath"/>
- <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
- <attribute default="${includes}" name="includes"/>
- <attribute default="${excludes}" name="excludes"/>
- <attribute default="${javac.debug}" name="debug"/>
- <attribute default="${empty.dir}" name="sourcepath"/>
- <attribute default="${empty.dir}" name="gensrcdir"/>
- <element name="customize" optional="true"/>
- <sequential>
- <property location="${build.dir}/empty" name="empty.dir"/>
- <mkdir dir="${empty.dir}"/>
- <mkdir dir="@{apgeneratedsrcdir}"/>
- <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
- <src>
- <dirset dir="@{gensrcdir}" erroronmissingdir="false">
- <include name="*"/>
- </dirset>
- </src>
- <classpath>
- <path path="@{classpath}"/>
- </classpath>
- <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
- <compilerarg line="${javac.profile.cmd.line.arg}"/>
- <compilerarg line="${javac.compilerargs}"/>
- <compilerarg value="-processorpath"/>
- <compilerarg path="@{processorpath}:${empty.dir}"/>
- <compilerarg line="${ap.processors.internal}"/>
- <compilerarg line="${annotation.processing.processor.options}"/>
- <compilerarg value="-s"/>
- <compilerarg path="@{apgeneratedsrcdir}"/>
- <compilerarg line="${ap.proc.none.internal}"/>
- <customize/>
- </javac>
- </sequential>
- </macrodef>
- </target>
- <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
- <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${src.dir}" name="srcdir"/>
- <attribute default="${build.classes.dir}" name="destdir"/>
- <attribute default="${javac.classpath}" name="classpath"/>
- <attribute default="${javac.processorpath}" name="processorpath"/>
- <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
- <attribute default="${includes}" name="includes"/>
- <attribute default="${excludes}" name="excludes"/>
- <attribute default="${javac.debug}" name="debug"/>
- <attribute default="${empty.dir}" name="sourcepath"/>
- <attribute default="${empty.dir}" name="gensrcdir"/>
- <element name="customize" optional="true"/>
- <sequential>
- <property location="${build.dir}/empty" name="empty.dir"/>
- <mkdir dir="${empty.dir}"/>
- <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
- <src>
- <dirset dir="@{gensrcdir}" erroronmissingdir="false">
- <include name="*"/>
- </dirset>
- </src>
- <classpath>
- <path path="@{classpath}"/>
- </classpath>
- <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
- <compilerarg line="${javac.profile.cmd.line.arg}"/>
- <compilerarg line="${javac.compilerargs}"/>
- <customize/>
- </javac>
- </sequential>
- </macrodef>
- </target>
- <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
- <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${src.dir}" name="srcdir"/>
- <attribute default="${build.classes.dir}" name="destdir"/>
- <attribute default="${javac.classpath}" name="classpath"/>
- <sequential>
- <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
- <classpath>
- <path path="@{classpath}"/>
- </classpath>
- </depend>
- </sequential>
- </macrodef>
- <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${build.classes.dir}" name="destdir"/>
- <sequential>
- <fail unless="javac.includes">Must set javac.includes</fail>
- <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
- <path>
- <filelist dir="@{destdir}" files="${javac.includes}"/>
- </path>
- <globmapper from="*.java" to="*.class"/>
- </pathconvert>
- <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
- <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
- <delete>
- <files includesfile="${javac.includesfile.binary}"/>
- </delete>
- <delete>
- <fileset file="${javac.includesfile.binary}"/>
- </delete>
- </sequential>
- </macrodef>
- </target>
- <target if="${junit.available}" name="-init-macrodef-junit-init">
- <condition else="false" property="nb.junit.batch" value="true">
- <and>
- <istrue value="${junit.available}"/>
- <not>
- <isset property="test.method"/>
- </not>
- </and>
- </condition>
- <condition else="false" property="nb.junit.single" value="true">
- <and>
- <istrue value="${junit.available}"/>
- <isset property="test.method"/>
- </and>
- </condition>
- </target>
- <target name="-init-test-properties">
- <property name="test.binaryincludes" value="&lt;nothing&gt;"/>
- <property name="test.binarytestincludes" value=""/>
- <property name="test.binaryexcludes" value=""/>
- </target>
- <target if="${nb.junit.single}" name="-init-macrodef-junit-single" unless="${nb.junit.batch}">
- <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${includes}" name="includes"/>
- <attribute default="${excludes}" name="excludes"/>
- <attribute default="**" name="testincludes"/>
- <attribute default="" name="testmethods"/>
- <element name="customize" optional="true"/>
- <sequential>
- <property name="junit.forkmode" value="perTest"/>
- <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
- <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
- <syspropertyset>
- <propertyref prefix="test-sys-prop."/>
- <mapper from="test-sys-prop.*" to="*" type="glob"/>
- </syspropertyset>
- <formatter type="brief" usefile="false"/>
- <formatter type="xml"/>
- <jvmarg value="-ea"/>
- <customize/>
- </junit>
- </sequential>
- </macrodef>
- </target>
- <target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-batch" unless="${nb.junit.single}">
- <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${includes}" name="includes"/>
- <attribute default="${excludes}" name="excludes"/>
- <attribute default="**" name="testincludes"/>
- <attribute default="" name="testmethods"/>
- <element name="customize" optional="true"/>
- <sequential>
- <property name="junit.forkmode" value="perTest"/>
- <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
- <batchtest todir="${build.test.results.dir}">
- <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
- <filename name="@{testincludes}"/>
- </fileset>
- <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
- <filename name="${test.binarytestincludes}"/>
- </fileset>
- </batchtest>
- <syspropertyset>
- <propertyref prefix="test-sys-prop."/>
- <mapper from="test-sys-prop.*" to="*" type="glob"/>
- </syspropertyset>
- <formatter type="brief" usefile="false"/>
- <formatter type="xml"/>
- <jvmarg value="-ea"/>
- <customize/>
- </junit>
- </sequential>
- </macrodef>
- </target>
- <target depends="-init-macrodef-junit-init,-init-macrodef-junit-single, -init-macrodef-junit-batch" if="${junit.available}" name="-init-macrodef-junit"/>
- <target if="${testng.available}" name="-init-macrodef-testng">
- <macrodef name="testng" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${includes}" name="includes"/>
- <attribute default="${excludes}" name="excludes"/>
- <attribute default="**" name="testincludes"/>
- <attribute default="" name="testmethods"/>
- <element name="customize" optional="true"/>
- <sequential>
- <condition else="" property="testng.methods.arg" value="@{testincludes}.@{testmethods}">
- <isset property="test.method"/>
- </condition>
- <union id="test.set">
- <fileset dir="${test.src.dir}" excludes="@{excludes},**/*.xml,${excludes}" includes="@{includes}">
- <filename name="@{testincludes}"/>
- </fileset>
- </union>
- <taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/>
- <testng classfilesetref="test.set" failureProperty="tests.failed" listeners="org.testng.reporters.VerboseReporter" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="ECTester" testname="TestNG tests" workingDir="${work.dir}">
- <xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/>
- <propertyset>
- <propertyref prefix="test-sys-prop."/>
- <mapper from="test-sys-prop.*" to="*" type="glob"/>
- </propertyset>
- <customize/>
- </testng>
- </sequential>
- </macrodef>
- </target>
- <target name="-init-macrodef-test-impl">
- <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${includes}" name="includes"/>
- <attribute default="${excludes}" name="excludes"/>
- <attribute default="**" name="testincludes"/>
- <attribute default="" name="testmethods"/>
- <element implicit="true" name="customize" optional="true"/>
- <sequential>
- <echo>No tests executed.</echo>
- </sequential>
- </macrodef>
- </target>
- <target depends="-init-macrodef-junit" if="${junit.available}" name="-init-macrodef-junit-impl">
- <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${includes}" name="includes"/>
- <attribute default="${excludes}" name="excludes"/>
- <attribute default="**" name="testincludes"/>
- <attribute default="" name="testmethods"/>
- <element implicit="true" name="customize" optional="true"/>
- <sequential>
- <j2seproject3:junit excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
- <customize/>
- </j2seproject3:junit>
- </sequential>
- </macrodef>
- </target>
- <target depends="-init-macrodef-testng" if="${testng.available}" name="-init-macrodef-testng-impl">
- <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${includes}" name="includes"/>
- <attribute default="${excludes}" name="excludes"/>
- <attribute default="**" name="testincludes"/>
- <attribute default="" name="testmethods"/>
- <element implicit="true" name="customize" optional="true"/>
- <sequential>
- <j2seproject3:testng excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
- <customize/>
- </j2seproject3:testng>
- </sequential>
- </macrodef>
- </target>
- <target depends="-init-macrodef-test-impl,-init-macrodef-junit-impl,-init-macrodef-testng-impl" name="-init-macrodef-test">
- <macrodef name="test" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${includes}" name="includes"/>
- <attribute default="${excludes}" name="excludes"/>
- <attribute default="**" name="testincludes"/>
- <attribute default="" name="testmethods"/>
- <sequential>
- <j2seproject3:test-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
- <customize>
- <classpath>
- <path path="${run.test.classpath}"/>
- </classpath>
- <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
- <jvmarg line="${run.jvmargs}"/>
- <jvmarg line="${run.jvmargs.ide}"/>
- </customize>
- </j2seproject3:test-impl>
- </sequential>
- </macrodef>
- </target>
- <target if="${junit.available}" name="-init-macrodef-junit-debug" unless="${nb.junit.batch}">
- <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${includes}" name="includes"/>
- <attribute default="${excludes}" name="excludes"/>
- <attribute default="**" name="testincludes"/>
- <attribute default="" name="testmethods"/>
- <element name="customize" optional="true"/>
- <sequential>
- <property name="junit.forkmode" value="perTest"/>
- <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
- <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
- <syspropertyset>
- <propertyref prefix="test-sys-prop."/>
- <mapper from="test-sys-prop.*" to="*" type="glob"/>
- </syspropertyset>
- <formatter type="brief" usefile="false"/>
- <formatter type="xml"/>
- <jvmarg value="-ea"/>
- <jvmarg line="${debug-args-line}"/>
- <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
- <customize/>
- </junit>
- </sequential>
- </macrodef>
- </target>
- <target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-debug-batch">
- <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${includes}" name="includes"/>
- <attribute default="${excludes}" name="excludes"/>
- <attribute default="**" name="testincludes"/>
- <attribute default="" name="testmethods"/>
- <element name="customize" optional="true"/>
- <sequential>
- <property name="junit.forkmode" value="perTest"/>
- <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
- <batchtest todir="${build.test.results.dir}">
- <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
- <filename name="@{testincludes}"/>
- </fileset>
- <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
- <filename name="${test.binarytestincludes}"/>
- </fileset>
- </batchtest>
- <syspropertyset>
- <propertyref prefix="test-sys-prop."/>
- <mapper from="test-sys-prop.*" to="*" type="glob"/>
- </syspropertyset>
- <formatter type="brief" usefile="false"/>
- <formatter type="xml"/>
- <jvmarg value="-ea"/>
- <jvmarg line="${debug-args-line}"/>
- <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
- <customize/>
- </junit>
- </sequential>
- </macrodef>
- </target>
- <target depends="-init-macrodef-junit-debug,-init-macrodef-junit-debug-batch" if="${junit.available}" name="-init-macrodef-junit-debug-impl">
- <macrodef name="test-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${includes}" name="includes"/>
- <attribute default="${excludes}" name="excludes"/>
- <attribute default="**" name="testincludes"/>
- <attribute default="" name="testmethods"/>
- <element implicit="true" name="customize" optional="true"/>
- <sequential>
- <j2seproject3:junit-debug excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
- <customize/>
- </j2seproject3:junit-debug>
- </sequential>
- </macrodef>
- </target>
- <target if="${testng.available}" name="-init-macrodef-testng-debug">
- <macrodef name="testng-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${main.class}" name="testClass"/>
- <attribute default="" name="testMethod"/>
- <element name="customize2" optional="true"/>
- <sequential>
- <condition else="-testclass @{testClass}" property="test.class.or.method" value="-methods @{testClass}.@{testMethod}">
- <isset property="test.method"/>
- </condition>
- <condition else="-suitename ECTester -testname @{testClass} ${test.class.or.method}" property="testng.cmd.args" value="@{testClass}">
- <matches pattern=".*\.xml" string="@{testClass}"/>
- </condition>
- <delete dir="${build.test.results.dir}" quiet="true"/>
- <mkdir dir="${build.test.results.dir}"/>
- <j2seproject3:debug classname="org.testng.TestNG" classpath="${debug.test.classpath}">
- <customize>
- <customize2/>
- <jvmarg value="-ea"/>
- <arg line="${testng.debug.mode}"/>
- <arg line="-d ${build.test.results.dir}"/>
- <arg line="-listener org.testng.reporters.VerboseReporter"/>
- <arg line="${testng.cmd.args}"/>
- </customize>
- </j2seproject3:debug>
- </sequential>
- </macrodef>
- </target>
- <target depends="-init-macrodef-testng-debug" if="${testng.available}" name="-init-macrodef-testng-debug-impl">
- <macrodef name="testng-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${main.class}" name="testClass"/>
- <attribute default="" name="testMethod"/>
- <element implicit="true" name="customize2" optional="true"/>
- <sequential>
- <j2seproject3:testng-debug testClass="@{testClass}" testMethod="@{testMethod}">
- <customize2/>
- </j2seproject3:testng-debug>
- </sequential>
- </macrodef>
- </target>
- <target depends="-init-macrodef-junit-debug-impl" if="${junit.available}" name="-init-macrodef-test-debug-junit">
- <macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${includes}" name="includes"/>
- <attribute default="${excludes}" name="excludes"/>
- <attribute default="**" name="testincludes"/>
- <attribute default="" name="testmethods"/>
- <attribute default="${main.class}" name="testClass"/>
- <attribute default="" name="testMethod"/>
- <sequential>
- <j2seproject3:test-debug-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
- <customize>
- <classpath>
- <path path="${run.test.classpath}"/>
- </classpath>
- <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
- <jvmarg line="${run.jvmargs}"/>
- <jvmarg line="${run.jvmargs.ide}"/>
- </customize>
- </j2seproject3:test-debug-impl>
- </sequential>
- </macrodef>
- </target>
- <target depends="-init-macrodef-testng-debug-impl" if="${testng.available}" name="-init-macrodef-test-debug-testng">
- <macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${includes}" name="includes"/>
- <attribute default="${excludes}" name="excludes"/>
- <attribute default="**" name="testincludes"/>
- <attribute default="" name="testmethods"/>
- <attribute default="${main.class}" name="testClass"/>
- <attribute default="" name="testMethod"/>
- <sequential>
- <j2seproject3:testng-debug-impl testClass="@{testClass}" testMethod="@{testMethod}">
- <customize2>
- <syspropertyset>
- <propertyref prefix="test-sys-prop."/>
- <mapper from="test-sys-prop.*" to="*" type="glob"/>
- </syspropertyset>
- </customize2>
- </j2seproject3:testng-debug-impl>
- </sequential>
- </macrodef>
- </target>
- <target depends="-init-macrodef-test-debug-junit,-init-macrodef-test-debug-testng" name="-init-macrodef-test-debug"/>
- <!--
- pre NB7.2 profiling section; consider it deprecated
- -->
- <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" if="profiler.info.jvmargs.agent" name="profile-init"/>
- <target if="profiler.info.jvmargs.agent" name="-profile-pre-init">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target if="profiler.info.jvmargs.agent" name="-profile-post-init">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target if="profiler.info.jvmargs.agent" name="-profile-init-macrodef-profile">
- <macrodef name="resolve">
- <attribute name="name"/>
- <attribute name="value"/>
- <sequential>
- <property name="@{name}" value="${env.@{value}}"/>
- </sequential>
- </macrodef>
- <macrodef name="profile">
- <attribute default="${main.class}" name="classname"/>
- <element name="customize" optional="true"/>
- <sequential>
- <property environment="env"/>
- <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
- <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
- <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
- <jvmarg value="${profiler.info.jvmargs.agent}"/>
- <jvmarg line="${profiler.info.jvmargs}"/>
- <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
- <arg line="${application.args}"/>
- <classpath>
- <path path="${run.classpath}"/>
- </classpath>
- <syspropertyset>
- <propertyref prefix="run-sys-prop."/>
- <mapper from="run-sys-prop.*" to="*" type="glob"/>
- </syspropertyset>
- <customize/>
- </java>
- </sequential>
- </macrodef>
- </target>
- <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" if="profiler.info.jvmargs.agent" name="-profile-init-check">
- <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
- <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
- </target>
- <!--
- end of pre NB7.2 profiling section
- -->
- <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
- <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
- <attribute default="${main.class}" name="name"/>
- <attribute default="${debug.classpath}" name="classpath"/>
- <attribute default="" name="stopclassname"/>
- <sequential>
- <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
- <classpath>
- <path path="@{classpath}"/>
- </classpath>
- </nbjpdastart>
- </sequential>
- </macrodef>
- <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
- <attribute default="${build.classes.dir}" name="dir"/>
- <sequential>
- <nbjpdareload>
- <fileset dir="@{dir}" includes="${fix.classes}">
- <include name="${fix.includes}*.class"/>
- </fileset>
- </nbjpdareload>
- </sequential>
- </macrodef>
- </target>
- <target name="-init-debug-args">
- <property name="version-output" value="java version &quot;${ant.java.version}"/>
- <condition property="have-jdk-older-than-1.4">
- <or>
- <contains string="${version-output}" substring="java version &quot;1.0"/>
- <contains string="${version-output}" substring="java version &quot;1.1"/>
- <contains string="${version-output}" substring="java version &quot;1.2"/>
- <contains string="${version-output}" substring="java version &quot;1.3"/>
- </or>
- </condition>
- <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
- <istrue value="${have-jdk-older-than-1.4}"/>
- </condition>
- <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
- <os family="windows"/>
- </condition>
- <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
- <isset property="debug.transport"/>
- </condition>
- </target>
- <target depends="-init-debug-args" name="-init-macrodef-debug">
- <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${main.class}" name="classname"/>
- <attribute default="${debug.classpath}" name="classpath"/>
- <element name="customize" optional="true"/>
- <sequential>
- <java classname="@{classname}" dir="${work.dir}" fork="true">
- <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
- <jvmarg line="${debug-args-line}"/>
- <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
- <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
- <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
- <jvmarg line="${run.jvmargs}"/>
- <jvmarg line="${run.jvmargs.ide}"/>
- <classpath>
- <path path="@{classpath}"/>
- </classpath>
- <syspropertyset>
- <propertyref prefix="run-sys-prop."/>
- <mapper from="run-sys-prop.*" to="*" type="glob"/>
- </syspropertyset>
- <customize/>
- </java>
- </sequential>
- </macrodef>
- </target>
- <target name="-init-macrodef-java">
- <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
- <attribute default="${main.class}" name="classname"/>
- <attribute default="${run.classpath}" name="classpath"/>
- <attribute default="jvm" name="jvm"/>
- <element name="customize" optional="true"/>
- <sequential>
- <java classname="@{classname}" dir="${work.dir}" fork="true">
- <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
- <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
- <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
- <jvmarg line="${run.jvmargs}"/>
- <jvmarg line="${run.jvmargs.ide}"/>
- <classpath>
- <path path="@{classpath}"/>
- </classpath>
- <syspropertyset>
- <propertyref prefix="run-sys-prop."/>
- <mapper from="run-sys-prop.*" to="*" type="glob"/>
- </syspropertyset>
- <customize/>
- </java>
- </sequential>
- </macrodef>
- </target>
- <target name="-init-macrodef-copylibs">
- <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${manifest.file}" name="manifest"/>
- <element name="customize" optional="true"/>
- <sequential>
- <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
- <pathconvert property="run.classpath.without.build.classes.dir">
- <path path="${run.classpath}"/>
- <map from="${build.classes.dir.resolved}" to=""/>
- </pathconvert>
- <pathconvert pathsep=" " property="jar.classpath">
- <path path="${run.classpath.without.build.classes.dir}"/>
- <chainedmapper>
- <flattenmapper/>
- <filtermapper>
- <replacestring from=" " to="%20"/>
- </filtermapper>
- <globmapper from="*" to="lib/*"/>
- </chainedmapper>
- </pathconvert>
- <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
- <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
- <fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
- <manifest>
- <attribute name="Class-Path" value="${jar.classpath}"/>
- <customize/>
- </manifest>
- </copylibs>
- </sequential>
- </macrodef>
- </target>
- <target name="-init-presetdef-jar">
- <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
- <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
- <j2seproject1:fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
- </jar>
- </presetdef>
- </target>
- <target name="-init-ap-cmdline-properties">
- <property name="annotation.processing.enabled" value="true"/>
- <property name="annotation.processing.processors.list" value=""/>
- <property name="annotation.processing.processor.options" value=""/>
- <property name="annotation.processing.run.all.processors" value="true"/>
- <property name="javac.processorpath" value="${javac.classpath}"/>
- <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
- <condition property="ap.supported.internal" value="true">
- <not>
- <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
- </not>
- </condition>
- </target>
- <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
- <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
- <isfalse value="${annotation.processing.run.all.processors}"/>
- </condition>
- <condition else="" property="ap.proc.none.internal" value="-proc:none">
- <isfalse value="${annotation.processing.enabled}"/>
- </condition>
- </target>
- <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
- <property name="ap.cmd.line.internal" value=""/>
- </target>
- <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-test,-init-macrodef-test-debug,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/>
- <!--
- ===================
- COMPILATION SECTION
- ===================
- -->
- <target name="-deps-jar-init" unless="built-jar.properties">
- <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
- <delete file="${built-jar.properties}" quiet="true"/>
- </target>
- <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
- <echo level="warn" message="Cycle detected: ECTester was already built"/>
- </target>
- <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
- <mkdir dir="${build.dir}"/>
- <touch file="${built-jar.properties}" verbose="false"/>
- <property file="${built-jar.properties}" prefix="already.built.jar."/>
- <antcall target="-warn-already-built-jar"/>
- <propertyfile file="${built-jar.properties}">
- <entry key="${basedir}" value=""/>
- </propertyfile>
- </target>
- <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
- <target depends="init" name="-check-automatic-build">
- <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
- </target>
- <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
- <antcall target="clean"/>
- </target>
- <target depends="init,deps-jar" name="-pre-pre-compile">
- <mkdir dir="${build.classes.dir}"/>
- </target>
- <target name="-pre-compile">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target if="do.depend.true" name="-compile-depend">
- <pathconvert property="build.generated.subdirs">
- <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
- <include name="*"/>
- </dirset>
- </pathconvert>
- <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
- </target>
- <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
- <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
- <copy todir="${build.classes.dir}">
- <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
- </copy>
- </target>
- <target if="has.persistence.xml" name="-copy-persistence-xml">
- <mkdir dir="${build.classes.dir}/META-INF"/>
- <copy todir="${build.classes.dir}/META-INF">
- <fileset dir="${meta.inf.dir}" includes="persistence.xml orm.xml"/>
- </copy>
- </target>
- <target name="-post-compile">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
- <target name="-pre-compile-single">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
- <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
- <j2seproject3:force-recompile/>
- <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/>
- </target>
- <target name="-post-compile-single">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
- <!--
- ====================
- JAR BUILDING SECTION
- ====================
- -->
- <target depends="init" name="-pre-pre-jar">
- <dirname file="${dist.jar}" property="dist.jar.dir"/>
- <mkdir dir="${dist.jar.dir}"/>
- </target>
- <target name="-pre-jar">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="init" if="do.archive" name="-do-jar-create-manifest" unless="manifest.available">
- <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
- <touch file="${tmp.manifest.file}" verbose="false"/>
- </target>
- <target depends="init" if="do.archive+manifest.available" name="-do-jar-copy-manifest">
- <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
- <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
- </target>
- <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+main.class.available" name="-do-jar-set-mainclass">
- <manifest file="${tmp.manifest.file}" mode="update">
- <attribute name="Main-Class" value="${main.class}"/>
- </manifest>
- </target>
- <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+profile.available" name="-do-jar-set-profile">
- <manifest file="${tmp.manifest.file}" mode="update">
- <attribute name="Profile" value="${javac.profile}"/>
- </manifest>
- </target>
- <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-set-splashscreen">
- <basename file="${application.splash}" property="splashscreen.basename"/>
- <mkdir dir="${build.classes.dir}/META-INF"/>
- <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
- <manifest file="${tmp.manifest.file}" mode="update">
- <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
- </manifest>
- </target>
- <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen" if="do.mkdist" name="-do-jar-copylibs">
- <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
- <echo level="info">To run this application from the command line without Ant, try:</echo>
- <property location="${dist.jar}" name="dist.jar.resolved"/>
- <echo level="info">java -jar "${dist.jar.resolved}"</echo>
- </target>
- <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen" if="do.archive" name="-do-jar-jar" unless="do.mkdist">
- <j2seproject1:jar manifest="${tmp.manifest.file}"/>
- <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
- <property location="${dist.jar}" name="dist.jar.resolved"/>
- <pathconvert property="run.classpath.with.dist.jar">
- <path path="${run.classpath}"/>
- <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
- </pathconvert>
- <condition else="" property="jar.usage.message" value="To run this application from the command line without Ant, try:${line.separator}${platform.java} -cp ${run.classpath.with.dist.jar} ${main.class}">
- <isset property="main.class.available"/>
- </condition>
- <condition else="debug" property="jar.usage.level" value="info">
- <isset property="main.class.available"/>
- </condition>
- <echo level="${jar.usage.level}" message="${jar.usage.message}"/>
- </target>
- <target depends="-do-jar-copylibs" if="do.archive" name="-do-jar-delete-manifest">
- <delete>
- <fileset file="${tmp.manifest.file}"/>
- </delete>
- </target>
- <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-do-jar-jar,-do-jar-delete-manifest" name="-do-jar-without-libraries"/>
- <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-do-jar-copylibs,-do-jar-delete-manifest" name="-do-jar-with-libraries"/>
- <target name="-post-jar">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="init,compile,-pre-jar,-do-jar-without-libraries,-do-jar-with-libraries,-post-jar" name="-do-jar"/>
- <target depends="init,compile,-pre-jar,-do-jar,-post-jar" description="Build JAR." name="jar"/>
- <!--
- =================
- EXECUTION SECTION
- =================
- -->
- <target depends="init,compile" description="Run a main class." name="run">
- <j2seproject1:java>
- <customize>
- <arg line="${application.args}"/>
- </customize>
- </j2seproject1:java>
- </target>
- <target name="-do-not-recompile">
- <property name="javac.includes.binary" value=""/>
- </target>
- <target depends="init,compile-single" name="run-single">
- <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
- <j2seproject1:java classname="${run.class}"/>
- </target>
- <target depends="init,compile-test-single" name="run-test-with-main">
- <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
- <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
- </target>
- <!--
- =================
- DEBUGGING SECTION
- =================
- -->
- <target depends="init" if="netbeans.home" name="-debug-start-debugger">
- <j2seproject1:nbjpdastart name="${debug.class}"/>
- </target>
- <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
- <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
- </target>
- <target depends="init,compile" name="-debug-start-debuggee">
- <j2seproject3:debug>
- <customize>
- <arg line="${application.args}"/>
- </customize>
- </j2seproject3:debug>
- </target>
- <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
- <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
- <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
- </target>
- <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
- <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
- <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
- <j2seproject3:debug classname="${debug.class}"/>
- </target>
- <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
- <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
- <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
- <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
- </target>
- <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
- <target depends="init" name="-pre-debug-fix">
- <fail unless="fix.includes">Must set fix.includes</fail>
- <property name="javac.includes" value="${fix.includes}.java"/>
- </target>
- <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
- <j2seproject1:nbjpdareload/>
- </target>
- <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
- <!--
- =================
- PROFILING SECTION
- =================
- -->
- <!--
- pre NB7.2 profiler integration
- -->
- <target depends="profile-init,compile" description="Profile a project in the IDE." if="profiler.info.jvmargs.agent" name="-profile-pre72">
- <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
- <nbprofiledirect>
- <classpath>
- <path path="${run.classpath}"/>
- </classpath>
- </nbprofiledirect>
- <profile/>
- </target>
- <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="profiler.info.jvmargs.agent" name="-profile-single-pre72">
- <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
- <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
- <nbprofiledirect>
- <classpath>
- <path path="${run.classpath}"/>
- </classpath>
- </nbprofiledirect>
- <profile classname="${profile.class}"/>
- </target>
- <target depends="profile-init,compile-single" if="profiler.info.jvmargs.agent" name="-profile-applet-pre72">
- <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
- <nbprofiledirect>
- <classpath>
- <path path="${run.classpath}"/>
- </classpath>
- </nbprofiledirect>
- <profile classname="sun.applet.AppletViewer">
- <customize>
- <arg value="${applet.url}"/>
- </customize>
- </profile>
- </target>
- <target depends="profile-init,compile-test-single" if="profiler.info.jvmargs.agent" name="-profile-test-single-pre72">
- <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
- <nbprofiledirect>
- <classpath>
- <path path="${run.test.classpath}"/>
- </classpath>
- </nbprofiledirect>
- <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
- <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
- <jvmarg value="${profiler.info.jvmargs.agent}"/>
- <jvmarg line="${profiler.info.jvmargs}"/>
- <test name="${profile.class}"/>
- <classpath>
- <path path="${run.test.classpath}"/>
- </classpath>
- <syspropertyset>
- <propertyref prefix="test-sys-prop."/>
- <mapper from="test-sys-prop.*" to="*" type="glob"/>
- </syspropertyset>
- <formatter type="brief" usefile="false"/>
- <formatter type="xml"/>
- </junit>
- </target>
- <!--
- end of pre NB72 profiling section
- -->
- <target if="netbeans.home" name="-profile-check">
- <condition property="profiler.configured">
- <or>
- <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-agentpath:"/>
- <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-javaagent:"/>
- </or>
- </condition>
- </target>
- <target depends="-profile-check,-profile-pre72" description="Profile a project in the IDE." if="profiler.configured" name="profile" unless="profiler.info.jvmargs.agent">
- <startprofiler/>
- <antcall target="run"/>
- </target>
- <target depends="-profile-check,-profile-single-pre72" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-single" unless="profiler.info.jvmargs.agent">
- <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
- <startprofiler/>
- <antcall target="run-single"/>
- </target>
- <target depends="-profile-test-single-pre72" description="Profile a selected test in the IDE." name="profile-test-single"/>
- <target depends="-profile-check" description="Profile a selected test in the IDE." if="profiler.configured" name="profile-test" unless="profiler.info.jvmargs">
- <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
- <startprofiler/>
- <antcall target="test-single"/>
- </target>
- <target depends="-profile-check" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-test-with-main">
- <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
- <startprofiler/>
- <antcal target="run-test-with-main"/>
- </target>
- <target depends="-profile-check,-profile-applet-pre72" if="profiler.configured" name="profile-applet" unless="profiler.info.jvmargs.agent">
- <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
- <startprofiler/>
- <antcall target="run-applet"/>
- </target>
- <!--
- ===============
- JAVADOC SECTION
- ===============
- -->
- <target depends="init" if="have.sources" name="-javadoc-build">
- <mkdir dir="${dist.javadoc.dir}"/>
- <condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
- <and>
- <isset property="endorsed.classpath.cmd.line.arg"/>
- <not>
- <equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
- </not>
- </and>
- </condition>
- <condition else="" property="bug5101868workaround" value="*.java">
- <matches pattern="1\.[56](\..*)?" string="${java.version}"/>
- </condition>
- <javadoc additionalparam="-J-Dfile.encoding=${file.encoding} ${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
- <classpath>
- <path path="${javac.classpath}"/>
- </classpath>
- <fileset dir="${src.dir}" excludes="${bug5101868workaround},${excludes}" includes="${includes}">
- <filename name="**/*.java"/>
- </fileset>
- <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
- <include name="**/*.java"/>
- <exclude name="*.java"/>
- </fileset>
- <arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
- </javadoc>
- <copy todir="${dist.javadoc.dir}">
- <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
- <filename name="**/doc-files/**"/>
- </fileset>
- <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
- <include name="**/doc-files/**"/>
- </fileset>
- </copy>
- </target>
- <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
- <nbbrowse file="${dist.javadoc.dir}/index.html"/>
- </target>
- <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
- <!--
- =========================
- TEST COMPILATION SECTION
- =========================
- -->
- <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
- <mkdir dir="${build.test.classes.dir}"/>
- </target>
- <target name="-pre-compile-test">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target if="do.depend.true" name="-compile-test-depend">
- <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
- </target>
- <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
- <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir="${test.src.dir}"/>
- <copy todir="${build.test.classes.dir}">
- <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
- </copy>
- </target>
- <target name="-post-compile-test">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
- <target name="-pre-compile-test-single">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
- <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
- <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
- <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" processorpath="${javac.test.processorpath}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/>
- <copy todir="${build.test.classes.dir}">
- <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
- </copy>
- </target>
- <target name="-post-compile-test-single">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
- <!--
- =======================
- TEST EXECUTION SECTION
- =======================
- -->
- <target depends="init" if="have.tests" name="-pre-test-run">
- <mkdir dir="${build.test.results.dir}"/>
- </target>
- <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
- <j2seproject3:test includes="${includes}" testincludes="**/*Test.java"/>
- </target>
- <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
- <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
- </target>
- <target depends="init" if="have.tests" name="test-report"/>
- <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
- <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
- <target depends="init" if="have.tests" name="-pre-test-run-single">
- <mkdir dir="${build.test.results.dir}"/>
- </target>
- <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
- <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
- <j2seproject3:test excludes="" includes="${test.includes}" testincludes="${test.includes}"/>
- </target>
- <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
- <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
- </target>
- <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
- <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single-method">
- <fail unless="test.class">Must select some files in the IDE or set test.class</fail>
- <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
- <j2seproject3:test excludes="" includes="${javac.includes}" testincludes="${test.class}" testmethods="${test.method}"/>
- </target>
- <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method" if="have.tests" name="-post-test-run-single-method">
- <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
- </target>
- <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method,-post-test-run-single-method" description="Run single unit test." name="test-single-method"/>
- <!--
- =======================
- TEST DEBUGGING SECTION
- =======================
- -->
- <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test">
- <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
- <j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testincludes="${javac.includes}"/>
- </target>
- <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test-method">
- <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
- <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
- <j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testMethod="${test.method}" testincludes="${test.class}" testmethods="${test.method}"/>
- </target>
- <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
- <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
- </target>
- <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
- <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test-method" name="debug-test-method"/>
- <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
- <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
- </target>
- <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
- <!--
- =========================
- APPLET EXECUTION SECTION
- =========================
- -->
- <target depends="init,compile-single" name="run-applet">
- <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
- <j2seproject1:java classname="sun.applet.AppletViewer">
- <customize>
- <arg value="${applet.url}"/>
- </customize>
- </j2seproject1:java>
- </target>
- <!--
- =========================
- APPLET DEBUGGING SECTION
- =========================
- -->
- <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
- <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
- <j2seproject3:debug classname="sun.applet.AppletViewer">
- <customize>
- <arg value="${applet.url}"/>
- </customize>
- </j2seproject3:debug>
- </target>
- <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
- <!--
- ===============
- CLEANUP SECTION
- ===============
- -->
- <target name="-deps-clean-init" unless="built-clean.properties">
- <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
- <delete file="${built-clean.properties}" quiet="true"/>
- </target>
- <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
- <echo level="warn" message="Cycle detected: ECTester was already built"/>
- </target>
- <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
- <mkdir dir="${build.dir}"/>
- <touch file="${built-clean.properties}" verbose="false"/>
- <property file="${built-clean.properties}" prefix="already.built.clean."/>
- <antcall target="-warn-already-built-clean"/>
- <propertyfile file="${built-clean.properties}">
- <entry key="${basedir}" value=""/>
- </propertyfile>
- </target>
- <target depends="init" name="-do-clean">
- <delete dir="${build.dir}"/>
- <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
- </target>
- <target name="-post-clean">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
- <target name="-check-call-dep">
- <property file="${call.built.properties}" prefix="already.built."/>
- <condition property="should.call.dep">
- <and>
- <not>
- <isset property="already.built.${call.subproject}"/>
- </not>
- <available file="${call.script}"/>
- </and>
- </condition>
- </target>
- <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
- <ant antfile="${call.script}" inheritall="false" target="${call.target}">
- <propertyset>
- <propertyref prefix="transfer."/>
- <mapper from="transfer.*" to="*" type="glob"/>
- </propertyset>
- </ant>
- </target>
-</project>
diff --git a/nbproject/reader/manifest.mf b/nbproject/reader/manifest.mf
deleted file mode 100644
index ee7fb6a..0000000
--- a/nbproject/reader/manifest.mf
+++ /dev/null
@@ -1,4 +0,0 @@
-Manifest-Version: 1.0
-Class-Path: lib/bcprov-jdk18on-177.jar lib/jcardsim-3.0.5.11.jar lib/commons-cli-1.5.0.jar lib/snakeyaml-1.19.jar
-Main-Class: cz.crcs.ectester.reader.ECTesterReader
-
diff --git a/nbproject/reader/project.properties b/nbproject/reader/project.properties
deleted file mode 100644
index 0551b0b..0000000
--- a/nbproject/reader/project.properties
+++ /dev/null
@@ -1,80 +0,0 @@
-annotation.processing.enabled=true
-annotation.processing.enabled.in.editor=false
-annotation.processing.processors.list=
-annotation.processing.run.all.processors=true
-annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
-application.title=ECTesterReader
-application.vendor=xsvenda
-build.classes.dir=${build.dir}/classes
-build.classes.excludes=**/*.java,**/*.form,**/*.c,**/*.cpp,**/*.hpp,**/*.h,**/*.a,**/*.o,**/*.so,**/Makefile,**/Makefile.bat
-# This directory is removed when the project is cleaned:
-build.dir=build
-build.generated.dir=${build.dir}/generated
-build.generated.sources.dir=${build.dir}/generated-sources
-# Only compile against the classpath explicitly listed here:
-build.sysclasspath=ignore
-build.test.classes.dir=${build.dir}/test/classes
-build.test.results.dir=${build.dir}/test/results
-# Uncomment to specify the preferred debugger connection transport:
-#debug.transport=dt_socket
-debug.classpath=\
- ${run.classpath}
-debug.test.classpath=\
- ${run.test.classpath}
-# Files in build.classes.dir which should be excluded from distribution jar
-dist.archive.excludes=**/*.java,**/*.form,**/*.c,**/*.cpp,**/*.hpp,**/*.h,**/*.a,**/*.o,**/*.so,**/Makefile,**/Makefile.bat
-# This directory is removed when the project is cleaned:
-dist.dir=dist
-dist.jar=${dist.dir}/ECTesterReader.jar
-dist.javadoc.dir=${dist.dir}/javadoc
-libs.CopyLibs.classpath=nbproject/copylibstask.jar
-endorsed.classpath=
-excludes=
-includes=**/applet/**,**/common/**,**/data/**,**/reader/**
-jar.compress=true
-javac.classpath=\
- lib/bcprov-jdk18on-177.jar:\
- lib/jcardsim-3.0.5.11.jar:\
- lib/commons-cli-1.5.0.jar:\
- lib/snakeyaml-1.19.jar
-# Space-separated list of extra javac options
-javac.compilerargs=-Xlint:all
-javac.deprecation=false
-javac.processorpath=\
- ${javac.classpath}
-javac.source=11
-javac.target=11
-javac.test.classpath=\
- ${javac.classpath}:\
- ${build.classes.dir}
-javac.test.processorpath=\
- ${javac.test.classpath}
-javadoc.additionalparam=
-javadoc.author=false
-javadoc.encoding=${source.encoding}
-javadoc.noindex=false
-javadoc.nonavbar=false
-javadoc.notree=false
-javadoc.private=false
-javadoc.splitindex=true
-javadoc.use=true
-javadoc.version=false
-javadoc.windowtitle=
-main.class=cz.crcs.ectester.reader.ECTesterReader
-manifest.file=nbproject/reader/manifest.mf
-meta.inf.dir=${src.dir}/META-INF
-mkdist.disabled=false
-platform.active=default_platform
-run.classpath=\
- ${javac.classpath}:\
- ${build.classes.dir}
-# Space-separated list of JVM arguments used when running the project.
-# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
-# To set system properties for unit tests define test-sys-prop.name=value:
-run.jvmargs=
-run.test.classpath=\
- ${javac.test.classpath}:\
- ${build.test.classes.dir}
-source.encoding=UTF-8
-src.dir=src
-test.src.dir=test
diff --git a/nbproject/reader/project.xml b/nbproject/reader/project.xml
deleted file mode 100644
index aebe217..0000000
--- a/nbproject/reader/project.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://www.netbeans.org/ns/project/1">
- <type>org.netbeans.modules.java.j2seproject</type>
- <configuration>
- <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
- <name>ECTesterReader</name>
- <source-roots>
- <root id="src.dir"/>
- </source-roots>
- <test-roots>
- <root id="test.src.dir"/>
- </test-roots>
- </data>
- </configuration>
-</project>
diff --git a/nbproject/standalone/build-impl.xml b/nbproject/standalone/build-impl.xml
deleted file mode 100644
index a1f91c2..0000000
--- a/nbproject/standalone/build-impl.xml
+++ /dev/null
@@ -1,1413 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-*** GENERATED FROM project.xml - DO NOT EDIT ***
-*** EDIT ../build.xml INSTEAD ***
-
-For the purpose of easier reading the script
-is divided into following sections:
-
- - initialization
- - compilation
- - jar
- - execution
- - debugging
- - javadoc
- - test compilation
- - test execution
- - test debugging
- - applet
- - cleanup
-
- -->
-<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir="../../../" default="default" name="ECTesterStandalone-impl">
- <fail message="Please build using Ant 1.8.0 or higher.">
- <condition>
- <not>
- <antversion atleast="1.8.0"/>
- </not>
- </condition>
- </fail>
- <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
- <!--
- ======================
- INITIALIZATION SECTION
- ======================
- -->
- <target name="-pre-init">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="-pre-init" name="-init-private">
- <property file="nbproject/private/config.properties"/>
- <property file="nbproject/private/configs/${config}.properties"/>
- <property file="nbproject/private/private.properties"/>
- </target>
- <target depends="-pre-init,-init-private" name="-init-user">
- <property file="${user.properties.file}"/>
- <!-- The two properties below are usually overridden -->
- <!-- by the active platform. Just a fallback. -->
- <property name="default.javac.source" value="1.4"/>
- <property name="default.javac.target" value="1.4"/>
- </target>
- <target depends="-pre-init,-init-private,-init-user" name="-init-project">
- <property file="nbproject/configs/${config}.properties"/>
- <property file="nbproject/standalone/project.properties"/>
- </target>
- <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
- <property name="platform.java" value="${java.home}/bin/java"/>
- <available file="${manifest.file}" property="manifest.available"/>
- <condition property="splashscreen.available">
- <and>
- <not>
- <equals arg1="${application.splash}" arg2="" trim="true"/>
- </not>
- <available file="${application.splash}"/>
- </and>
- </condition>
- <condition property="main.class.available">
- <and>
- <isset property="main.class"/>
- <not>
- <equals arg1="${main.class}" arg2="" trim="true"/>
- </not>
- </and>
- </condition>
- <condition property="profile.available">
- <and>
- <isset property="javac.profile"/>
- <length length="0" string="${javac.profile}" when="greater"/>
- <matches pattern="1\.[89](\..*)?" string="${javac.source}"/>
- </and>
- </condition>
- <condition property="do.archive">
- <or>
- <not>
- <istrue value="${jar.archive.disabled}"/>
- </not>
- <istrue value="${not.archive.disabled}"/>
- </or>
- </condition>
- <condition property="do.mkdist">
- <and>
- <isset property="do.archive"/>
- <isset property="libs.CopyLibs.classpath"/>
- <not>
- <istrue value="${mkdist.disabled}"/>
- </not>
- </and>
- </condition>
- <condition property="do.archive+manifest.available">
- <and>
- <isset property="manifest.available"/>
- <istrue value="${do.archive}"/>
- </and>
- </condition>
- <condition property="do.archive+main.class.available">
- <and>
- <isset property="main.class.available"/>
- <istrue value="${do.archive}"/>
- </and>
- </condition>
- <condition property="do.archive+splashscreen.available">
- <and>
- <isset property="splashscreen.available"/>
- <istrue value="${do.archive}"/>
- </and>
- </condition>
- <condition property="do.archive+profile.available">
- <and>
- <isset property="profile.available"/>
- <istrue value="${do.archive}"/>
- </and>
- </condition>
- <condition property="have.tests">
- <or>
- <available file="${test.src.dir}"/>
- </or>
- </condition>
- <condition property="have.sources">
- <or>
- <available file="${src.dir}"/>
- </or>
- </condition>
- <condition property="netbeans.home+have.tests">
- <and>
- <isset property="netbeans.home"/>
- <isset property="have.tests"/>
- </and>
- </condition>
- <condition property="no.javadoc.preview">
- <and>
- <isset property="javadoc.preview"/>
- <isfalse value="${javadoc.preview}"/>
- </and>
- </condition>
- <property name="run.jvmargs" value=""/>
- <property name="run.jvmargs.ide" value=""/>
- <property name="javac.compilerargs" value=""/>
- <property name="work.dir" value="${basedir}"/>
- <condition property="no.deps">
- <and>
- <istrue value="${no.dependencies}"/>
- </and>
- </condition>
- <property name="javac.debug" value="true"/>
- <property name="javadoc.preview" value="true"/>
- <property name="application.args" value=""/>
- <property name="source.encoding" value="${file.encoding}"/>
- <property name="runtime.encoding" value="${source.encoding}"/>
- <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
- <and>
- <isset property="javadoc.encoding"/>
- <not>
- <equals arg1="${javadoc.encoding}" arg2=""/>
- </not>
- </and>
- </condition>
- <property name="javadoc.encoding.used" value="${source.encoding}"/>
- <property name="includes" value="**"/>
- <property name="excludes" value=""/>
- <property name="do.depend" value="false"/>
- <condition property="do.depend.true">
- <istrue value="${do.depend}"/>
- </condition>
- <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
- <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
- <and>
- <isset property="endorsed.classpath"/>
- <not>
- <equals arg1="${endorsed.classpath}" arg2="" trim="true"/>
- </not>
- </and>
- </condition>
- <condition else="" property="javac.profile.cmd.line.arg" value="-profile ${javac.profile}">
- <isset property="profile.available"/>
- </condition>
- <condition else="false" property="jdkBug6558476">
- <and>
- <matches pattern="1\.[56]" string="${java.specification.version}"/>
- <not>
- <os family="unix"/>
- </not>
- </and>
- </condition>
- <property name="javac.fork" value="${jdkBug6558476}"/>
- <property name="jar.index" value="false"/>
- <property name="jar.index.metainf" value="${jar.index}"/>
- <property name="copylibs.rebase" value="true"/>
- <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
- <condition property="junit.available">
- <or>
- <available classname="org.junit.Test" classpath="${run.test.classpath}"/>
- <available classname="junit.framework.Test" classpath="${run.test.classpath}"/>
- </or>
- </condition>
- <condition property="testng.available">
- <available classname="org.testng.annotations.Test" classpath="${run.test.classpath}"/>
- </condition>
- <condition property="junit+testng.available">
- <and>
- <istrue value="${junit.available}"/>
- <istrue value="${testng.available}"/>
- </and>
- </condition>
- <condition else="testng" property="testng.mode" value="mixed">
- <istrue value="${junit+testng.available}"/>
- </condition>
- <condition else="" property="testng.debug.mode" value="-mixed">
- <istrue value="${junit+testng.available}"/>
- </condition>
- </target>
- <target name="-post-init">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
- <fail unless="src.dir">Must set src.dir</fail>
- <fail unless="test.src.dir">Must set test.src.dir</fail>
- <fail unless="build.dir">Must set build.dir</fail>
- <fail unless="dist.dir">Must set dist.dir</fail>
- <fail unless="build.classes.dir">Must set build.classes.dir</fail>
- <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
- <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
- <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
- <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
- <fail unless="dist.jar">Must set dist.jar</fail>
- </target>
- <target name="-init-macrodef-property">
- <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
- <attribute name="name"/>
- <attribute name="value"/>
- <sequential>
- <property name="@{name}" value="${@{value}}"/>
- </sequential>
- </macrodef>
- </target>
- <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
- <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${src.dir}" name="srcdir"/>
- <attribute default="${build.classes.dir}" name="destdir"/>
- <attribute default="${javac.classpath}" name="classpath"/>
- <attribute default="${javac.processorpath}" name="processorpath"/>
- <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
- <attribute default="${includes}" name="includes"/>
- <attribute default="${excludes}" name="excludes"/>
- <attribute default="${javac.debug}" name="debug"/>
- <attribute default="${empty.dir}" name="sourcepath"/>
- <attribute default="${empty.dir}" name="gensrcdir"/>
- <element name="customize" optional="true"/>
- <sequential>
- <property location="${build.dir}/empty" name="empty.dir"/>
- <mkdir dir="${empty.dir}"/>
- <mkdir dir="@{apgeneratedsrcdir}"/>
- <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
- <src>
- <dirset dir="@{gensrcdir}" erroronmissingdir="false">
- <include name="*"/>
- </dirset>
- </src>
- <classpath>
- <path path="@{classpath}"/>
- </classpath>
- <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
- <compilerarg line="${javac.profile.cmd.line.arg}"/>
- <compilerarg line="${javac.compilerargs}"/>
- <compilerarg value="-processorpath"/>
- <compilerarg path="@{processorpath}:${empty.dir}"/>
- <compilerarg line="${ap.processors.internal}"/>
- <compilerarg line="${annotation.processing.processor.options}"/>
- <compilerarg value="-s"/>
- <compilerarg path="@{apgeneratedsrcdir}"/>
- <compilerarg line="${ap.proc.none.internal}"/>
- <customize/>
- </javac>
- </sequential>
- </macrodef>
- </target>
- <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
- <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${src.dir}" name="srcdir"/>
- <attribute default="${build.classes.dir}" name="destdir"/>
- <attribute default="${javac.classpath}" name="classpath"/>
- <attribute default="${javac.processorpath}" name="processorpath"/>
- <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
- <attribute default="${includes}" name="includes"/>
- <attribute default="${excludes}" name="excludes"/>
- <attribute default="${javac.debug}" name="debug"/>
- <attribute default="${empty.dir}" name="sourcepath"/>
- <attribute default="${empty.dir}" name="gensrcdir"/>
- <element name="customize" optional="true"/>
- <sequential>
- <property location="${build.dir}/empty" name="empty.dir"/>
- <mkdir dir="${empty.dir}"/>
- <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
- <src>
- <dirset dir="@{gensrcdir}" erroronmissingdir="false">
- <include name="*"/>
- </dirset>
- </src>
- <classpath>
- <path path="@{classpath}"/>
- </classpath>
- <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
- <compilerarg line="${javac.profile.cmd.line.arg}"/>
- <compilerarg line="${javac.compilerargs}"/>
- <customize/>
- </javac>
- </sequential>
- </macrodef>
- </target>
- <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
- <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${src.dir}" name="srcdir"/>
- <attribute default="${build.classes.dir}" name="destdir"/>
- <attribute default="${javac.classpath}" name="classpath"/>
- <sequential>
- <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
- <classpath>
- <path path="@{classpath}"/>
- </classpath>
- </depend>
- </sequential>
- </macrodef>
- <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${build.classes.dir}" name="destdir"/>
- <sequential>
- <fail unless="javac.includes">Must set javac.includes</fail>
- <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
- <path>
- <filelist dir="@{destdir}" files="${javac.includes}"/>
- </path>
- <globmapper from="*.java" to="*.class"/>
- </pathconvert>
- <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
- <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
- <delete>
- <files includesfile="${javac.includesfile.binary}"/>
- </delete>
- <delete>
- <fileset file="${javac.includesfile.binary}"/>
- </delete>
- </sequential>
- </macrodef>
- </target>
- <target if="${junit.available}" name="-init-macrodef-junit-init">
- <condition else="false" property="nb.junit.batch" value="true">
- <and>
- <istrue value="${junit.available}"/>
- <not>
- <isset property="test.method"/>
- </not>
- </and>
- </condition>
- <condition else="false" property="nb.junit.single" value="true">
- <and>
- <istrue value="${junit.available}"/>
- <isset property="test.method"/>
- </and>
- </condition>
- </target>
- <target name="-init-test-properties">
- <property name="test.binaryincludes" value="&lt;nothing&gt;"/>
- <property name="test.binarytestincludes" value=""/>
- <property name="test.binaryexcludes" value=""/>
- </target>
- <target if="${nb.junit.single}" name="-init-macrodef-junit-single" unless="${nb.junit.batch}">
- <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${includes}" name="includes"/>
- <attribute default="${excludes}" name="excludes"/>
- <attribute default="**" name="testincludes"/>
- <attribute default="" name="testmethods"/>
- <element name="customize" optional="true"/>
- <sequential>
- <property name="junit.forkmode" value="perTest"/>
- <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
- <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
- <syspropertyset>
- <propertyref prefix="test-sys-prop."/>
- <mapper from="test-sys-prop.*" to="*" type="glob"/>
- </syspropertyset>
- <formatter type="brief" usefile="false"/>
- <formatter type="xml"/>
- <jvmarg value="-ea"/>
- <customize/>
- </junit>
- </sequential>
- </macrodef>
- </target>
- <target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-batch" unless="${nb.junit.single}">
- <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${includes}" name="includes"/>
- <attribute default="${excludes}" name="excludes"/>
- <attribute default="**" name="testincludes"/>
- <attribute default="" name="testmethods"/>
- <element name="customize" optional="true"/>
- <sequential>
- <property name="junit.forkmode" value="perTest"/>
- <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
- <batchtest todir="${build.test.results.dir}">
- <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
- <filename name="@{testincludes}"/>
- </fileset>
- <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
- <filename name="${test.binarytestincludes}"/>
- </fileset>
- </batchtest>
- <syspropertyset>
- <propertyref prefix="test-sys-prop."/>
- <mapper from="test-sys-prop.*" to="*" type="glob"/>
- </syspropertyset>
- <formatter type="brief" usefile="false"/>
- <formatter type="xml"/>
- <jvmarg value="-ea"/>
- <customize/>
- </junit>
- </sequential>
- </macrodef>
- </target>
- <target depends="-init-macrodef-junit-init,-init-macrodef-junit-single, -init-macrodef-junit-batch" if="${junit.available}" name="-init-macrodef-junit"/>
- <target if="${testng.available}" name="-init-macrodef-testng">
- <macrodef name="testng" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${includes}" name="includes"/>
- <attribute default="${excludes}" name="excludes"/>
- <attribute default="**" name="testincludes"/>
- <attribute default="" name="testmethods"/>
- <element name="customize" optional="true"/>
- <sequential>
- <condition else="" property="testng.methods.arg" value="@{testincludes}.@{testmethods}">
- <isset property="test.method"/>
- </condition>
- <union id="test.set">
- <fileset dir="${test.src.dir}" excludes="@{excludes},**/*.xml,${excludes}" includes="@{includes}">
- <filename name="@{testincludes}"/>
- </fileset>
- </union>
- <taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/>
- <testng classfilesetref="test.set" failureProperty="tests.failed" listeners="org.testng.reporters.VerboseReporter" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="ECTester" testname="TestNG tests" workingDir="${work.dir}">
- <xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/>
- <propertyset>
- <propertyref prefix="test-sys-prop."/>
- <mapper from="test-sys-prop.*" to="*" type="glob"/>
- </propertyset>
- <customize/>
- </testng>
- </sequential>
- </macrodef>
- </target>
- <target name="-init-macrodef-test-impl">
- <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${includes}" name="includes"/>
- <attribute default="${excludes}" name="excludes"/>
- <attribute default="**" name="testincludes"/>
- <attribute default="" name="testmethods"/>
- <element implicit="true" name="customize" optional="true"/>
- <sequential>
- <echo>No tests executed.</echo>
- </sequential>
- </macrodef>
- </target>
- <target depends="-init-macrodef-junit" if="${junit.available}" name="-init-macrodef-junit-impl">
- <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${includes}" name="includes"/>
- <attribute default="${excludes}" name="excludes"/>
- <attribute default="**" name="testincludes"/>
- <attribute default="" name="testmethods"/>
- <element implicit="true" name="customize" optional="true"/>
- <sequential>
- <j2seproject3:junit excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
- <customize/>
- </j2seproject3:junit>
- </sequential>
- </macrodef>
- </target>
- <target depends="-init-macrodef-testng" if="${testng.available}" name="-init-macrodef-testng-impl">
- <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${includes}" name="includes"/>
- <attribute default="${excludes}" name="excludes"/>
- <attribute default="**" name="testincludes"/>
- <attribute default="" name="testmethods"/>
- <element implicit="true" name="customize" optional="true"/>
- <sequential>
- <j2seproject3:testng excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
- <customize/>
- </j2seproject3:testng>
- </sequential>
- </macrodef>
- </target>
- <target depends="-init-macrodef-test-impl,-init-macrodef-junit-impl,-init-macrodef-testng-impl" name="-init-macrodef-test">
- <macrodef name="test" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${includes}" name="includes"/>
- <attribute default="${excludes}" name="excludes"/>
- <attribute default="**" name="testincludes"/>
- <attribute default="" name="testmethods"/>
- <sequential>
- <j2seproject3:test-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
- <customize>
- <classpath>
- <path path="${run.test.classpath}"/>
- </classpath>
- <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
- <jvmarg line="${run.jvmargs}"/>
- <jvmarg line="${run.jvmargs.ide}"/>
- </customize>
- </j2seproject3:test-impl>
- </sequential>
- </macrodef>
- </target>
- <target if="${junit.available}" name="-init-macrodef-junit-debug" unless="${nb.junit.batch}">
- <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${includes}" name="includes"/>
- <attribute default="${excludes}" name="excludes"/>
- <attribute default="**" name="testincludes"/>
- <attribute default="" name="testmethods"/>
- <element name="customize" optional="true"/>
- <sequential>
- <property name="junit.forkmode" value="perTest"/>
- <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
- <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
- <syspropertyset>
- <propertyref prefix="test-sys-prop."/>
- <mapper from="test-sys-prop.*" to="*" type="glob"/>
- </syspropertyset>
- <formatter type="brief" usefile="false"/>
- <formatter type="xml"/>
- <jvmarg value="-ea"/>
- <jvmarg line="${debug-args-line}"/>
- <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
- <customize/>
- </junit>
- </sequential>
- </macrodef>
- </target>
- <target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-debug-batch">
- <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${includes}" name="includes"/>
- <attribute default="${excludes}" name="excludes"/>
- <attribute default="**" name="testincludes"/>
- <attribute default="" name="testmethods"/>
- <element name="customize" optional="true"/>
- <sequential>
- <property name="junit.forkmode" value="perTest"/>
- <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
- <batchtest todir="${build.test.results.dir}">
- <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
- <filename name="@{testincludes}"/>
- </fileset>
- <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
- <filename name="${test.binarytestincludes}"/>
- </fileset>
- </batchtest>
- <syspropertyset>
- <propertyref prefix="test-sys-prop."/>
- <mapper from="test-sys-prop.*" to="*" type="glob"/>
- </syspropertyset>
- <formatter type="brief" usefile="false"/>
- <formatter type="xml"/>
- <jvmarg value="-ea"/>
- <jvmarg line="${debug-args-line}"/>
- <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
- <customize/>
- </junit>
- </sequential>
- </macrodef>
- </target>
- <target depends="-init-macrodef-junit-debug,-init-macrodef-junit-debug-batch" if="${junit.available}" name="-init-macrodef-junit-debug-impl">
- <macrodef name="test-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${includes}" name="includes"/>
- <attribute default="${excludes}" name="excludes"/>
- <attribute default="**" name="testincludes"/>
- <attribute default="" name="testmethods"/>
- <element implicit="true" name="customize" optional="true"/>
- <sequential>
- <j2seproject3:junit-debug excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
- <customize/>
- </j2seproject3:junit-debug>
- </sequential>
- </macrodef>
- </target>
- <target if="${testng.available}" name="-init-macrodef-testng-debug">
- <macrodef name="testng-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${main.class}" name="testClass"/>
- <attribute default="" name="testMethod"/>
- <element name="customize2" optional="true"/>
- <sequential>
- <condition else="-testclass @{testClass}" property="test.class.or.method" value="-methods @{testClass}.@{testMethod}">
- <isset property="test.method"/>
- </condition>
- <condition else="-suitename ECTester -testname @{testClass} ${test.class.or.method}" property="testng.cmd.args" value="@{testClass}">
- <matches pattern=".*\.xml" string="@{testClass}"/>
- </condition>
- <delete dir="${build.test.results.dir}" quiet="true"/>
- <mkdir dir="${build.test.results.dir}"/>
- <j2seproject3:debug classname="org.testng.TestNG" classpath="${debug.test.classpath}">
- <customize>
- <customize2/>
- <jvmarg value="-ea"/>
- <arg line="${testng.debug.mode}"/>
- <arg line="-d ${build.test.results.dir}"/>
- <arg line="-listener org.testng.reporters.VerboseReporter"/>
- <arg line="${testng.cmd.args}"/>
- </customize>
- </j2seproject3:debug>
- </sequential>
- </macrodef>
- </target>
- <target depends="-init-macrodef-testng-debug" if="${testng.available}" name="-init-macrodef-testng-debug-impl">
- <macrodef name="testng-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${main.class}" name="testClass"/>
- <attribute default="" name="testMethod"/>
- <element implicit="true" name="customize2" optional="true"/>
- <sequential>
- <j2seproject3:testng-debug testClass="@{testClass}" testMethod="@{testMethod}">
- <customize2/>
- </j2seproject3:testng-debug>
- </sequential>
- </macrodef>
- </target>
- <target depends="-init-macrodef-junit-debug-impl" if="${junit.available}" name="-init-macrodef-test-debug-junit">
- <macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${includes}" name="includes"/>
- <attribute default="${excludes}" name="excludes"/>
- <attribute default="**" name="testincludes"/>
- <attribute default="" name="testmethods"/>
- <attribute default="${main.class}" name="testClass"/>
- <attribute default="" name="testMethod"/>
- <sequential>
- <j2seproject3:test-debug-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
- <customize>
- <classpath>
- <path path="${run.test.classpath}"/>
- </classpath>
- <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
- <jvmarg line="${run.jvmargs}"/>
- <jvmarg line="${run.jvmargs.ide}"/>
- </customize>
- </j2seproject3:test-debug-impl>
- </sequential>
- </macrodef>
- </target>
- <target depends="-init-macrodef-testng-debug-impl" if="${testng.available}" name="-init-macrodef-test-debug-testng">
- <macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${includes}" name="includes"/>
- <attribute default="${excludes}" name="excludes"/>
- <attribute default="**" name="testincludes"/>
- <attribute default="" name="testmethods"/>
- <attribute default="${main.class}" name="testClass"/>
- <attribute default="" name="testMethod"/>
- <sequential>
- <j2seproject3:testng-debug-impl testClass="@{testClass}" testMethod="@{testMethod}">
- <customize2>
- <syspropertyset>
- <propertyref prefix="test-sys-prop."/>
- <mapper from="test-sys-prop.*" to="*" type="glob"/>
- </syspropertyset>
- </customize2>
- </j2seproject3:testng-debug-impl>
- </sequential>
- </macrodef>
- </target>
- <target depends="-init-macrodef-test-debug-junit,-init-macrodef-test-debug-testng" name="-init-macrodef-test-debug"/>
- <!--
- pre NB7.2 profiling section; consider it deprecated
- -->
- <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" if="profiler.info.jvmargs.agent" name="profile-init"/>
- <target if="profiler.info.jvmargs.agent" name="-profile-pre-init">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target if="profiler.info.jvmargs.agent" name="-profile-post-init">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target if="profiler.info.jvmargs.agent" name="-profile-init-macrodef-profile">
- <macrodef name="resolve">
- <attribute name="name"/>
- <attribute name="value"/>
- <sequential>
- <property name="@{name}" value="${env.@{value}}"/>
- </sequential>
- </macrodef>
- <macrodef name="profile">
- <attribute default="${main.class}" name="classname"/>
- <element name="customize" optional="true"/>
- <sequential>
- <property environment="env"/>
- <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
- <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
- <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
- <jvmarg value="${profiler.info.jvmargs.agent}"/>
- <jvmarg line="${profiler.info.jvmargs}"/>
- <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
- <arg line="${application.args}"/>
- <classpath>
- <path path="${run.classpath}"/>
- </classpath>
- <syspropertyset>
- <propertyref prefix="run-sys-prop."/>
- <mapper from="run-sys-prop.*" to="*" type="glob"/>
- </syspropertyset>
- <customize/>
- </java>
- </sequential>
- </macrodef>
- </target>
- <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" if="profiler.info.jvmargs.agent" name="-profile-init-check">
- <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
- <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
- </target>
- <!--
- end of pre NB7.2 profiling section
- -->
- <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
- <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
- <attribute default="${main.class}" name="name"/>
- <attribute default="${debug.classpath}" name="classpath"/>
- <attribute default="" name="stopclassname"/>
- <sequential>
- <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
- <classpath>
- <path path="@{classpath}"/>
- </classpath>
- </nbjpdastart>
- </sequential>
- </macrodef>
- <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
- <attribute default="${build.classes.dir}" name="dir"/>
- <sequential>
- <nbjpdareload>
- <fileset dir="@{dir}" includes="${fix.classes}">
- <include name="${fix.includes}*.class"/>
- </fileset>
- </nbjpdareload>
- </sequential>
- </macrodef>
- </target>
- <target name="-init-debug-args">
- <property name="version-output" value="java version &quot;${ant.java.version}"/>
- <condition property="have-jdk-older-than-1.4">
- <or>
- <contains string="${version-output}" substring="java version &quot;1.0"/>
- <contains string="${version-output}" substring="java version &quot;1.1"/>
- <contains string="${version-output}" substring="java version &quot;1.2"/>
- <contains string="${version-output}" substring="java version &quot;1.3"/>
- </or>
- </condition>
- <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
- <istrue value="${have-jdk-older-than-1.4}"/>
- </condition>
- <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
- <os family="windows"/>
- </condition>
- <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
- <isset property="debug.transport"/>
- </condition>
- </target>
- <target depends="-init-debug-args" name="-init-macrodef-debug">
- <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${main.class}" name="classname"/>
- <attribute default="${debug.classpath}" name="classpath"/>
- <element name="customize" optional="true"/>
- <sequential>
- <java classname="@{classname}" dir="${work.dir}" fork="true">
- <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
- <jvmarg line="${debug-args-line}"/>
- <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
- <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
- <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
- <jvmarg line="${run.jvmargs}"/>
- <jvmarg line="${run.jvmargs.ide}"/>
- <classpath>
- <path path="@{classpath}"/>
- </classpath>
- <syspropertyset>
- <propertyref prefix="run-sys-prop."/>
- <mapper from="run-sys-prop.*" to="*" type="glob"/>
- </syspropertyset>
- <customize/>
- </java>
- </sequential>
- </macrodef>
- </target>
- <target name="-init-macrodef-java">
- <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
- <attribute default="${main.class}" name="classname"/>
- <attribute default="${run.classpath}" name="classpath"/>
- <attribute default="jvm" name="jvm"/>
- <element name="customize" optional="true"/>
- <sequential>
- <java classname="@{classname}" dir="${work.dir}" fork="true">
- <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
- <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
- <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
- <jvmarg line="${run.jvmargs}"/>
- <jvmarg line="${run.jvmargs.ide}"/>
- <classpath>
- <path path="@{classpath}"/>
- </classpath>
- <syspropertyset>
- <propertyref prefix="run-sys-prop."/>
- <mapper from="run-sys-prop.*" to="*" type="glob"/>
- </syspropertyset>
- <customize/>
- </java>
- </sequential>
- </macrodef>
- </target>
- <target name="-init-macrodef-copylibs">
- <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${manifest.file}" name="manifest"/>
- <element name="customize" optional="true"/>
- <sequential>
- <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
- <pathconvert property="run.classpath.without.build.classes.dir">
- <path path="${run.classpath}"/>
- <map from="${build.classes.dir.resolved}" to=""/>
- </pathconvert>
- <pathconvert pathsep=" " property="jar.classpath">
- <path path="${run.classpath.without.build.classes.dir}"/>
- <chainedmapper>
- <flattenmapper/>
- <filtermapper>
- <replacestring from=" " to="%20"/>
- </filtermapper>
- <globmapper from="*" to="lib/*"/>
- </chainedmapper>
- </pathconvert>
- <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
- <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
- <fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
- <manifest>
- <attribute name="Class-Path" value="${jar.classpath}"/>
- <customize/>
- </manifest>
- </copylibs>
- </sequential>
- </macrodef>
- </target>
- <target name="-init-presetdef-jar">
- <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
- <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
- <j2seproject1:fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
- </jar>
- </presetdef>
- </target>
- <target name="-init-ap-cmdline-properties">
- <property name="annotation.processing.enabled" value="true"/>
- <property name="annotation.processing.processors.list" value=""/>
- <property name="annotation.processing.processor.options" value=""/>
- <property name="annotation.processing.run.all.processors" value="true"/>
- <property name="javac.processorpath" value="${javac.classpath}"/>
- <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
- <condition property="ap.supported.internal" value="true">
- <not>
- <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
- </not>
- </condition>
- </target>
- <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
- <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
- <isfalse value="${annotation.processing.run.all.processors}"/>
- </condition>
- <condition else="" property="ap.proc.none.internal" value="-proc:none">
- <isfalse value="${annotation.processing.enabled}"/>
- </condition>
- </target>
- <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
- <property name="ap.cmd.line.internal" value=""/>
- </target>
- <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-test,-init-macrodef-test-debug,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/>
- <!--
- ===================
- COMPILATION SECTION
- ===================
- -->
- <target name="-deps-jar-init" unless="built-jar.properties">
- <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
- <delete file="${built-jar.properties}" quiet="true"/>
- </target>
- <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
- <echo level="warn" message="Cycle detected: ECTester was already built"/>
- </target>
- <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
- <mkdir dir="${build.dir}"/>
- <touch file="${built-jar.properties}" verbose="false"/>
- <property file="${built-jar.properties}" prefix="already.built.jar."/>
- <antcall target="-warn-already-built-jar"/>
- <propertyfile file="${built-jar.properties}">
- <entry key="${basedir}" value=""/>
- </propertyfile>
- </target>
- <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
- <target depends="init" name="-check-automatic-build">
- <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
- </target>
- <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
- <antcall target="clean"/>
- </target>
- <target depends="init,deps-jar" name="-pre-pre-compile">
- <mkdir dir="${build.classes.dir}"/>
- </target>
- <target name="-pre-compile">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target if="do.depend.true" name="-compile-depend">
- <pathconvert property="build.generated.subdirs">
- <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
- <include name="*"/>
- </dirset>
- </pathconvert>
- <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
- </target>
- <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
- <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
- <copy todir="${build.classes.dir}">
- <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
- </copy>
- </target>
- <target if="has.persistence.xml" name="-copy-persistence-xml">
- <mkdir dir="${build.classes.dir}/META-INF"/>
- <copy todir="${build.classes.dir}/META-INF">
- <fileset dir="${meta.inf.dir}" includes="persistence.xml orm.xml"/>
- </copy>
- </target>
- <target name="-post-compile">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
- <target name="-pre-compile-single">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
- <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
- <j2seproject3:force-recompile/>
- <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/>
- </target>
- <target name="-post-compile-single">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
- <!--
- ====================
- JAR BUILDING SECTION
- ====================
- -->
- <target depends="init" name="-pre-pre-jar">
- <dirname file="${dist.jar}" property="dist.jar.dir"/>
- <mkdir dir="${dist.jar.dir}"/>
- </target>
- <target name="-pre-jar">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="init" if="do.archive" name="-do-jar-create-manifest" unless="manifest.available">
- <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
- <touch file="${tmp.manifest.file}" verbose="false"/>
- </target>
- <target depends="init" if="do.archive+manifest.available" name="-do-jar-copy-manifest">
- <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
- <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
- </target>
- <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+main.class.available" name="-do-jar-set-mainclass">
- <manifest file="${tmp.manifest.file}" mode="update">
- <attribute name="Main-Class" value="${main.class}"/>
- </manifest>
- </target>
- <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+profile.available" name="-do-jar-set-profile">
- <manifest file="${tmp.manifest.file}" mode="update">
- <attribute name="Profile" value="${javac.profile}"/>
- </manifest>
- </target>
- <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-set-splashscreen">
- <basename file="${application.splash}" property="splashscreen.basename"/>
- <mkdir dir="${build.classes.dir}/META-INF"/>
- <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
- <manifest file="${tmp.manifest.file}" mode="update">
- <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
- </manifest>
- </target>
- <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen" if="do.mkdist" name="-do-jar-copylibs">
- <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
- <echo level="info">To run this application from the command line without Ant, try:</echo>
- <property location="${dist.jar}" name="dist.jar.resolved"/>
- <echo level="info">java -jar "${dist.jar.resolved}"</echo>
- </target>
- <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen" if="do.archive" name="-do-jar-jar" unless="do.mkdist">
- <j2seproject1:jar manifest="${tmp.manifest.file}"/>
- <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
- <property location="${dist.jar}" name="dist.jar.resolved"/>
- <pathconvert property="run.classpath.with.dist.jar">
- <path path="${run.classpath}"/>
- <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
- </pathconvert>
- <condition else="" property="jar.usage.message" value="To run this application from the command line without Ant, try:${line.separator}${platform.java} -cp ${run.classpath.with.dist.jar} ${main.class}">
- <isset property="main.class.available"/>
- </condition>
- <condition else="debug" property="jar.usage.level" value="info">
- <isset property="main.class.available"/>
- </condition>
- <echo level="${jar.usage.level}" message="${jar.usage.message}"/>
- </target>
- <target depends="-do-jar-copylibs" if="do.archive" name="-do-jar-delete-manifest">
- <delete>
- <fileset file="${tmp.manifest.file}"/>
- </delete>
- </target>
- <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-do-jar-jar,-do-jar-delete-manifest" name="-do-jar-without-libraries"/>
- <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-do-jar-copylibs,-do-jar-delete-manifest" name="-do-jar-with-libraries"/>
- <target name="-post-jar">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="init,compile,-pre-jar,-do-jar-without-libraries,-do-jar-with-libraries,-post-jar" name="-do-jar"/>
- <target depends="init,compile,-pre-jar,-do-jar,-post-jar" description="Build JAR." name="jar"/>
- <!--
- =================
- EXECUTION SECTION
- =================
- -->
- <target depends="init,compile" description="Run a main class." name="run">
- <j2seproject1:java>
- <customize>
- <arg line="${application.args}"/>
- </customize>
- </j2seproject1:java>
- </target>
- <target name="-do-not-recompile">
- <property name="javac.includes.binary" value=""/>
- </target>
- <target depends="init,compile-single" name="run-single">
- <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
- <j2seproject1:java classname="${run.class}"/>
- </target>
- <target depends="init,compile-test-single" name="run-test-with-main">
- <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
- <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
- </target>
- <!--
- =================
- DEBUGGING SECTION
- =================
- -->
- <target depends="init" if="netbeans.home" name="-debug-start-debugger">
- <j2seproject1:nbjpdastart name="${debug.class}"/>
- </target>
- <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
- <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
- </target>
- <target depends="init,compile" name="-debug-start-debuggee">
- <j2seproject3:debug>
- <customize>
- <arg line="${application.args}"/>
- </customize>
- </j2seproject3:debug>
- </target>
- <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
- <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
- <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
- </target>
- <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
- <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
- <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
- <j2seproject3:debug classname="${debug.class}"/>
- </target>
- <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
- <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
- <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
- <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
- </target>
- <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
- <target depends="init" name="-pre-debug-fix">
- <fail unless="fix.includes">Must set fix.includes</fail>
- <property name="javac.includes" value="${fix.includes}.java"/>
- </target>
- <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
- <j2seproject1:nbjpdareload/>
- </target>
- <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
- <!--
- =================
- PROFILING SECTION
- =================
- -->
- <!--
- pre NB7.2 profiler integration
- -->
- <target depends="profile-init,compile" description="Profile a project in the IDE." if="profiler.info.jvmargs.agent" name="-profile-pre72">
- <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
- <nbprofiledirect>
- <classpath>
- <path path="${run.classpath}"/>
- </classpath>
- </nbprofiledirect>
- <profile/>
- </target>
- <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="profiler.info.jvmargs.agent" name="-profile-single-pre72">
- <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
- <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
- <nbprofiledirect>
- <classpath>
- <path path="${run.classpath}"/>
- </classpath>
- </nbprofiledirect>
- <profile classname="${profile.class}"/>
- </target>
- <target depends="profile-init,compile-single" if="profiler.info.jvmargs.agent" name="-profile-applet-pre72">
- <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
- <nbprofiledirect>
- <classpath>
- <path path="${run.classpath}"/>
- </classpath>
- </nbprofiledirect>
- <profile classname="sun.applet.AppletViewer">
- <customize>
- <arg value="${applet.url}"/>
- </customize>
- </profile>
- </target>
- <target depends="profile-init,compile-test-single" if="profiler.info.jvmargs.agent" name="-profile-test-single-pre72">
- <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
- <nbprofiledirect>
- <classpath>
- <path path="${run.test.classpath}"/>
- </classpath>
- </nbprofiledirect>
- <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
- <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
- <jvmarg value="${profiler.info.jvmargs.agent}"/>
- <jvmarg line="${profiler.info.jvmargs}"/>
- <test name="${profile.class}"/>
- <classpath>
- <path path="${run.test.classpath}"/>
- </classpath>
- <syspropertyset>
- <propertyref prefix="test-sys-prop."/>
- <mapper from="test-sys-prop.*" to="*" type="glob"/>
- </syspropertyset>
- <formatter type="brief" usefile="false"/>
- <formatter type="xml"/>
- </junit>
- </target>
- <!--
- end of pre NB72 profiling section
- -->
- <target if="netbeans.home" name="-profile-check">
- <condition property="profiler.configured">
- <or>
- <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-agentpath:"/>
- <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-javaagent:"/>
- </or>
- </condition>
- </target>
- <target depends="-profile-check,-profile-pre72" description="Profile a project in the IDE." if="profiler.configured" name="profile" unless="profiler.info.jvmargs.agent">
- <startprofiler/>
- <antcall target="run"/>
- </target>
- <target depends="-profile-check,-profile-single-pre72" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-single" unless="profiler.info.jvmargs.agent">
- <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
- <startprofiler/>
- <antcall target="run-single"/>
- </target>
- <target depends="-profile-test-single-pre72" description="Profile a selected test in the IDE." name="profile-test-single"/>
- <target depends="-profile-check" description="Profile a selected test in the IDE." if="profiler.configured" name="profile-test" unless="profiler.info.jvmargs">
- <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
- <startprofiler/>
- <antcall target="test-single"/>
- </target>
- <target depends="-profile-check" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-test-with-main">
- <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
- <startprofiler/>
- <antcal target="run-test-with-main"/>
- </target>
- <target depends="-profile-check,-profile-applet-pre72" if="profiler.configured" name="profile-applet" unless="profiler.info.jvmargs.agent">
- <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
- <startprofiler/>
- <antcall target="run-applet"/>
- </target>
- <!--
- ===============
- JAVADOC SECTION
- ===============
- -->
- <target depends="init" if="have.sources" name="-javadoc-build">
- <mkdir dir="${dist.javadoc.dir}"/>
- <condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
- <and>
- <isset property="endorsed.classpath.cmd.line.arg"/>
- <not>
- <equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
- </not>
- </and>
- </condition>
- <condition else="" property="bug5101868workaround" value="*.java">
- <matches pattern="1\.[56](\..*)?" string="${java.version}"/>
- </condition>
- <javadoc additionalparam="-J-Dfile.encoding=${file.encoding} ${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
- <classpath>
- <path path="${javac.classpath}"/>
- </classpath>
- <fileset dir="${src.dir}" excludes="${bug5101868workaround},${excludes}" includes="${includes}">
- <filename name="**/*.java"/>
- </fileset>
- <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
- <include name="**/*.java"/>
- <exclude name="*.java"/>
- </fileset>
- <arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
- </javadoc>
- <copy todir="${dist.javadoc.dir}">
- <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
- <filename name="**/doc-files/**"/>
- </fileset>
- <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
- <include name="**/doc-files/**"/>
- </fileset>
- </copy>
- </target>
- <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
- <nbbrowse file="${dist.javadoc.dir}/index.html"/>
- </target>
- <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
- <!--
- =========================
- TEST COMPILATION SECTION
- =========================
- -->
- <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
- <mkdir dir="${build.test.classes.dir}"/>
- </target>
- <target name="-pre-compile-test">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target if="do.depend.true" name="-compile-test-depend">
- <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
- </target>
- <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
- <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir="${test.src.dir}"/>
- <copy todir="${build.test.classes.dir}">
- <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
- </copy>
- </target>
- <target name="-post-compile-test">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
- <target name="-pre-compile-test-single">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
- <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
- <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
- <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" processorpath="${javac.test.processorpath}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/>
- <copy todir="${build.test.classes.dir}">
- <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
- </copy>
- </target>
- <target name="-post-compile-test-single">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
- <!--
- =======================
- TEST EXECUTION SECTION
- =======================
- -->
- <target depends="init" if="have.tests" name="-pre-test-run">
- <mkdir dir="${build.test.results.dir}"/>
- </target>
- <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
- <j2seproject3:test includes="${includes}" testincludes="**/*Test.java"/>
- </target>
- <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
- <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
- </target>
- <target depends="init" if="have.tests" name="test-report"/>
- <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
- <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
- <target depends="init" if="have.tests" name="-pre-test-run-single">
- <mkdir dir="${build.test.results.dir}"/>
- </target>
- <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
- <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
- <j2seproject3:test excludes="" includes="${test.includes}" testincludes="${test.includes}"/>
- </target>
- <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
- <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
- </target>
- <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
- <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single-method">
- <fail unless="test.class">Must select some files in the IDE or set test.class</fail>
- <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
- <j2seproject3:test excludes="" includes="${javac.includes}" testincludes="${test.class}" testmethods="${test.method}"/>
- </target>
- <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method" if="have.tests" name="-post-test-run-single-method">
- <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
- </target>
- <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method,-post-test-run-single-method" description="Run single unit test." name="test-single-method"/>
- <!--
- =======================
- TEST DEBUGGING SECTION
- =======================
- -->
- <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test">
- <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
- <j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testincludes="${javac.includes}"/>
- </target>
- <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test-method">
- <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
- <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
- <j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testMethod="${test.method}" testincludes="${test.class}" testmethods="${test.method}"/>
- </target>
- <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
- <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
- </target>
- <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
- <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test-method" name="debug-test-method"/>
- <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
- <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
- </target>
- <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
- <!--
- =========================
- APPLET EXECUTION SECTION
- =========================
- -->
- <target depends="init,compile-single" name="run-applet">
- <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
- <j2seproject1:java classname="sun.applet.AppletViewer">
- <customize>
- <arg value="${applet.url}"/>
- </customize>
- </j2seproject1:java>
- </target>
- <!--
- =========================
- APPLET DEBUGGING SECTION
- =========================
- -->
- <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
- <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
- <j2seproject3:debug classname="sun.applet.AppletViewer">
- <customize>
- <arg value="${applet.url}"/>
- </customize>
- </j2seproject3:debug>
- </target>
- <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
- <!--
- ===============
- CLEANUP SECTION
- ===============
- -->
- <target name="-deps-clean-init" unless="built-clean.properties">
- <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
- <delete file="${built-clean.properties}" quiet="true"/>
- </target>
- <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
- <echo level="warn" message="Cycle detected: ECTester was already built"/>
- </target>
- <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
- <mkdir dir="${build.dir}"/>
- <touch file="${built-clean.properties}" verbose="false"/>
- <property file="${built-clean.properties}" prefix="already.built.clean."/>
- <antcall target="-warn-already-built-clean"/>
- <propertyfile file="${built-clean.properties}">
- <entry key="${basedir}" value=""/>
- </propertyfile>
- </target>
- <target depends="init" name="-do-clean">
- <delete dir="${build.dir}"/>
- <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
- </target>
- <target name="-post-clean">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
- <target name="-check-call-dep">
- <property file="${call.built.properties}" prefix="already.built."/>
- <condition property="should.call.dep">
- <and>
- <not>
- <isset property="already.built.${call.subproject}"/>
- </not>
- <available file="${call.script}"/>
- </and>
- </condition>
- </target>
- <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
- <ant antfile="${call.script}" inheritall="false" target="${call.target}">
- <propertyset>
- <propertyref prefix="transfer."/>
- <mapper from="transfer.*" to="*" type="glob"/>
- </propertyset>
- </ant>
- </target>
-</project>
diff --git a/nbproject/standalone/manifest.mf b/nbproject/standalone/manifest.mf
deleted file mode 100644
index a0eb692..0000000
--- a/nbproject/standalone/manifest.mf
+++ /dev/null
@@ -1,4 +0,0 @@
-Manifest-Version: 1.0
-Class-Path: lib/bcprov-jdk18on-177.jar lib/wolfcrypt-jni.jar lib/jcardsim-3.0.5.11.jar lib/commons-cli-1.5.0.jar lib/snakeyaml-1.19.jar
-Main-Class: cz.crcs.ectester.standalone.ECTesterStandalone
-
diff --git a/nbproject/standalone/project.properties b/nbproject/standalone/project.properties
deleted file mode 100644
index 562f44a..0000000
--- a/nbproject/standalone/project.properties
+++ /dev/null
@@ -1,81 +0,0 @@
-annotation.processing.enabled=true
-annotation.processing.enabled.in.editor=false
-annotation.processing.processors.list=
-annotation.processing.run.all.processors=true
-annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
-application.title=ECTesterStandalone
-application.vendor=xsvenda
-build.classes.dir=${build.dir}/classes
-build.classes.excludes=**/*.java,**/*.form,**/*.c,**/*.cpp,**/*.hpp,**/*.h,**/*.a,**/*.o,**/Makefile,**/Makefile.bat
-# This directory is removed when the project is cleaned:
-build.dir=build
-build.generated.dir=${build.dir}/generated
-build.generated.sources.dir=${build.dir}/generated-sources
-# Only compile against the classpath explicitly listed here:
-build.sysclasspath=ignore
-build.test.classes.dir=${build.dir}/test/classes
-build.test.results.dir=${build.dir}/test/results
-# Uncomment to specify the preferred debugger connection transport:
-#debug.transport=dt_socket
-debug.classpath=\
- ${run.classpath}
-debug.test.classpath=\
- ${run.test.classpath}
-# Files in build.classes.dir which should be excluded from distribution jar
-dist.archive.excludes=**/*.java,**/*.form,**/*.c,**/*.cpp,**/*.hpp,**/*.h,**/*.a,**/*.o,**/Makefile,**/Makefile.bat
-# This directory is removed when the project is cleaned:
-dist.dir=dist
-dist.jar=${dist.dir}/ECTesterStandalone.jar
-dist.javadoc.dir=${dist.dir}/javadoc
-libs.CopyLibs.classpath=nbproject/copylibstask.jar
-endorsed.classpath=
-excludes=
-includes=**/common/**,**/standalone/**,**/data/**,**/applet/*
-jar.compress=true
-javac.classpath=\
- lib/bcprov-jdk18on-177.jar:\
- lib/wolfcrypt-jni.jar:\
- lib/jcardsim-3.0.5.11.jar:\
- lib/commons-cli-1.5.0.jar:\
- lib/snakeyaml-1.19.jar
-# Space-separated list of extra javac options
-javac.compilerargs=-Xlint:all --add-modules jdk.crypto.ec --add-exports jdk.crypto.ec/sun.security.ec=ALL-UNNAMED
-javac.deprecation=false
-javac.processorpath=\
- ${javac.classpath}
-javac.source=11
-javac.target=11
-javac.test.classpath=\
- ${javac.classpath}:\
- ${build.classes.dir}
-javac.test.processorpath=\
- ${javac.test.classpath}
-javadoc.additionalparam=
-javadoc.author=false
-javadoc.encoding=${source.encoding}
-javadoc.noindex=false
-javadoc.nonavbar=false
-javadoc.notree=false
-javadoc.private=false
-javadoc.splitindex=true
-javadoc.use=true
-javadoc.version=false
-javadoc.windowtitle=
-main.class=cz.crcs.ectester.standalone.ECTesterStandalone
-manifest.file=nbproject/standalone/manifest.mf
-meta.inf.dir=${src.dir}/META-INF
-mkdist.disabled=false
-platform.active=default_platform
-run.classpath=\
- ${javac.classpath}:\
- ${build.classes.dir}
-# Space-separated list of JVM arguments used when running the project.
-# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
-# To set system properties for unit tests define test-sys-prop.name=value:
-run.jvmargs=
-run.test.classpath=\
- ${javac.test.classpath}:\
- ${build.test.classes.dir}
-source.encoding=UTF-8
-src.dir=src
-test.src.dir=test
diff --git a/nbproject/standalone/project.xml b/nbproject/standalone/project.xml
deleted file mode 100644
index 2f2fb3f..0000000
--- a/nbproject/standalone/project.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://www.netbeans.org/ns/project/1">
- <type>org.netbeans.modules.java.j2seproject</type>
- <configuration>
- <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
- <name>ECTesterStandalone</name>
- <source-roots>
- <root id="src.dir"/>
- </source-roots>
- <test-roots>
- <root id="test.src.dir"/>
- </test-roots>
- </data>
- </configuration>
-</project>
diff --git a/reader/build.gradle.kts b/reader/build.gradle.kts
new file mode 100644
index 0000000..b0c5fea
--- /dev/null
+++ b/reader/build.gradle.kts
@@ -0,0 +1,38 @@
+plugins {
+ application
+}
+
+repositories {
+ mavenCentral()
+
+ // Repository with JCardSim, Globalplatform, etc, ...
+ maven("https://javacard.pro/maven")
+ maven("https://deadcode.me/mvn")
+}
+
+dependencies {
+ implementation(project(":common"))
+ implementation(project(":applet"))
+}
+
+application {
+ applicationName = "ECTesterReader"
+ mainClass = "cz.crcs.ectester.reader.ECTesterReader"
+ version = "0.3.3"
+}
+
+tasks.register<Jar>("uberJar") {
+ archiveFileName = "ECTesterReader.jar"
+ duplicatesStrategy = DuplicatesStrategy.WARN
+
+ from(sourceSets.main.get().output)
+
+ manifest {
+ attributes["Main-Class"] = application.mainClass
+ }
+
+ dependsOn(configurations.runtimeClasspath)
+ from({
+ configurations.runtimeClasspath.get().filter { it.name.endsWith("jar") }.map { zipTree(it).matching { exclude("META-INF/*.DSA", "META-INF/*.SF", "META-INF/*.RSA", "META-INF/versions/*/module-info.class") } }
+ })
+} \ No newline at end of file
diff --git a/src/cz/crcs/ectester/reader/CardMngr.java b/reader/src/main/java/cz/crcs/ectester/reader/CardMngr.java
index 0a01d9e..d8fa296 100644
--- a/src/cz/crcs/ectester/reader/CardMngr.java
+++ b/reader/src/main/java/cz/crcs/ectester/reader/CardMngr.java
@@ -2,6 +2,7 @@ package cz.crcs.ectester.reader;
import com.licel.jcardsim.io.JavaxSmartCardInterface;
import cz.crcs.ectester.common.util.ByteUtil;
+import cz.crcs.ectester.common.util.CardUtil;
import javacard.framework.AID;
import javacard.framework.Applet;
import javacard.framework.ISO7816;
@@ -206,10 +207,10 @@ public class CardMngr {
// Try CPLC via GP
ResponseAPDU resp = send(FETCH_GP_CPLC_APDU);
// If GP CLA fails, try with ISO
- if (resp.getSW() == (ISO7816.SW_CLA_NOT_SUPPORTED & 0xffff)) {
+ if (resp.getSW() == (CardUtil.ISO7816.SW_CLA_NOT_SUPPORTED & 0xffff)) {
resp = send(FETCH_ISO_CPLC_APDU);
}
- if (resp.getSW() == (ISO7816.SW_NO_ERROR & 0xffff)) {
+ if (resp.getSW() == (CardUtil.ISO7816.SW_NO_ERROR & 0xffff)) {
return resp.getData();
}
return null;
@@ -369,7 +370,7 @@ public class CardMngr {
} else {
resp = channel.transmit(cmd);
}
- if ((short) resp.getSW() != ISO7816.SW_NO_ERROR) {
+ if ((short) resp.getSW() != CardUtil.ISO7816.SW_NO_ERROR) {
throw new CardException("Chunking failed!");
}
}
diff --git a/src/cz/crcs/ectester/reader/ECTesterReader.java b/reader/src/main/java/cz/crcs/ectester/reader/ECTesterReader.java
index fdfb4cb..9ba9890 100644
--- a/src/cz/crcs/ectester/reader/ECTesterReader.java
+++ b/reader/src/main/java/cz/crcs/ectester/reader/ECTesterReader.java
@@ -24,13 +24,12 @@
package cz.crcs.ectester.reader;
import cz.crcs.ectester.applet.ECTesterApplet;
-import cz.crcs.ectester.applet.EC_Consts;
import cz.crcs.ectester.common.cli.CLITools;
import cz.crcs.ectester.common.cli.Colors;
import cz.crcs.ectester.common.ec.EC_Curve;
+import cz.crcs.ectester.common.ec.EC_Consts;
import cz.crcs.ectester.common.output.OutputLogger;
import cz.crcs.ectester.common.output.TestWriter;
-import cz.crcs.ectester.common.util.Util;
import cz.crcs.ectester.common.util.*;
import cz.crcs.ectester.data.EC_Store;
import cz.crcs.ectester.reader.command.Command;
@@ -38,8 +37,6 @@ import cz.crcs.ectester.reader.output.FileTestWriter;
import cz.crcs.ectester.reader.output.ResponseWriter;
import cz.crcs.ectester.reader.response.Response;
import cz.crcs.ectester.reader.test.*;
-import javacard.framework.ISO7816;
-import javacard.security.KeyPair;
import org.apache.commons.cli.*;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
@@ -55,9 +52,6 @@ import java.security.spec.ECParameterSpec;
import java.util.*;
import java.util.jar.Manifest;
-import static cz.crcs.ectester.applet.EC_Consts.KeyAgreement_ALG_EC_SVDP_DH;
-import static cz.crcs.ectester.applet.EC_Consts.Signature_ALG_ECDSA_SHA;
-
/**
* Reader part of ECTester, a tool for testing Elliptic curve support on javacards.
*
@@ -82,8 +76,9 @@ public class ECTesterReader {
private static final byte[] SELECT_PREFIX = {(byte) 0x00, (byte) 0xa4, (byte) 0x04, (byte) 0x00, (byte) 0x0c};
private static final byte[] AID_PREFIX = {(byte) 0x45, (byte) 0x43, (byte) 0x54, (byte) 0x65, (byte) 0x73, (byte) 0x74, (byte) 0x65, (byte) 0x72};
private static final byte[] AID_CURRENT_VERSION = {(byte) 0x30, (byte) 0x33, (byte) 0x33}; // VERSION v0.3.3
- private static final byte[] AID_SUFFIX_221 = {(byte) 0x62};
- private static final byte[] AID_SUFFIX_222 = {(byte) 0x78};
+ private static final byte[] AID_SUFFIX_221 = {(byte) 0x20, (byte) 0x32, (byte) 0x32, (byte) 0x31};
+ private static final byte[] AID_SUFFIX_222 = {(byte) 0x20, (byte) 0x32, (byte) 0x32, (byte) 0x32};
+ private static final byte[] AID_SUFFIX_305 = {(byte) 0x20, (byte) 0x33, (byte) 0x30, (byte) 0x35};
private static final byte[] INSTALL_DATA = new byte[10];
private static final int TRY_VERSIONS = 10;
@@ -153,13 +148,23 @@ public class ECTesterReader {
byte[] versionByte = AID_CURRENT_VERSION.clone();
boolean selected = false;
for (int i = 0; i < TRY_VERSIONS; ++i) {
- byte[] select222 = ByteUtil.concatenate(SELECT_PREFIX, AID_PREFIX, versionByte, AID_SUFFIX_222);
- ResponseAPDU selectResp = cardManager.send(select222);
- if ((short) selectResp.getSW() != ISO7816.SW_NO_ERROR) {
- byte[] select221 = ByteUtil.concatenate(SELECT_PREFIX, AID_PREFIX, versionByte, AID_SUFFIX_221);
- selectResp = cardManager.send(select221);
- if ((short) selectResp.getSW() == ISO7816.SW_NO_ERROR) {
- cardManager.setChunking(true);
+ // Try 301 CAP version
+ byte[] select301 = ByteUtil.concatenate(SELECT_PREFIX, AID_PREFIX, versionByte, AID_SUFFIX_305);
+ ResponseAPDU selectResp = cardManager.send(select301);
+ if ((short) selectResp.getSW() != CardUtil.ISO7816.SW_NO_ERROR) {
+ // Try 222 CAP version
+ byte[] select222 = ByteUtil.concatenate(SELECT_PREFIX, AID_PREFIX, versionByte, AID_SUFFIX_222);
+ selectResp = cardManager.send(select222);
+ if ((short) selectResp.getSW() != CardUtil.ISO7816.SW_NO_ERROR) {
+ // Try 221 CAP version
+ byte[] select221 = ByteUtil.concatenate(SELECT_PREFIX, AID_PREFIX, versionByte, AID_SUFFIX_221);
+ selectResp = cardManager.send(select221);
+ if ((short) selectResp.getSW() == CardUtil.ISO7816.SW_NO_ERROR) {
+ cardManager.setChunking(true);
+ selected = true;
+ break;
+ }
+ } else {
selected = true;
break;
}
@@ -378,7 +383,7 @@ public class ECTesterReader {
System.out.println(String.format("Card ATR:\t\t\t\t%s", ByteUtil.bytesToHex(cardManager.getATR().getBytes(), false)));
System.out.println(String.format("Card protocol:\t\t\t\t%s", cardManager.getProtocol()));
System.out.println(String.format("ECTester applet version:\t\t%s", info.getVersion()));
- System.out.println(String.format("ECTester applet APDU support:\t\t%s", (info.getBase() == ECTesterApplet.BASE_221) ? "basic" : "extended length"));
+ System.out.println(String.format("ECTester applet APDU support:\t\t%s", (info.getBase() == CardConsts.BASE_221) ? "basic" : "extended length"));
System.out.println(String.format("JavaCard API version:\t\t\t%.1f", info.getJavaCardVersion()));
System.out.println(String.format("JavaCard supports system cleanup:\t%s", info.getCleanupSupport()));
System.out.println(String.format("Array sizes (apduBuf,ram,ram2,apduArr):\t%d %d %d %d", info.getApduBufferLength(), info.getRamArrayLength(), info.getRamArray2Length(), info.getApduArrayLength()));
@@ -391,15 +396,15 @@ public class ECTesterReader {
* @throws IOException if an IO error occurs when writing to key file.
*/
private void export() throws CardException, IOException {
- byte keyClass = cfg.primeField ? KeyPair.ALG_EC_FP : KeyPair.ALG_EC_F2M;
+ byte keyClass = cfg.primeField ? EC_Consts.ALG_EC_FP : EC_Consts.ALG_EC_F2M;
List<Response> sent = new LinkedList<>();
- sent.add(new Command.Allocate(cardManager, ECTesterApplet.KEYPAIR_LOCAL, cfg.keyBuilder, cfg.bits, keyClass).send());
- //sent.add(new Command.Clear(cardManager, ECTesterApplet.KEYPAIR_LOCAL).send());
- sent.add(new Command.Generate(cardManager, ECTesterApplet.KEYPAIR_LOCAL).send());
+ sent.add(new Command.Allocate(cardManager, CardConsts.KEYPAIR_LOCAL, cfg.keyBuilder, cfg.bits, keyClass).send());
+ //sent.add(new Command.Clear(cardManager, CardConsts.KEYPAIR_LOCAL).send());
+ sent.add(new Command.Generate(cardManager, CardConsts.KEYPAIR_LOCAL).send());
// Also support exporting set parameters, to verify they are set correctly.
- Command curve = Command.prepareCurve(cardManager, cfg, ECTesterApplet.KEYPAIR_LOCAL, cfg.bits, keyClass);
+ Command curve = Command.prepareCurve(cardManager, cfg, CardConsts.KEYPAIR_LOCAL, cfg.bits, keyClass);
if (curve != null) {
sent.add(curve.send());
}
@@ -408,10 +413,10 @@ public class ECTesterReader {
// since its not necessary for ECDH, only ECDHC which not many cards implement
// TODO: check if its assumend to be == 1?
short domain = cfg.primeField ? EC_Consts.PARAMETERS_DOMAIN_FP : EC_Consts.PARAMETERS_DOMAIN_F2M;
- Response.Export export = new Command.Export(cardManager, ECTesterApplet.KEYPAIR_LOCAL, EC_Consts.KEY_PUBLIC, domain).send();
+ Response.Export export = new Command.Export(cardManager, CardConsts.KEYPAIR_LOCAL, EC_Consts.KEY_PUBLIC, domain).send();
if (!export.successful()) {
domain = (short) (domain ^ EC_Consts.PARAMETER_K);
- export = new Command.Export(cardManager, ECTesterApplet.KEYPAIR_LOCAL, EC_Consts.KEY_PUBLIC, domain).send();
+ export = new Command.Export(cardManager, CardConsts.KEYPAIR_LOCAL, EC_Consts.KEY_PUBLIC, domain).send();
}
sent.add(export);
@@ -441,10 +446,10 @@ public class ECTesterReader {
* @throws IOException if an IO error occurs when writing to key file.
*/
private void generate() throws CardException, IOException {
- byte keyClass = cfg.primeField ? KeyPair.ALG_EC_FP : KeyPair.ALG_EC_F2M;
- Command curve = Command.prepareCurve(cardManager, cfg, ECTesterApplet.KEYPAIR_LOCAL, cfg.bits, keyClass);
+ byte keyClass = cfg.primeField ? EC_Consts.ALG_EC_FP : EC_Consts.ALG_EC_F2M;
+ Command curve = Command.prepareCurve(cardManager, cfg, CardConsts.KEYPAIR_LOCAL, cfg.bits, keyClass);
- Response allocate = new Command.Allocate(cardManager, ECTesterApplet.KEYPAIR_LOCAL, cfg.keyBuilder, cfg.bits, keyClass).send();
+ Response allocate = new Command.Allocate(cardManager, CardConsts.KEYPAIR_LOCAL, cfg.keyBuilder, cfg.bits, keyClass).send();
respWriter.outputResponse(allocate);
OutputStreamWriter keysFile = FileUtil.openFiles(cfg.outputs);
@@ -458,7 +463,7 @@ public class ECTesterReader {
respWriter.outputResponse(fresh);
}
- Command.Generate generate = new Command.Generate(cardManager, ECTesterApplet.KEYPAIR_LOCAL);
+ Command.Generate generate = new Command.Generate(cardManager, CardConsts.KEYPAIR_LOCAL);
long time = 0;
if (cfg.time) {
time = -Command.dryRunTime(cardManager, generate, 2, respWriter);
@@ -467,7 +472,7 @@ public class ECTesterReader {
time += response.getDuration();
respWriter.outputResponse(response);
- Response.Export export = new Command.Export(cardManager, ECTesterApplet.KEYPAIR_LOCAL, EC_Consts.KEY_BOTH, EC_Consts.PARAMETERS_KEYPAIR).send();
+ Response.Export export = new Command.Export(cardManager, CardConsts.KEYPAIR_LOCAL, EC_Consts.KEY_BOTH, EC_Consts.PARAMETERS_KEYPAIR).send();
respWriter.outputResponse(export);
if (!response.successful() || !export.successful()) {
@@ -480,8 +485,8 @@ public class ECTesterReader {
}
}
- String pub = ByteUtil.bytesToHex(export.getParameter(ECTesterApplet.KEYPAIR_LOCAL, EC_Consts.PARAMETER_W), false);
- String priv = ByteUtil.bytesToHex(export.getParameter(ECTesterApplet.KEYPAIR_LOCAL, EC_Consts.PARAMETER_S), false);
+ String pub = ByteUtil.bytesToHex(export.getParameter(CardConsts.KEYPAIR_LOCAL, EC_Consts.PARAMETER_W), false);
+ String priv = ByteUtil.bytesToHex(export.getParameter(CardConsts.KEYPAIR_LOCAL, EC_Consts.PARAMETER_S), false);
String line = String.format("%d;%d;%d;%s;%s\n", generated, Util.convertTime(time, cfg.timeUnit), Util.convertTime(export.getDuration(), cfg.timeUnit), pub, priv);
keysFile.write(line);
keysFile.flush();
@@ -573,11 +578,11 @@ public class ECTesterReader {
* @throws IOException if an IO error occurs when writing to key file.
*/
private void ecdh() throws IOException, CardException {
- byte keyClass = cfg.primeField ? KeyPair.ALG_EC_FP : KeyPair.ALG_EC_F2M;
- Command curve = Command.prepareCurve(cardManager, cfg, ECTesterApplet.KEYPAIR_BOTH, cfg.bits, keyClass);
+ byte keyClass = cfg.primeField ? EC_Consts.ALG_EC_FP : EC_Consts.ALG_EC_F2M;
+ Command curve = Command.prepareCurve(cardManager, cfg, CardConsts.KEYPAIR_BOTH, cfg.bits, keyClass);
List<Response> prepare = new LinkedList<>();
prepare.add(new Command.AllocateKeyAgreement(cardManager, cfg.ECKAType).send()); // Prepare KeyAgreement or required type
- prepare.add(new Command.Allocate(cardManager, ECTesterApplet.KEYPAIR_BOTH, cfg.keyBuilder, cfg.bits, keyClass).send());
+ prepare.add(new Command.Allocate(cardManager, CardConsts.KEYPAIR_BOTH, cfg.keyBuilder, cfg.bits, keyClass).send());
if (curve != null)
prepare.add(curve.send());
@@ -591,23 +596,23 @@ public class ECTesterReader {
out.write(String.format("index;time[%s];pubW;privS;secret[%s]\n", cfg.timeUnit, CardUtil.getKexHashName(cfg.ECKAType)));
}
- Response gen = new Command.Generate(cardManager, ECTesterApplet.KEYPAIR_BOTH).send();
+ Response gen = new Command.Generate(cardManager, CardConsts.KEYPAIR_BOTH).send();
respWriter.outputResponse(gen);
if (cfg.anyPublicKey || cfg.anyKey) {
- Response prep = Command.prepareKey(cardManager, EC_Store.getInstance(), cfg, ECTesterApplet.KEYPAIR_REMOTE, EC_Consts.PARAMETER_W).send();
+ Response prep = Command.prepareKey(cardManager, EC_Store.getInstance(), cfg, CardConsts.KEYPAIR_REMOTE, EC_Consts.PARAMETER_W).send();
respWriter.outputResponse(prep);
}
if (cfg.anyPrivateKey || cfg.anyKey) {
- Response prep = Command.prepareKey(cardManager, EC_Store.getInstance(), cfg, ECTesterApplet.KEYPAIR_LOCAL, EC_Consts.PARAMETER_S).send();
+ Response prep = Command.prepareKey(cardManager, EC_Store.getInstance(), cfg, CardConsts.KEYPAIR_LOCAL, EC_Consts.PARAMETER_S).send();
respWriter.outputResponse(prep);
}
- byte kp = ECTesterApplet.KEYPAIR_BOTH;
+ byte kp = CardConsts.KEYPAIR_BOTH;
if (cfg.fixedPrivate || cfg.anyPrivateKey) {
- kp ^= ECTesterApplet.KEYPAIR_LOCAL;
+ kp ^= CardConsts.KEYPAIR_LOCAL;
}
if (cfg.fixedPublic || cfg.anyPublicKey) {
- kp ^= ECTesterApplet.KEYPAIR_REMOTE;
+ kp ^= CardConsts.KEYPAIR_REMOTE;
}
if (cfg.fixedKey || cfg.anyKey) {
kp = 0;
@@ -626,14 +631,14 @@ public class ECTesterReader {
respWriter.outputResponse(regen);
}
- Response.Export exportRemote = new Command.Export(cardManager, ECTesterApplet.KEYPAIR_REMOTE, EC_Consts.KEY_PUBLIC, EC_Consts.PARAMETER_W).send();
+ Response.Export exportRemote = new Command.Export(cardManager, CardConsts.KEYPAIR_REMOTE, EC_Consts.KEY_PUBLIC, EC_Consts.PARAMETER_W).send();
respWriter.outputResponse(exportRemote);
- Response.Export exportLocal = new Command.Export(cardManager, ECTesterApplet.KEYPAIR_LOCAL, EC_Consts.KEY_PRIVATE, EC_Consts.PARAMETER_S).send();
+ Response.Export exportLocal = new Command.Export(cardManager, CardConsts.KEYPAIR_LOCAL, EC_Consts.KEY_PRIVATE, EC_Consts.PARAMETER_S).send();
respWriter.outputResponse(exportLocal);
- byte[] pubkey_bytes = exportRemote.getParameter(ECTesterApplet.KEYPAIR_REMOTE, EC_Consts.PARAMETER_W);
- byte[] privkey_bytes = exportLocal.getParameter(ECTesterApplet.KEYPAIR_LOCAL, EC_Consts.PARAMETER_S);
+ byte[] pubkey_bytes = exportRemote.getParameter(CardConsts.KEYPAIR_REMOTE, EC_Consts.PARAMETER_W);
+ byte[] privkey_bytes = exportLocal.getParameter(CardConsts.KEYPAIR_LOCAL, EC_Consts.PARAMETER_S);
- Command.ECDH perform = new Command.ECDH(cardManager, ECTesterApplet.KEYPAIR_REMOTE, ECTesterApplet.KEYPAIR_LOCAL, ECTesterApplet.EXPORT_TRUE, EC_Consts.TRANSFORMATION_NONE, cfg.ECKAType);
+ Command.ECDH perform = new Command.ECDH(cardManager, CardConsts.KEYPAIR_REMOTE, CardConsts.KEYPAIR_LOCAL, CardConsts.EXPORT_TRUE, EC_Consts.TRANSFORMATION_NONE, cfg.ECKAType);
long time = 0;
if (cfg.time) {
@@ -695,16 +700,16 @@ public class ECTesterReader {
Command generate;
if (cfg.anyKeypart) {
- generate = Command.prepareKey(cardManager, EC_Store.getInstance(), cfg, ECTesterApplet.KEYPAIR_LOCAL, EC_Consts.PARAMETERS_KEYPAIR);
+ generate = Command.prepareKey(cardManager, EC_Store.getInstance(), cfg, CardConsts.KEYPAIR_LOCAL, EC_Consts.PARAMETERS_KEYPAIR);
} else {
- generate = new Command.Generate(cardManager, ECTesterApplet.KEYPAIR_LOCAL);
+ generate = new Command.Generate(cardManager, CardConsts.KEYPAIR_LOCAL);
}
- byte keyClass = cfg.primeField ? KeyPair.ALG_EC_FP : KeyPair.ALG_EC_F2M;
+ byte keyClass = cfg.primeField ? EC_Consts.ALG_EC_FP : EC_Consts.ALG_EC_F2M;
List<Response> prepare = new LinkedList<>();
prepare.add(new Command.AllocateSignature(cardManager, cfg.ECDSAType).send());
- prepare.add(new Command.Allocate(cardManager, ECTesterApplet.KEYPAIR_LOCAL, cfg.keyBuilder, cfg.bits, keyClass).send());
- Command curve = Command.prepareCurve(cardManager, cfg, ECTesterApplet.KEYPAIR_LOCAL, cfg.bits, keyClass);
+ prepare.add(new Command.Allocate(cardManager, CardConsts.KEYPAIR_LOCAL, cfg.keyBuilder, cfg.bits, keyClass).send());
+ Command curve = Command.prepareCurve(cardManager, cfg, CardConsts.KEYPAIR_LOCAL, cfg.bits, keyClass);
if (curve != null)
prepare.add(curve.send());
@@ -717,7 +722,7 @@ public class ECTesterReader {
out.write(String.format("index;signTime[%s];verifyTime[%s];data;pubW;privS;signature[%s];nonce;valid\n", cfg.timeUnit, cfg.timeUnit, CardUtil.getSigHashAlgo(cfg.ECDSAType)));
}
- Command.Export export = new Command.Export(cardManager, ECTesterApplet.KEYPAIR_LOCAL, EC_Consts.KEY_BOTH, EC_Consts.PARAMETERS_KEYPAIR);
+ Command.Export export = new Command.Export(cardManager, CardConsts.KEYPAIR_LOCAL, EC_Consts.KEY_BOTH, EC_Consts.PARAMETERS_KEYPAIR);
Response.Export exported = null;
if (cfg.fixedKey) {
respWriter.outputResponse(generate.send());
@@ -734,7 +739,7 @@ public class ECTesterReader {
respWriter.outputResponse(exported);
}
- Command.ECDSA_sign sign = new Command.ECDSA_sign(cardManager, ECTesterApplet.KEYPAIR_LOCAL, cfg.ECDSAType, ECTesterApplet.EXPORT_TRUE, data);
+ Command.ECDSA_sign sign = new Command.ECDSA_sign(cardManager, CardConsts.KEYPAIR_LOCAL, cfg.ECDSAType, CardConsts.EXPORT_TRUE, data);
long signTime = 0;
if (cfg.time) {
@@ -754,7 +759,7 @@ public class ECTesterReader {
}
}
byte[] signature = signResp.getSignature();
- Command.ECDSA_verify verify = new Command.ECDSA_verify(cardManager, ECTesterApplet.KEYPAIR_LOCAL, cfg.ECDSAType, data, signature);
+ Command.ECDSA_verify verify = new Command.ECDSA_verify(cardManager, CardConsts.KEYPAIR_LOCAL, cfg.ECDSAType, data, signature);
long verifyTime = 0;
if (cfg.time) {
verifyTime = -Command.dryRunTime(cardManager, verify, 2, respWriter);
@@ -774,10 +779,10 @@ public class ECTesterReader {
}
if (out != null) {
- String pub = ByteUtil.bytesToHex(exported.getParameter(ECTesterApplet.KEYPAIR_LOCAL, EC_Consts.PARAMETER_W), false);
- String priv = ByteUtil.bytesToHex(exported.getParameter(ECTesterApplet.KEYPAIR_LOCAL, EC_Consts.PARAMETER_S), false);
+ String pub = ByteUtil.bytesToHex(exported.getParameter(CardConsts.KEYPAIR_LOCAL, EC_Consts.PARAMETER_W), false);
+ String priv = ByteUtil.bytesToHex(exported.getParameter(CardConsts.KEYPAIR_LOCAL, EC_Consts.PARAMETER_S), false);
String dataString = (cfg.input != null) ? "" : ByteUtil.bytesToHex(data, false);
- BigInteger privkey = new BigInteger(1, exported.getParameter(ECTesterApplet.KEYPAIR_LOCAL, EC_Consts.PARAMETER_S));
+ BigInteger privkey = new BigInteger(1, exported.getParameter(CardConsts.KEYPAIR_LOCAL, EC_Consts.PARAMETER_S));
EC_Curve actualCurve = Command.findCurve(cfg, cfg.bits, keyClass);
String k = "";
if (actualCurve != null) {
@@ -858,9 +863,9 @@ public class ECTesterReader {
public int testTo;
public int generateAmount;
public int ECKACount;
- public byte ECKAType = KeyAgreement_ALG_EC_SVDP_DH;
+ public byte ECKAType = EC_Consts.KeyAgreement_ALG_EC_SVDP_DH;
public int ECDSACount;
- public byte ECDSAType = Signature_ALG_ECDSA_SHA;
+ public byte ECDSAType = EC_Consts.Signature_ALG_ECDSA_SHA;
public Set<String> testOptions;
/**
@@ -895,7 +900,7 @@ public class ECTesterReader {
fixedKey = cli.hasOption("fixed");
fixedPrivate = cli.hasOption("fixed-private");
fixedPublic = cli.hasOption("fixed-public");
- keyBuilder = cli.hasOption("key-builder") ? ECTesterApplet.BUILD_KEYBUILDER : ECTesterApplet.BUILD_KEYPAIR;
+ keyBuilder = cli.hasOption("key-builder") ? CardConsts.BUILD_KEYBUILDER : CardConsts.BUILD_KEYPAIR;
if (cli.hasOption("log")) {
log = cli.getOptionValue("log", String.format("ECTESTER_log_%d.log", System.currentTimeMillis() / 1000));
diff --git a/src/cz/crcs/ectester/reader/ISO7816_status_words.txt b/reader/src/main/java/cz/crcs/ectester/reader/ISO7816_status_words.txt
index bf5af2b..bf5af2b 100644
--- a/src/cz/crcs/ectester/reader/ISO7816_status_words.txt
+++ b/reader/src/main/java/cz/crcs/ectester/reader/ISO7816_status_words.txt
diff --git a/src/cz/crcs/ectester/reader/command/Command.java b/reader/src/main/java/cz/crcs/ectester/reader/command/Command.java
index 61e3900..892a481 100644
--- a/src/cz/crcs/ectester/reader/command/Command.java
+++ b/reader/src/main/java/cz/crcs/ectester/reader/command/Command.java
@@ -1,18 +1,17 @@
package cz.crcs.ectester.reader.command;
-import cz.crcs.ectester.applet.ECTesterApplet;
-import cz.crcs.ectester.applet.EC_Consts;
import cz.crcs.ectester.common.ec.EC_Curve;
import cz.crcs.ectester.common.ec.EC_Params;
+import cz.crcs.ectester.common.ec.EC_Consts;
import cz.crcs.ectester.common.util.ByteUtil;
import cz.crcs.ectester.common.util.CardUtil;
import cz.crcs.ectester.common.util.ECUtil;
+import cz.crcs.ectester.common.util.CardConsts;
import cz.crcs.ectester.data.EC_Store;
import cz.crcs.ectester.reader.CardMngr;
import cz.crcs.ectester.reader.ECTesterReader;
import cz.crcs.ectester.reader.output.ResponseWriter;
import cz.crcs.ectester.reader.response.Response;
-import javacard.security.KeyPair;
import javax.smartcardio.CardException;
import javax.smartcardio.CommandAPDU;
@@ -98,7 +97,7 @@ public abstract class Command implements Cloneable {
public static Command prepareCurve(CardMngr cardManager, ECTesterReader.Config cfg, byte keyPair, short keyLength, byte keyClass) throws IOException {
if (cfg.customCurve) {
// Set custom curve (one of the SECG curves embedded applet-side)
- short domainParams = keyClass == KeyPair.ALG_EC_FP ? EC_Consts.PARAMETERS_DOMAIN_FP : EC_Consts.PARAMETERS_DOMAIN_F2M;
+ short domainParams = keyClass == EC_Consts.ALG_EC_FP ? EC_Consts.PARAMETERS_DOMAIN_FP : EC_Consts.PARAMETERS_DOMAIN_F2M;
return new Command.Set(cardManager, keyPair, EC_Consts.getCurve(keyLength, keyClass), domainParams, null);
}
@@ -173,14 +172,14 @@ public abstract class Command implements Cloneable {
public static long dryRunTime(CardMngr cardManager, Command cmd, int num, ResponseWriter respWriter) throws CardException {
long time = 0;
- respWriter.outputResponse(new Command.SetDryRunMode(cardManager, ECTesterApplet.MODE_DRY_RUN).send());
+ respWriter.outputResponse(new Command.SetDryRunMode(cardManager, CardConsts.MODE_DRY_RUN).send());
for (int i = 0; i < num; ++i) {
Response dry = cmd.send();
respWriter.outputResponse(dry);
time += dry.getDuration();
}
time /= num;
- respWriter.outputResponse(new Command.SetDryRunMode(cardManager, ECTesterApplet.MODE_NORMAL).send());
+ respWriter.outputResponse(new Command.SetDryRunMode(cardManager, CardConsts.MODE_NORMAL).send());
return time;
}
@@ -200,7 +199,7 @@ public abstract class Command implements Cloneable {
super(cardManager);
this.kaType = kaType;
byte[] data = new byte[]{kaType};
- this.cmd = new CommandAPDU(ECTesterApplet.CLA_ECTESTERAPPLET, ECTesterApplet.INS_ALLOCATE_KA, 0x00, 0x00, data);
+ this.cmd = new CommandAPDU(CardConsts.CLA_ECTESTERAPPLET, CardConsts.INS_ALLOCATE_KA, 0x00, 0x00, data);
}
@Override
@@ -233,7 +232,7 @@ public abstract class Command implements Cloneable {
super(cardManager);
this.sigType = sigType;
byte[] data = new byte[]{sigType};
- this.cmd = new CommandAPDU(ECTesterApplet.CLA_ECTESTERAPPLET, ECTesterApplet.INS_ALLOCATE_SIG, 0x00, 0x00, data);
+ this.cmd = new CommandAPDU(CardConsts.CLA_ECTESTERAPPLET, CardConsts.INS_ALLOCATE_SIG, 0x00, 0x00, data);
}
@Override
@@ -277,11 +276,11 @@ public abstract class Command implements Cloneable {
byte[] data = new byte[]{0, 0, keyClass};
ByteUtil.setShort(data, 0, keyLength);
- this.cmd = new CommandAPDU(ECTesterApplet.CLA_ECTESTERAPPLET, ECTesterApplet.INS_ALLOCATE, keyPair, build, data);
+ this.cmd = new CommandAPDU(CardConsts.CLA_ECTESTERAPPLET, CardConsts.INS_ALLOCATE, keyPair, build, data);
}
public Allocate(CardMngr cardManager, byte keyPair, short keyLength, byte keyClass) {
- this(cardManager, keyPair, (byte) (ECTesterApplet.BUILD_KEYPAIR | ECTesterApplet.BUILD_KEYBUILDER), keyLength, keyClass);
+ this(cardManager, keyPair, (byte) (CardConsts.BUILD_KEYPAIR | CardConsts.BUILD_KEYBUILDER), keyLength, keyClass);
}
@Override
@@ -294,12 +293,12 @@ public abstract class Command implements Cloneable {
@Override
public String getDescription() {
- String field = keyClass == KeyPair.ALG_EC_FP ? "ALG_EC_FP" : "ALG_EC_F2M";
+ String field = keyClass == EC_Consts.ALG_EC_FP ? "ALG_EC_FP" : "ALG_EC_F2M";
String key;
- if (keyPair == ECTesterApplet.KEYPAIR_BOTH) {
+ if (keyPair == CardConsts.KEYPAIR_BOTH) {
key = "both keypairs";
} else {
- key = ((keyPair == ECTesterApplet.KEYPAIR_LOCAL) ? "local" : "remote") + " keypair";
+ key = ((keyPair == CardConsts.KEYPAIR_LOCAL) ? "local" : "remote") + " keypair";
}
return String.format("Allocate %s %db %s", key, keyLength, field);
}
@@ -319,7 +318,7 @@ public abstract class Command implements Cloneable {
super(cardManager);
this.keyPair = keyPair;
- this.cmd = new CommandAPDU(ECTesterApplet.CLA_ECTESTERAPPLET, ECTesterApplet.INS_CLEAR, keyPair, 0x00, GOD_DAMN_JAVA_BUG_6474858_AND_GOD_DAMN_JAVA_12_MODULE_SYSTEM);
+ this.cmd = new CommandAPDU(CardConsts.CLA_ECTESTERAPPLET, CardConsts.INS_CLEAR, keyPair, 0x00, GOD_DAMN_JAVA_BUG_6474858_AND_GOD_DAMN_JAVA_12_MODULE_SYSTEM);
}
@Override
@@ -333,10 +332,10 @@ public abstract class Command implements Cloneable {
@Override
public String getDescription() {
String key;
- if (keyPair == ECTesterApplet.KEYPAIR_BOTH) {
+ if (keyPair == CardConsts.KEYPAIR_BOTH) {
key = "both keypairs";
} else {
- key = ((keyPair == ECTesterApplet.KEYPAIR_LOCAL) ? "local" : "remote") + " keypair";
+ key = ((keyPair == CardConsts.KEYPAIR_LOCAL) ? "local" : "remote") + " keypair";
}
return String.format("Clear %s", key);
}
@@ -374,7 +373,7 @@ public abstract class Command implements Cloneable {
System.arraycopy(external, 0, data, 2, external.length);
}
- this.cmd = new CommandAPDU(ECTesterApplet.CLA_ECTESTERAPPLET, ECTesterApplet.INS_SET, keyPair, curve, data);
+ this.cmd = new CommandAPDU(CardConsts.CLA_ECTESTERAPPLET, CardConsts.INS_SET, keyPair, curve, data);
}
@Override
@@ -391,10 +390,10 @@ public abstract class Command implements Cloneable {
String what = CardUtil.getParameterString(params);
String pair;
- if (keyPair == ECTesterApplet.KEYPAIR_BOTH) {
+ if (keyPair == CardConsts.KEYPAIR_BOTH) {
pair = "both keypairs";
} else {
- pair = ((keyPair == ECTesterApplet.KEYPAIR_LOCAL) ? "local" : "remote") + " keypair";
+ pair = ((keyPair == CardConsts.KEYPAIR_LOCAL) ? "local" : "remote") + " keypair";
}
return String.format("Set %s %s parameters on %s", name, what, pair);
}
@@ -427,7 +426,7 @@ public abstract class Command implements Cloneable {
ByteUtil.setShort(data, 0, params);
ByteUtil.setShort(data, 2, transformation);
- this.cmd = new CommandAPDU(ECTesterApplet.CLA_ECTESTERAPPLET, ECTesterApplet.INS_TRANSFORM, keyPair, key, data);
+ this.cmd = new CommandAPDU(CardConsts.CLA_ECTESTERAPPLET, CardConsts.INS_TRANSFORM, keyPair, key, data);
}
@Override
@@ -444,10 +443,10 @@ public abstract class Command implements Cloneable {
String transform = CardUtil.getTransformation(transformation);
String pair;
- if (keyPair == ECTesterApplet.KEYPAIR_BOTH) {
+ if (keyPair == CardConsts.KEYPAIR_BOTH) {
pair = "both keypairs";
} else {
- pair = ((keyPair == ECTesterApplet.KEYPAIR_LOCAL) ? "local" : "remote") + " keypair";
+ pair = ((keyPair == CardConsts.KEYPAIR_LOCAL) ? "local" : "remote") + " keypair";
}
return String.format("Transform params %s of %s, %s", stringParams, pair, transform);
}
@@ -469,7 +468,7 @@ public abstract class Command implements Cloneable {
super(cardManager);
this.keyPair = keyPair;
- this.cmd = new CommandAPDU(ECTesterApplet.CLA_ECTESTERAPPLET, ECTesterApplet.INS_GENERATE, keyPair, 0, GOD_DAMN_JAVA_BUG_6474858_AND_GOD_DAMN_JAVA_12_MODULE_SYSTEM);
+ this.cmd = new CommandAPDU(CardConsts.CLA_ECTESTERAPPLET, CardConsts.INS_GENERATE, keyPair, 0, GOD_DAMN_JAVA_BUG_6474858_AND_GOD_DAMN_JAVA_12_MODULE_SYSTEM);
}
@Override
@@ -483,10 +482,10 @@ public abstract class Command implements Cloneable {
@Override
public String getDescription() {
String key;
- if (keyPair == ECTesterApplet.KEYPAIR_BOTH) {
+ if (keyPair == CardConsts.KEYPAIR_BOTH) {
key = "both keypairs";
} else {
- key = ((keyPair == ECTesterApplet.KEYPAIR_LOCAL) ? "local" : "remote") + " keypair";
+ key = ((keyPair == CardConsts.KEYPAIR_LOCAL) ? "local" : "remote") + " keypair";
}
return String.format("Generate %s", key);
}
@@ -517,7 +516,7 @@ public abstract class Command implements Cloneable {
byte[] data = new byte[2];
ByteUtil.setShort(data, 0, params);
- this.cmd = new CommandAPDU(ECTesterApplet.CLA_ECTESTERAPPLET, ECTesterApplet.INS_EXPORT, keyPair, key, data);
+ this.cmd = new CommandAPDU(CardConsts.CLA_ECTESTERAPPLET, CardConsts.INS_EXPORT, keyPair, key, data);
}
@Override
@@ -539,10 +538,10 @@ public abstract class Command implements Cloneable {
source = ((key == EC_Consts.KEY_PUBLIC) ? "public" : "private") + " key";
}
String pair;
- if (keyPair == ECTesterApplet.KEYPAIR_BOTH) {
+ if (keyPair == CardConsts.KEYPAIR_BOTH) {
pair = "both keypairs";
} else {
- pair = ((keyPair == ECTesterApplet.KEYPAIR_LOCAL) ? "local" : "remote") + " keypair";
+ pair = ((keyPair == CardConsts.KEYPAIR_LOCAL) ? "local" : "remote") + " keypair";
}
return String.format("Export %s params from %s of %s", what, source, pair);
}
@@ -579,7 +578,7 @@ public abstract class Command implements Cloneable {
byte[] data = new byte[]{export, 0, 0, type};
ByteUtil.setShort(data, 1, transformation);
- this.cmd = new CommandAPDU(ECTesterApplet.CLA_ECTESTERAPPLET, ECTesterApplet.INS_ECDH, pubkey, privkey, data);
+ this.cmd = new CommandAPDU(CardConsts.CLA_ECTESTERAPPLET, CardConsts.INS_ECDH, pubkey, privkey, data);
}
@Override
@@ -594,8 +593,8 @@ public abstract class Command implements Cloneable {
public String getDescription() {
String algo = CardUtil.getKATypeString(type);
- String pub = pubkey == ECTesterApplet.KEYPAIR_LOCAL ? "local" : "remote";
- String priv = privkey == ECTesterApplet.KEYPAIR_LOCAL ? "local" : "remote";
+ String pub = pubkey == CardConsts.KEYPAIR_LOCAL ? "local" : "remote";
+ String priv = privkey == CardConsts.KEYPAIR_LOCAL ? "local" : "remote";
String validity;
if (transformation == EC_Consts.TRANSFORMATION_NONE) {
@@ -640,7 +639,7 @@ public abstract class Command implements Cloneable {
data[2] = type;
System.arraycopy(pubkey, 0, data, 3, pubkey.length);
- this.cmd = new CommandAPDU(ECTesterApplet.CLA_ECTESTERAPPLET, ECTesterApplet.INS_ECDH_DIRECT, privkey, export, data);
+ this.cmd = new CommandAPDU(CardConsts.CLA_ECTESTERAPPLET, CardConsts.INS_ECDH_DIRECT, privkey, export, data);
}
@Override
@@ -648,14 +647,14 @@ public abstract class Command implements Cloneable {
long elapsed = -System.nanoTime();
ResponseAPDU response = cardManager.send(cmd);
elapsed += System.nanoTime();
- return new Response.ECDH(response, getDescription(), elapsed, ECTesterApplet.KEYPAIR_REMOTE, privkey, export, transformation, type);
+ return new Response.ECDH(response, getDescription(), elapsed, CardConsts.KEYPAIR_REMOTE, privkey, export, transformation, type);
}
@Override
public String getDescription() {
String algo = CardUtil.getKATypeString(type);
- String priv = privkey == ECTesterApplet.KEYPAIR_LOCAL ? "local" : "remote";
+ String priv = privkey == CardConsts.KEYPAIR_LOCAL ? "local" : "remote";
String validity;
if (transformation == EC_Consts.TRANSFORMATION_NONE) {
@@ -684,7 +683,7 @@ public abstract class Command implements Cloneable {
*/
public ECDSA(CardMngr cardManager, byte keyPair, byte sigType, byte export, byte[] raw) {
super(cardManager);
- if (keyPair == ECTesterApplet.KEYPAIR_BOTH) {
+ if (keyPair == CardConsts.KEYPAIR_BOTH) {
throw new IllegalArgumentException();
}
@@ -701,7 +700,7 @@ public abstract class Command implements Cloneable {
System.arraycopy(raw, 0, data, 3, len);
}
- this.cmd = new CommandAPDU(ECTesterApplet.CLA_ECTESTERAPPLET, ECTesterApplet.INS_ECDSA, keyPair, export, data);
+ this.cmd = new CommandAPDU(CardConsts.CLA_ECTESTERAPPLET, CardConsts.INS_ECDSA, keyPair, export, data);
}
@Override
@@ -715,7 +714,7 @@ public abstract class Command implements Cloneable {
@Override
public String getDescription() {
String algo = CardUtil.getSigTypeString(sigType);
- String key = keyPair == ECTesterApplet.KEYPAIR_LOCAL ? "local" : "remote";
+ String key = keyPair == CardConsts.KEYPAIR_LOCAL ? "local" : "remote";
String data = raw == null ? "random" : "provided";
return String.format("%s with %s keypair(%s data)", algo, key, data);
}
@@ -738,7 +737,7 @@ public abstract class Command implements Cloneable {
*/
public ECDSA_sign(CardMngr cardManager, byte keyPair, byte sigType, byte export, byte[] raw) {
super(cardManager);
- if (keyPair == ECTesterApplet.KEYPAIR_BOTH) {
+ if (keyPair == CardConsts.KEYPAIR_BOTH) {
throw new IllegalArgumentException();
}
@@ -755,7 +754,7 @@ public abstract class Command implements Cloneable {
System.arraycopy(raw, 0, data, 3, len);
}
- this.cmd = new CommandAPDU(ECTesterApplet.CLA_ECTESTERAPPLET, ECTesterApplet.INS_ECDSA_SIGN, keyPair, export, data);
+ this.cmd = new CommandAPDU(CardConsts.CLA_ECTESTERAPPLET, CardConsts.INS_ECDSA_SIGN, keyPair, export, data);
}
@Override
@@ -769,7 +768,7 @@ public abstract class Command implements Cloneable {
@Override
public String getDescription() {
String algo = CardUtil.getSigTypeString(sigType);
- String key = keyPair == ECTesterApplet.KEYPAIR_LOCAL ? "local" : "remote";
+ String key = keyPair == CardConsts.KEYPAIR_LOCAL ? "local" : "remote";
String data = raw == null ? "random" : "provided";
return String.format("%s signature with %s keypair(%s data)", algo, key, data);
}
@@ -792,7 +791,7 @@ public abstract class Command implements Cloneable {
*/
public ECDSA_verify(CardMngr cardManager, byte keyPair, byte sigType, byte[] raw, byte[] signature) {
super(cardManager);
- if (keyPair == ECTesterApplet.KEYPAIR_BOTH) {
+ if (keyPair == CardConsts.KEYPAIR_BOTH) {
throw new IllegalArgumentException();
}
if (raw == null || signature == null) {
@@ -810,7 +809,7 @@ public abstract class Command implements Cloneable {
ByteUtil.setShort(data, 2 + raw.length, (short) signature.length);
System.arraycopy(signature, 0, data, 2 + raw.length + 2, signature.length);
- this.cmd = new CommandAPDU(ECTesterApplet.CLA_ECTESTERAPPLET, ECTesterApplet.INS_ECDSA_VERIFY, keyPair, sigType, data);
+ this.cmd = new CommandAPDU(CardConsts.CLA_ECTESTERAPPLET, CardConsts.INS_ECDSA_VERIFY, keyPair, sigType, data);
}
@Override
@@ -818,13 +817,13 @@ public abstract class Command implements Cloneable {
long elapsed = -System.nanoTime();
ResponseAPDU response = cardManager.send(cmd);
elapsed += System.nanoTime();
- return new Response.ECDSA(response, getDescription(), elapsed, keyPair, sigType, ECTesterApplet.EXPORT_FALSE, raw);
+ return new Response.ECDSA(response, getDescription(), elapsed, keyPair, sigType, CardConsts.EXPORT_FALSE, raw);
}
@Override
public String getDescription() {
String algo = CardUtil.getSigTypeString(sigType);
- String key = keyPair == ECTesterApplet.KEYPAIR_LOCAL ? "local" : "remote";
+ String key = keyPair == CardConsts.KEYPAIR_LOCAL ? "local" : "remote";
String data = raw == null ? "random" : "provided";
return String.format("%s verification with %s keypair(%s data)", algo, key, data);
}
@@ -841,7 +840,7 @@ public abstract class Command implements Cloneable {
public Cleanup(CardMngr cardManager) {
super(cardManager);
- this.cmd = new CommandAPDU(ECTesterApplet.CLA_ECTESTERAPPLET, ECTesterApplet.INS_CLEANUP, 0, 0, GOD_DAMN_JAVA_BUG_6474858_AND_GOD_DAMN_JAVA_12_MODULE_SYSTEM);
+ this.cmd = new CommandAPDU(CardConsts.CLA_ECTESTERAPPLET, CardConsts.INS_CLEANUP, 0, 0, GOD_DAMN_JAVA_BUG_6474858_AND_GOD_DAMN_JAVA_12_MODULE_SYSTEM);
}
@Override
@@ -869,7 +868,7 @@ public abstract class Command implements Cloneable {
public GetInfo(CardMngr cardManager) {
super(cardManager);
- this.cmd = new CommandAPDU(ECTesterApplet.CLA_ECTESTERAPPLET, ECTesterApplet.INS_GET_INFO, 0, 0, GOD_DAMN_JAVA_BUG_6474858_AND_GOD_DAMN_JAVA_12_MODULE_SYSTEM);
+ this.cmd = new CommandAPDU(CardConsts.CLA_ECTESTERAPPLET, CardConsts.INS_GET_INFO, 0, 0, GOD_DAMN_JAVA_BUG_6474858_AND_GOD_DAMN_JAVA_12_MODULE_SYSTEM);
}
@Override
@@ -900,7 +899,7 @@ public abstract class Command implements Cloneable {
super(cardManager);
this.dryRunMode = dryRunMode;
- this.cmd = new CommandAPDU(ECTesterApplet.CLA_ECTESTERAPPLET, ECTesterApplet.INS_SET_DRY_RUN_MODE, dryRunMode, 0, GOD_DAMN_JAVA_BUG_6474858_AND_GOD_DAMN_JAVA_12_MODULE_SYSTEM);
+ this.cmd = new CommandAPDU(CardConsts.CLA_ECTESTERAPPLET, CardConsts.INS_SET_DRY_RUN_MODE, dryRunMode, 0, GOD_DAMN_JAVA_BUG_6474858_AND_GOD_DAMN_JAVA_12_MODULE_SYSTEM);
}
@Override
@@ -913,7 +912,7 @@ public abstract class Command implements Cloneable {
@Override
public String getDescription() {
- return (dryRunMode == ECTesterApplet.MODE_NORMAL ? "Disable" : "Enable") + " dry run mode";
+ return (dryRunMode == CardConsts.MODE_NORMAL ? "Disable" : "Enable") + " dry run mode";
}
}
}
diff --git a/src/cz/crcs/ectester/reader/output/FileTestWriter.java b/reader/src/main/java/cz/crcs/ectester/reader/output/FileTestWriter.java
index 69e5f41..69e5f41 100644
--- a/src/cz/crcs/ectester/reader/output/FileTestWriter.java
+++ b/reader/src/main/java/cz/crcs/ectester/reader/output/FileTestWriter.java
diff --git a/src/cz/crcs/ectester/reader/output/ResponseWriter.java b/reader/src/main/java/cz/crcs/ectester/reader/output/ResponseWriter.java
index 85bf79a..85bf79a 100644
--- a/src/cz/crcs/ectester/reader/output/ResponseWriter.java
+++ b/reader/src/main/java/cz/crcs/ectester/reader/output/ResponseWriter.java
diff --git a/src/cz/crcs/ectester/reader/output/TextTestWriter.java b/reader/src/main/java/cz/crcs/ectester/reader/output/TextTestWriter.java
index 2775647..532ace5 100644
--- a/src/cz/crcs/ectester/reader/output/TextTestWriter.java
+++ b/reader/src/main/java/cz/crcs/ectester/reader/output/TextTestWriter.java
@@ -1,11 +1,11 @@
package cz.crcs.ectester.reader.output;
-import cz.crcs.ectester.applet.ECTesterApplet;
import cz.crcs.ectester.common.cli.Colors;
import cz.crcs.ectester.common.output.BaseTextTestWriter;
import cz.crcs.ectester.common.test.TestSuite;
import cz.crcs.ectester.common.test.Testable;
import cz.crcs.ectester.common.util.ByteUtil;
+import cz.crcs.ectester.common.util.CardConsts;
import cz.crcs.ectester.reader.CardMngr;
import cz.crcs.ectester.reader.ECTesterReader;
import cz.crcs.ectester.reader.command.Command;
@@ -48,7 +48,7 @@ public class TextTestWriter extends BaseTextTestWriter {
try {
sb.append("═══ ").append(Colors.underline("ECTester version:")).append(" ").append(ECTesterReader.VERSION).append(ECTesterReader.GIT_COMMIT).append(System.lineSeparator());
Response.GetInfo info = new Command.GetInfo(cardSuite.getCard()).send();
- sb.append("═══ ").append(Colors.underline("ECTester applet version:")).append(" ").append(info.getVersion()).append(info.getBase() == ECTesterApplet.BASE_221 ? "" : " (extended length)").append(System.lineSeparator());
+ sb.append("═══ ").append(Colors.underline("ECTester applet version:")).append(" ").append(info.getVersion()).append(info.getBase() == CardConsts.BASE_221 ? "" : " (extended length)").append(System.lineSeparator());
sb.append("═══ ").append(Colors.underline("Card ATR:")).append(" ").append(ByteUtil.bytesToHex(cardSuite.getCard().getATR().getBytes(), false)).append(System.lineSeparator());
sb.append("═══ ").append(Colors.underline("JavaCard version:")).append(" ").append(info.getJavaCardVersion()).append(System.lineSeparator());
sb.append("═══ ").append(Colors.underline("Array sizes (apduBuf, ram, ram2, apduArr):")).append(" ").append(String.format("%d %d %d %d", info.getApduBufferLength(), info.getRamArrayLength(), info.getRamArray2Length(), info.getApduArrayLength())).append(System.lineSeparator());
diff --git a/src/cz/crcs/ectester/reader/output/XMLTestWriter.java b/reader/src/main/java/cz/crcs/ectester/reader/output/XMLTestWriter.java
index fc41805..fc41805 100644
--- a/src/cz/crcs/ectester/reader/output/XMLTestWriter.java
+++ b/reader/src/main/java/cz/crcs/ectester/reader/output/XMLTestWriter.java
diff --git a/src/cz/crcs/ectester/reader/output/YAMLTestWriter.java b/reader/src/main/java/cz/crcs/ectester/reader/output/YAMLTestWriter.java
index 56ecb71..56ecb71 100644
--- a/src/cz/crcs/ectester/reader/output/YAMLTestWriter.java
+++ b/reader/src/main/java/cz/crcs/ectester/reader/output/YAMLTestWriter.java
diff --git a/src/cz/crcs/ectester/reader/response/Response.java b/reader/src/main/java/cz/crcs/ectester/reader/response/Response.java
index f36d087..e253d30 100644
--- a/src/cz/crcs/ectester/reader/response/Response.java
+++ b/reader/src/main/java/cz/crcs/ectester/reader/response/Response.java
@@ -1,9 +1,9 @@
package cz.crcs.ectester.reader.response;
-import cz.crcs.ectester.applet.ECTesterApplet;
-import cz.crcs.ectester.applet.EC_Consts;
+import cz.crcs.ectester.common.ec.EC_Consts;
import cz.crcs.ectester.common.util.ByteUtil;
-import javacard.framework.ISO7816;
+import cz.crcs.ectester.common.util.CardConsts;
+import cz.crcs.ectester.common.util.CardUtil;
import javax.smartcardio.ResponseAPDU;
@@ -39,7 +39,7 @@ public abstract class Response {
short sw = ByteUtil.getShort(data, offset);
offset += 2;
sws[i] = sw;
- if (sw != ISO7816.SW_NO_ERROR) {
+ if (sw != CardUtil.ISO7816.SW_NO_ERROR) {
success = false;
}
} else {
@@ -48,7 +48,7 @@ public abstract class Response {
}
}
- if ((short) resp.getSW() != ISO7816.SW_NO_ERROR) {
+ if ((short) resp.getSW() != CardUtil.ISO7816.SW_NO_ERROR) {
success = false;
error = true;
}
@@ -179,8 +179,8 @@ public abstract class Response {
this.keyClass = keyClass;
int pairs = 0;
- if ((keyPair & ECTesterApplet.KEYPAIR_LOCAL) != 0) pairs++;
- if ((keyPair & ECTesterApplet.KEYPAIR_REMOTE) != 0) pairs++;
+ if ((keyPair & CardConsts.KEYPAIR_LOCAL) != 0) pairs++;
+ if ((keyPair & CardConsts.KEYPAIR_REMOTE) != 0) pairs++;
parse(pairs, 0);
}
}
@@ -196,8 +196,8 @@ public abstract class Response {
this.keyPair = keyPair;
int pairs = 0;
- if ((keyPair & ECTesterApplet.KEYPAIR_LOCAL) != 0) pairs++;
- if ((keyPair & ECTesterApplet.KEYPAIR_REMOTE) != 0) pairs++;
+ if ((keyPair & CardConsts.KEYPAIR_LOCAL) != 0) pairs++;
+ if ((keyPair & CardConsts.KEYPAIR_REMOTE) != 0) pairs++;
parse(pairs, 0);
}
}
@@ -217,8 +217,8 @@ public abstract class Response {
this.parameters = parameters;
int pairs = 0;
- if ((keyPair & ECTesterApplet.KEYPAIR_LOCAL) != 0) pairs++;
- if ((keyPair & ECTesterApplet.KEYPAIR_REMOTE) != 0) pairs++;
+ if ((keyPair & CardConsts.KEYPAIR_LOCAL) != 0) pairs++;
+ if ((keyPair & CardConsts.KEYPAIR_REMOTE) != 0) pairs++;
parse(pairs, 0);
}
@@ -241,8 +241,8 @@ public abstract class Response {
this.transformation = transformation;
int pairs = 0;
- if ((keyPair & ECTesterApplet.KEYPAIR_LOCAL) != 0) pairs++;
- if ((keyPair & ECTesterApplet.KEYPAIR_REMOTE) != 0) pairs++;
+ if ((keyPair & CardConsts.KEYPAIR_LOCAL) != 0) pairs++;
+ if ((keyPair & CardConsts.KEYPAIR_REMOTE) != 0) pairs++;
parse(pairs, 0);
}
@@ -259,8 +259,8 @@ public abstract class Response {
this.keyPair = keyPair;
int generated = 0;
- if ((keyPair & ECTesterApplet.KEYPAIR_LOCAL) != 0) generated++;
- if ((keyPair & ECTesterApplet.KEYPAIR_REMOTE) != 0) generated++;
+ if ((keyPair & CardConsts.KEYPAIR_LOCAL) != 0) generated++;
+ if ((keyPair & CardConsts.KEYPAIR_REMOTE) != 0) generated++;
parse(generated, 0);
}
}
@@ -280,8 +280,8 @@ public abstract class Response {
this.parameters = parameters;
int exported = 0;
- if ((keyPair & ECTesterApplet.KEYPAIR_LOCAL) != 0) exported++;
- if ((keyPair & ECTesterApplet.KEYPAIR_REMOTE) != 0) exported++;
+ if ((keyPair & CardConsts.KEYPAIR_LOCAL) != 0) exported++;
+ if ((keyPair & CardConsts.KEYPAIR_REMOTE) != 0) exported++;
int keys = 0;
if ((key & EC_Consts.KEY_PUBLIC) != 0) keys++;
if ((key & EC_Consts.KEY_PRIVATE) != 0) keys++;
@@ -301,9 +301,9 @@ public abstract class Response {
}
private int getIndex(byte keyPair, short param) {
- byte pair = ECTesterApplet.KEYPAIR_LOCAL;
+ byte pair = CardConsts.KEYPAIR_LOCAL;
int index = 0;
- while (pair <= ECTesterApplet.KEYPAIR_REMOTE) {
+ while (pair <= CardConsts.KEYPAIR_REMOTE) {
short mask = EC_Consts.PARAMETER_FP;
while (mask <= EC_Consts.PARAMETER_S) {
if (pair == keyPair && param == mask) {
@@ -374,7 +374,7 @@ public abstract class Response {
this.transformation = transformation;
this.type = type;
- parse(1, (export == ECTesterApplet.EXPORT_TRUE) ? 1 : 0);
+ parse(1, (export == CardConsts.EXPORT_TRUE) ? 1 : 0);
}
public short getTransformation() {
@@ -414,7 +414,7 @@ public abstract class Response {
this.export = export;
this.raw = raw;
- parse(1, (export == ECTesterApplet.EXPORT_TRUE) ? 1 : 0);
+ parse(1, (export == CardConsts.EXPORT_TRUE) ? 1 : 0);
}
public boolean hasSignature() {
diff --git a/src/cz/crcs/ectester/reader/test/CardCofactorSuite.java b/reader/src/main/java/cz/crcs/ectester/reader/test/CardCofactorSuite.java
index d1eb2b1..01e9d02 100644
--- a/src/cz/crcs/ectester/reader/test/CardCofactorSuite.java
+++ b/reader/src/main/java/cz/crcs/ectester/reader/test/CardCofactorSuite.java
@@ -1,14 +1,14 @@
package cz.crcs.ectester.reader.test;
-import cz.crcs.ectester.applet.ECTesterApplet;
-import cz.crcs.ectester.applet.EC_Consts;
import cz.crcs.ectester.common.ec.EC_Curve;
import cz.crcs.ectester.common.ec.EC_Key;
+import cz.crcs.ectester.common.ec.EC_Consts;
import cz.crcs.ectester.common.output.TestWriter;
import cz.crcs.ectester.common.test.CompoundTest;
import cz.crcs.ectester.common.test.Result;
import cz.crcs.ectester.common.test.Test;
import cz.crcs.ectester.common.util.CardUtil;
+import cz.crcs.ectester.common.util.CardConsts;
import cz.crcs.ectester.data.EC_Store;
import cz.crcs.ectester.reader.CardMngr;
import cz.crcs.ectester.reader.ECTesterReader;
@@ -37,18 +37,18 @@ public class CardCofactorSuite extends CardTestSuite {
EC_Curve curve = e.getKey();
List<EC_Key.Public> keys = e.getValue();
- Test allocate = CommandTest.expect(new Command.Allocate(this.card, ECTesterApplet.KEYPAIR_BOTH, curve.getBits(), curve.getField()), ExpectedValue.SUCCESS);
- Test set = CommandTest.expect(new Command.Set(this.card, ECTesterApplet.KEYPAIR_BOTH, EC_Consts.CURVE_external, curve.getParams(), curve.flatten()), ExpectedValue.SUCCESS);
- Test generate = setupKeypairs(curve, ExpectedValue.SUCCESS, ECTesterApplet.KEYPAIR_LOCAL);
+ Test allocate = CommandTest.expect(new Command.Allocate(this.card, CardConsts.KEYPAIR_BOTH, curve.getBits(), curve.getField()), ExpectedValue.SUCCESS);
+ Test set = CommandTest.expect(new Command.Set(this.card, CardConsts.KEYPAIR_BOTH, EC_Consts.CURVE_external, curve.getParams(), curve.flatten()), ExpectedValue.SUCCESS);
+ Test generate = setupKeypairs(curve, ExpectedValue.SUCCESS, CardConsts.KEYPAIR_LOCAL);
Test prepare = CompoundTest.all(ExpectedValue.SUCCESS, "Prepare and generate keypair on " + curve.getId() + ".", allocate, set, generate);
List<Test> ecdhTests = new LinkedList<>();
for (EC_Key.Public pub : keys) {
- Test setPub = CommandTest.expect(new Command.Set(this.card, ECTesterApplet.KEYPAIR_REMOTE, EC_Consts.CURVE_external, pub.getParams(), pub.flatten()), Result.ExpectedValue.FAILURE);
- Test ecdh = CommandTest.expect(new Command.ECDH(this.card, ECTesterApplet.KEYPAIR_REMOTE, ECTesterApplet.KEYPAIR_LOCAL, ECTesterApplet.EXPORT_FALSE, EC_Consts.TRANSFORMATION_NONE, EC_Consts.KeyAgreement_ALG_EC_SVDP_DH), Result.ExpectedValue.FAILURE);
+ Test setPub = CommandTest.expect(new Command.Set(this.card, CardConsts.KEYPAIR_REMOTE, EC_Consts.CURVE_external, pub.getParams(), pub.flatten()), Result.ExpectedValue.FAILURE);
+ Test ecdh = CommandTest.expect(new Command.ECDH(this.card, CardConsts.KEYPAIR_REMOTE, CardConsts.KEYPAIR_LOCAL, CardConsts.EXPORT_FALSE, EC_Consts.TRANSFORMATION_NONE, EC_Consts.KeyAgreement_ALG_EC_SVDP_DH), Result.ExpectedValue.FAILURE);
Test objectEcdh = CompoundTest.any(Result.ExpectedValue.SUCCESS, CardUtil.getKATypeString(EC_Consts.KeyAgreement_ALG_EC_SVDP_DH) + " test with cofactor pubkey.", setPub, ecdh);
- Command ecdhCommand = new Command.ECDH_direct(this.card, ECTesterApplet.KEYPAIR_LOCAL, ECTesterApplet.EXPORT_FALSE, EC_Consts.TRANSFORMATION_NONE, EC_Consts.KeyAgreement_ALG_EC_SVDP_DH, pub.flatten());
+ Command ecdhCommand = new Command.ECDH_direct(this.card, CardConsts.KEYPAIR_LOCAL, CardConsts.EXPORT_FALSE, EC_Consts.TRANSFORMATION_NONE, EC_Consts.KeyAgreement_ALG_EC_SVDP_DH, pub.flatten());
Test rawEcdh = CommandTest.expect(ecdhCommand, ExpectedValue.FAILURE, "Card correctly rejected point on non-generator subgroup.", "Card incorrectly accepted point on non-generator subgroup.");
ecdhTests.add(CompoundTest.all(Result.ExpectedValue.SUCCESS, pub.getId() + " cofactor key test.", objectEcdh, rawEcdh));
}
diff --git a/src/cz/crcs/ectester/reader/test/CardCompositeSuite.java b/reader/src/main/java/cz/crcs/ectester/reader/test/CardCompositeSuite.java
index babe732..a28c2a7 100644
--- a/src/cz/crcs/ectester/reader/test/CardCompositeSuite.java
+++ b/reader/src/main/java/cz/crcs/ectester/reader/test/CardCompositeSuite.java
@@ -1,13 +1,13 @@
package cz.crcs.ectester.reader.test;
-import cz.crcs.ectester.applet.ECTesterApplet;
-import cz.crcs.ectester.applet.EC_Consts;
import cz.crcs.ectester.common.ec.EC_Curve;
import cz.crcs.ectester.common.ec.EC_Key;
+import cz.crcs.ectester.common.ec.EC_Consts;
import cz.crcs.ectester.common.output.TestWriter;
import cz.crcs.ectester.common.test.CompoundTest;
import cz.crcs.ectester.common.test.Test;
import cz.crcs.ectester.common.util.CardUtil;
+import cz.crcs.ectester.common.util.CardConsts;
import cz.crcs.ectester.data.EC_Store;
import cz.crcs.ectester.reader.CardMngr;
import cz.crcs.ectester.reader.ECTesterReader;
@@ -36,13 +36,13 @@ public class CardCompositeSuite extends CardTestSuite {
for (Map.Entry<EC_Curve, List<EC_Key>> curveKeys : mappedKeys.entrySet()) {
EC_Curve curve = curveKeys.getKey();
List<Test> tests = new LinkedList<>();
- Test allocate = runTest(CommandTest.expect(new Command.Allocate(this.card, ECTesterApplet.KEYPAIR_LOCAL, curve.getBits(), curve.getField()), ExpectedValue.SUCCESS));
+ Test allocate = runTest(CommandTest.expect(new Command.Allocate(this.card, CardConsts.KEYPAIR_LOCAL, curve.getBits(), curve.getField()), ExpectedValue.SUCCESS));
if (!allocate.ok()) {
doTest(CompoundTest.all(ExpectedValue.SUCCESS, "No support for " + curve.getBits() + "b " + CardUtil.getKeyTypeString(curve.getField()) + ".", allocate));
continue;
}
tests.add(allocate);
- tests.add(CommandTest.expect(new Command.Set(this.card, ECTesterApplet.KEYPAIR_LOCAL, EC_Consts.CURVE_external, curve.getParams(), curve.flatten()), ExpectedValue.ANY));
+ tests.add(CommandTest.expect(new Command.Set(this.card, CardConsts.KEYPAIR_LOCAL, EC_Consts.CURVE_external, curve.getParams(), curve.flatten()), ExpectedValue.ANY));
String name;
if (cfg.testOptions.contains("preset")) {
@@ -50,9 +50,9 @@ public class CardCompositeSuite extends CardTestSuite {
} else {
name = "generated private key";
}
- tests.add(setupKeypairs(curve, ExpectedValue.ANY, ECTesterApplet.KEYPAIR_LOCAL));
+ tests.add(setupKeypairs(curve, ExpectedValue.ANY, CardConsts.KEYPAIR_LOCAL));
for (EC_Key key : curveKeys.getValue()) {
- Command ecdhCommand = new Command.ECDH_direct(this.card, ECTesterApplet.KEYPAIR_LOCAL, ECTesterApplet.EXPORT_FALSE, EC_Consts.TRANSFORMATION_NONE, EC_Consts.KeyAgreement_ALG_EC_SVDP_DH, key.flatten());
+ Command ecdhCommand = new Command.ECDH_direct(this.card, CardConsts.KEYPAIR_LOCAL, CardConsts.EXPORT_FALSE, EC_Consts.TRANSFORMATION_NONE, EC_Consts.KeyAgreement_ALG_EC_SVDP_DH, key.flatten());
Test ecdh = 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.");
tests.add(CompoundTest.greedyAllTry(ExpectedValue.SUCCESS, "Composite test of " + curve.getId() + ", with " + name + ", " + key.getDesc(), ecdh));
}
@@ -95,11 +95,11 @@ public class CardCompositeSuite extends CardTestSuite {
private void testGroup(List<EC_Curve> curves, String testName, ExpectedValue dhValue, String ok, String nok) throws Exception {
for (EC_Curve curve : curves) {
- Test allocate = CommandTest.expect(new Command.Allocate(this.card, ECTesterApplet.KEYPAIR_BOTH, curve.getBits(), curve.getField()), ExpectedValue.SUCCESS);
- Test set = CommandTest.expect(new Command.Set(this.card, ECTesterApplet.KEYPAIR_BOTH, EC_Consts.CURVE_external, curve.getParams(), curve.flatten()), ExpectedValue.ANY);
- Test generate = setupKeypairs(curve, ExpectedValue.ANY, ECTesterApplet.KEYPAIR_BOTH);
- Test ecdh = CommandTest.expect(new Command.ECDH(this.card, ECTesterApplet.KEYPAIR_REMOTE, ECTesterApplet.KEYPAIR_LOCAL, ECTesterApplet.EXPORT_FALSE, EC_Consts.TRANSFORMATION_NONE, EC_Consts.KeyAgreement_ALG_EC_SVDP_DH), dhValue, ok, nok);
- Test ecdsa = CommandTest.expect(new Command.ECDSA_sign(this.card, ECTesterApplet.KEYPAIR_LOCAL, EC_Consts.Signature_ALG_ECDSA_SHA, ECTesterApplet.EXPORT_FALSE, null), dhValue, ok, nok);
+ Test allocate = CommandTest.expect(new Command.Allocate(this.card, CardConsts.KEYPAIR_BOTH, curve.getBits(), curve.getField()), ExpectedValue.SUCCESS);
+ Test set = CommandTest.expect(new Command.Set(this.card, CardConsts.KEYPAIR_BOTH, EC_Consts.CURVE_external, curve.getParams(), curve.flatten()), ExpectedValue.ANY);
+ Test generate = setupKeypairs(curve, ExpectedValue.ANY, CardConsts.KEYPAIR_BOTH);
+ Test ecdh = CommandTest.expect(new Command.ECDH(this.card, CardConsts.KEYPAIR_REMOTE, CardConsts.KEYPAIR_LOCAL, CardConsts.EXPORT_FALSE, EC_Consts.TRANSFORMATION_NONE, EC_Consts.KeyAgreement_ALG_EC_SVDP_DH), dhValue, ok, nok);
+ Test ecdsa = CommandTest.expect(new Command.ECDSA_sign(this.card, CardConsts.KEYPAIR_LOCAL, EC_Consts.Signature_ALG_ECDSA_SHA, CardConsts.EXPORT_FALSE, null), dhValue, ok, nok);
String description;
if (testName == null) {
diff --git a/src/cz/crcs/ectester/reader/test/CardCompressionSuite.java b/reader/src/main/java/cz/crcs/ectester/reader/test/CardCompressionSuite.java
index 9eed814..8390cd3 100644
--- a/src/cz/crcs/ectester/reader/test/CardCompressionSuite.java
+++ b/reader/src/main/java/cz/crcs/ectester/reader/test/CardCompressionSuite.java
@@ -1,9 +1,8 @@
package cz.crcs.ectester.reader.test;
-import cz.crcs.ectester.applet.ECTesterApplet;
-import cz.crcs.ectester.applet.EC_Consts;
import cz.crcs.ectester.common.ec.EC_Curve;
import cz.crcs.ectester.common.ec.EC_Key;
+import cz.crcs.ectester.common.ec.EC_Consts;
import cz.crcs.ectester.common.output.TestWriter;
import cz.crcs.ectester.common.test.CompoundTest;
import cz.crcs.ectester.common.test.Result;
@@ -11,12 +10,12 @@ import cz.crcs.ectester.common.test.Test;
import cz.crcs.ectester.common.util.ByteUtil;
import cz.crcs.ectester.common.util.CardUtil;
import cz.crcs.ectester.common.util.ECUtil;
+import cz.crcs.ectester.common.util.CardConsts;
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 cz.crcs.ectester.reader.response.Response;
-import javacard.security.KeyPair;
import java.security.spec.ECPoint;
import java.util.LinkedList;
@@ -45,7 +44,7 @@ public class CardCompressionSuite extends CardTestSuite {
// - test local privkey, remote pubkey (hybrid with wrong y)
// - test local privkey, remote pubkey (point at infinity)
if (cfg.primeField) {
- runCompression(KeyPair.ALG_EC_FP);
+ runCompression(EC_Consts.ALG_EC_FP);
}
// for F2m
// - allocate, set custom curve, generate keypairs, -> export generated.
@@ -55,7 +54,7 @@ public class CardCompressionSuite extends CardTestSuite {
// - test local privkey, remote pubkey (hybrid with wrong y)
// - test local privkey, remote pubkey (point at infinity)
if (cfg.binaryField) {
- runCompression(KeyPair.ALG_EC_F2M);
+ runCompression(EC_Consts.ALG_EC_F2M);
}
// Now, do ECDH over SECG curves and give the implementation a compressed key that is not a quadratic residue in
@@ -64,14 +63,14 @@ public class CardCompressionSuite extends CardTestSuite {
}
private void runCompression(byte field) throws Exception {
- short[] keySizes = field == KeyPair.ALG_EC_FP ? EC_Consts.FP_SIZES : EC_Consts.F2M_SIZES;
- short domain = field == KeyPair.ALG_EC_FP ? EC_Consts.PARAMETERS_DOMAIN_FP : EC_Consts.PARAMETERS_DOMAIN_F2M;
+ short[] keySizes = field == EC_Consts.ALG_EC_FP ? EC_Consts.FP_SIZES : EC_Consts.F2M_SIZES;
+ short domain = field == EC_Consts.ALG_EC_FP ? EC_Consts.PARAMETERS_DOMAIN_FP : EC_Consts.PARAMETERS_DOMAIN_F2M;
for (short keyLength : keySizes) {
String spec = keyLength + "b " + CardUtil.getKeyTypeString(field);
byte curveId = EC_Consts.getCurve(keyLength, field);
- Test allocateFirst = runTest(CommandTest.expect(new Command.Allocate(this.card, ECTesterApplet.KEYPAIR_BOTH, keyLength, field), Result.ExpectedValue.SUCCESS));
+ Test allocateFirst = runTest(CommandTest.expect(new Command.Allocate(this.card, CardConsts.KEYPAIR_BOTH, keyLength, field), Result.ExpectedValue.SUCCESS));
if (!allocateFirst.ok()) {
doTest(CompoundTest.all(Result.ExpectedValue.SUCCESS, "No support for compression test on " + spec + ".", allocateFirst));
continue;
@@ -79,13 +78,13 @@ public class CardCompressionSuite extends CardTestSuite {
List<Test> compressionTests = new LinkedList<>();
compressionTests.add(allocateFirst);
- Test setCustom = runTest(CommandTest.expect(new Command.Set(this.card, ECTesterApplet.KEYPAIR_BOTH, curveId, domain, null), Result.ExpectedValue.SUCCESS));
- Test genCustom = runTest(CommandTest.expect(new Command.Generate(this.card, ECTesterApplet.KEYPAIR_BOTH), Result.ExpectedValue.SUCCESS));
+ Test setCustom = runTest(CommandTest.expect(new Command.Set(this.card, CardConsts.KEYPAIR_BOTH, curveId, domain, null), Result.ExpectedValue.SUCCESS));
+ Test genCustom = runTest(CommandTest.expect(new Command.Generate(this.card, CardConsts.KEYPAIR_BOTH), Result.ExpectedValue.SUCCESS));
compressionTests.add(setCustom);
compressionTests.add(genCustom);
- Response.Export key = new Command.Export(this.card, ECTesterApplet.KEYPAIR_REMOTE, EC_Consts.KEY_PUBLIC, EC_Consts.PARAMETER_W).send();
- byte[] pubkey = key.getParameter(ECTesterApplet.KEYPAIR_REMOTE, EC_Consts.KEY_PUBLIC);
+ Response.Export key = new Command.Export(this.card, CardConsts.KEYPAIR_REMOTE, EC_Consts.KEY_PUBLIC, EC_Consts.PARAMETER_W).send();
+ byte[] pubkey = key.getParameter(CardConsts.KEYPAIR_REMOTE, EC_Consts.KEY_PUBLIC);
EC_Curve secgCurve = EC_Store.getInstance().getObject(EC_Curve.class, "secg", CardUtil.getCurveName(curveId));
ECPoint pub;
try {
@@ -100,23 +99,23 @@ public class CardCompressionSuite extends CardTestSuite {
List<Test> thisTests = new LinkedList<>();
Test allocate = runTest(CommandTest.expect(new Command.AllocateKeyAgreement(this.card, kaType), Result.ExpectedValue.SUCCESS));
if (allocate.ok()) {
- Test ka = runTest(CommandTest.expect(new Command.ECDH(this.card, ECTesterApplet.KEYPAIR_LOCAL, ECTesterApplet.KEYPAIR_REMOTE, ECTesterApplet.EXPORT_FALSE, EC_Consts.TRANSFORMATION_NONE, kaType), Result.ExpectedValue.SUCCESS));
+ Test ka = runTest(CommandTest.expect(new Command.ECDH(this.card, CardConsts.KEYPAIR_LOCAL, CardConsts.KEYPAIR_REMOTE, CardConsts.EXPORT_FALSE, EC_Consts.TRANSFORMATION_NONE, kaType), Result.ExpectedValue.SUCCESS));
thisTests.add(CompoundTest.all(Result.ExpectedValue.SUCCESS, "KeyAgreement setup and basic test.", allocate, ka));
if (ka.ok()) {
// tests of the good stuff
- Test kaCompressed = CommandTest.expect(new Command.ECDH(this.card, ECTesterApplet.KEYPAIR_LOCAL, ECTesterApplet.KEYPAIR_REMOTE, ECTesterApplet.EXPORT_FALSE, EC_Consts.TRANSFORMATION_COMPRESS, kaType), Result.ExpectedValue.SUCCESS);
- Test kaHybrid = CommandTest.expect(new Command.ECDH(this.card, ECTesterApplet.KEYPAIR_LOCAL, ECTesterApplet.KEYPAIR_REMOTE, ECTesterApplet.EXPORT_FALSE, EC_Consts.TRANSFORMATION_COMPRESS_HYBRID, kaType), Result.ExpectedValue.SUCCESS);
+ Test kaCompressed = CommandTest.expect(new Command.ECDH(this.card, CardConsts.KEYPAIR_LOCAL, CardConsts.KEYPAIR_REMOTE, CardConsts.EXPORT_FALSE, EC_Consts.TRANSFORMATION_COMPRESS, kaType), Result.ExpectedValue.SUCCESS);
+ Test kaHybrid = CommandTest.expect(new Command.ECDH(this.card, CardConsts.KEYPAIR_LOCAL, CardConsts.KEYPAIR_REMOTE, CardConsts.EXPORT_FALSE, EC_Consts.TRANSFORMATION_COMPRESS_HYBRID, kaType), Result.ExpectedValue.SUCCESS);
thisTests.add(CompoundTest.any(Result.ExpectedValue.SUCCESS, "Tests of compressed and hybrid form.", kaCompressed, kaHybrid));
// tests the bad stuff here
byte[] pubHybrid = ECUtil.toX962Hybrid(pub, keyLength);
pubHybrid[pubHybrid.length - 1] ^= 1;
byte[] pubHybridEncoded = ByteUtil.prependLength(pubHybrid);
- Test kaBadHybrid = CommandTest.expect(new Command.ECDH_direct(this.card, ECTesterApplet.KEYPAIR_LOCAL, ECTesterApplet.EXPORT_FALSE, EC_Consts.TRANSFORMATION_NONE, kaType, pubHybridEncoded), Result.ExpectedValue.FAILURE);
+ Test kaBadHybrid = CommandTest.expect(new Command.ECDH_direct(this.card, CardConsts.KEYPAIR_LOCAL, CardConsts.EXPORT_FALSE, EC_Consts.TRANSFORMATION_NONE, kaType, pubHybridEncoded), Result.ExpectedValue.FAILURE);
byte[] pubInfinityEncoded = {0x01, 0x00};
- Test kaBadInfinity = CommandTest.expect(new Command.ECDH_direct(this.card, ECTesterApplet.KEYPAIR_LOCAL, ECTesterApplet.EXPORT_FALSE, EC_Consts.TRANSFORMATION_NONE, kaType, pubInfinityEncoded), Result.ExpectedValue.FAILURE);
+ Test kaBadInfinity = CommandTest.expect(new Command.ECDH_direct(this.card, CardConsts.KEYPAIR_LOCAL, CardConsts.EXPORT_FALSE, EC_Consts.TRANSFORMATION_NONE, kaType, pubInfinityEncoded), Result.ExpectedValue.FAILURE);
thisTests.add(CompoundTest.all(Result.ExpectedValue.SUCCESS, "Tests of corrupted hybrid form and infinity.", kaBadHybrid, kaBadInfinity));
}
kaTests.add(CompoundTest.all(Result.ExpectedValue.SUCCESS, "KeyAgreement tests of " + CardUtil.getKATypeString(kaType) + ".", thisTests.toArray(new Test[0])));
@@ -138,17 +137,17 @@ public class CardCompressionSuite extends CardTestSuite {
for (EC_Key.Public key : compressionKeys) {
EC_Curve curve = EC_Store.getInstance().getObject(EC_Curve.class, key.getCurve());
List<Test> tests = new LinkedList<>();
- Test allocate = runTest(CommandTest.expect(new Command.Allocate(this.card, ECTesterApplet.KEYPAIR_LOCAL, curve.getBits(), curve.getField()), Result.ExpectedValue.SUCCESS));
+ Test allocate = runTest(CommandTest.expect(new Command.Allocate(this.card, CardConsts.KEYPAIR_LOCAL, curve.getBits(), curve.getField()), Result.ExpectedValue.SUCCESS));
if (!allocate.ok()) {
doTest(CompoundTest.all(Result.ExpectedValue.SUCCESS, "No support for non-residue test on " + curve.getBits() + "b " + curve.getId() + ".", allocate));
continue;
}
tests.add(allocate);
- tests.add(CommandTest.expect(new Command.Set(this.card, ECTesterApplet.KEYPAIR_LOCAL, EC_Consts.CURVE_external, curve.getParams(), curve.flatten()), Result.ExpectedValue.SUCCESS));
- tests.add(CommandTest.expect(new Command.Generate(this.card, ECTesterApplet.KEYPAIR_LOCAL), Result.ExpectedValue.SUCCESS));
+ tests.add(CommandTest.expect(new Command.Set(this.card, CardConsts.KEYPAIR_LOCAL, EC_Consts.CURVE_external, curve.getParams(), curve.flatten()), Result.ExpectedValue.SUCCESS));
+ tests.add(CommandTest.expect(new Command.Generate(this.card, CardConsts.KEYPAIR_LOCAL), Result.ExpectedValue.SUCCESS));
byte[] pointData = ECUtil.toX962Compressed(key.getParam(EC_Consts.PARAMETER_W));
byte[] pointDataEncoded = ByteUtil.prependLength(pointData);
- tests.add(CommandTest.expect(new Command.ECDH_direct(this.card, ECTesterApplet.KEYPAIR_LOCAL, ECTesterApplet.EXPORT_FALSE, EC_Consts.TRANSFORMATION_NONE, EC_Consts.KeyAgreement_ALG_EC_SVDP_DH, pointDataEncoded), Result.ExpectedValue.FAILURE));
+ tests.add(CommandTest.expect(new Command.ECDH_direct(this.card, CardConsts.KEYPAIR_LOCAL, CardConsts.EXPORT_FALSE, EC_Consts.TRANSFORMATION_NONE, EC_Consts.KeyAgreement_ALG_EC_SVDP_DH, pointDataEncoded), Result.ExpectedValue.FAILURE));
doTest(CompoundTest.greedyAll(Result.ExpectedValue.SUCCESS, "Non-residue test of " + curve.getId() + ".", tests.toArray(new Test[0])));
}
}
diff --git a/src/cz/crcs/ectester/reader/test/CardDefaultSuite.java b/reader/src/main/java/cz/crcs/ectester/reader/test/CardDefaultSuite.java
index 8814c37..ebb1d3f 100644
--- a/src/cz/crcs/ectester/reader/test/CardDefaultSuite.java
+++ b/reader/src/main/java/cz/crcs/ectester/reader/test/CardDefaultSuite.java
@@ -1,16 +1,15 @@
package cz.crcs.ectester.reader.test;
-import cz.crcs.ectester.applet.ECTesterApplet;
-import cz.crcs.ectester.applet.EC_Consts;
+import cz.crcs.ectester.common.ec.EC_Consts;
import cz.crcs.ectester.common.output.TestWriter;
import cz.crcs.ectester.common.test.CompoundTest;
import cz.crcs.ectester.common.test.Result;
import cz.crcs.ectester.common.test.Test;
+import cz.crcs.ectester.common.util.CardConsts;
import cz.crcs.ectester.common.util.CardUtil;
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.LinkedList;
import java.util.List;
@@ -34,30 +33,30 @@ public class CardDefaultSuite extends CardTestSuite {
@Override
protected void runTests() throws Exception {
if (cfg.primeField) {
- runDefault(KeyPair.ALG_EC_FP);
+ runDefault(EC_Consts.ALG_EC_FP);
}
if (cfg.binaryField) {
- runDefault(KeyPair.ALG_EC_F2M);
+ runDefault(EC_Consts.ALG_EC_F2M);
}
}
private void runDefault(byte field) throws Exception {
- short[] keySizes = field == KeyPair.ALG_EC_FP ? EC_Consts.FP_SIZES : EC_Consts.F2M_SIZES;
- short domain = field == KeyPair.ALG_EC_FP ? EC_Consts.PARAMETERS_DOMAIN_FP : EC_Consts.PARAMETERS_DOMAIN_F2M;
+ short[] keySizes = field == EC_Consts.ALG_EC_FP ? EC_Consts.FP_SIZES : EC_Consts.F2M_SIZES;
+ short domain = field == EC_Consts.ALG_EC_FP ? EC_Consts.PARAMETERS_DOMAIN_FP : EC_Consts.PARAMETERS_DOMAIN_F2M;
for (short keyLength : keySizes) {
List<Test> supportTests = new LinkedList<>();
- Test allocateFirst = runTest(CommandTest.expect(new Command.Allocate(this.card, ECTesterApplet.KEYPAIR_BOTH, keyLength, field), ExpectedValue.SUCCESS));
+ Test allocateFirst = runTest(CommandTest.expect(new Command.Allocate(this.card, CardConsts.KEYPAIR_BOTH, keyLength, field), ExpectedValue.SUCCESS));
if (!allocateFirst.ok()) {
doTest(CompoundTest.all(ExpectedValue.SUCCESS, "No support for " + keyLength + "b " + CardUtil.getKeyTypeString(field) + ".", allocateFirst));
continue;
}
supportTests.add(allocateFirst);
- Test genDefault = runTest(CommandTest.expect(new Command.Generate(this.card, ECTesterApplet.KEYPAIR_BOTH), ExpectedValue.SUCCESS));
- Test allocateSecond = runTest(CommandTest.expect(new Command.Allocate(this.card, ECTesterApplet.KEYPAIR_BOTH, keyLength, field), ExpectedValue.SUCCESS));
- Test setCustom = runTest(CommandTest.expect(new Command.Set(this.card, ECTesterApplet.KEYPAIR_BOTH, EC_Consts.getCurve(keyLength, field), domain, null), ExpectedValue.SUCCESS));
- Test genCustom = runTest(CommandTest.expect(new Command.Generate(this.card, ECTesterApplet.KEYPAIR_BOTH), ExpectedValue.SUCCESS));
+ Test genDefault = runTest(CommandTest.expect(new Command.Generate(this.card, CardConsts.KEYPAIR_BOTH), ExpectedValue.SUCCESS));
+ Test allocateSecond = runTest(CommandTest.expect(new Command.Allocate(this.card, CardConsts.KEYPAIR_BOTH, keyLength, field), ExpectedValue.SUCCESS));
+ Test setCustom = runTest(CommandTest.expect(new Command.Set(this.card, CardConsts.KEYPAIR_BOTH, EC_Consts.getCurve(keyLength, field), domain, null), ExpectedValue.SUCCESS));
+ Test genCustom = runTest(CommandTest.expect(new Command.Generate(this.card, CardConsts.KEYPAIR_BOTH), ExpectedValue.SUCCESS));
supportTests.add(genDefault);
supportTests.add(allocateSecond);
supportTests.add(setCustom);
@@ -67,9 +66,9 @@ public class CardDefaultSuite extends CardTestSuite {
for (byte kaType : EC_Consts.KA_TYPES) {
Test allocate = runTest(CommandTest.expect(new Command.AllocateKeyAgreement(this.card, kaType), ExpectedValue.SUCCESS));
if (allocate.ok()) {
- Command ecdh = new Command.ECDH(this.card, ECTesterApplet.KEYPAIR_LOCAL, ECTesterApplet.KEYPAIR_REMOTE, ECTesterApplet.EXPORT_FALSE, EC_Consts.TRANSFORMATION_NONE, kaType);
+ Command ecdh = new Command.ECDH(this.card, CardConsts.KEYPAIR_LOCAL, CardConsts.KEYPAIR_REMOTE, CardConsts.EXPORT_FALSE, EC_Consts.TRANSFORMATION_NONE, kaType);
Test ka = runTest(CommandTest.expect(ecdh, ExpectedValue.SUCCESS));
- Test kaCompressed = runTest(CommandTest.expect(new Command.ECDH(this.card, ECTesterApplet.KEYPAIR_LOCAL, ECTesterApplet.KEYPAIR_REMOTE, ECTesterApplet.EXPORT_FALSE, EC_Consts.TRANSFORMATION_COMPRESS, kaType), ExpectedValue.SUCCESS));
+ Test kaCompressed = runTest(CommandTest.expect(new Command.ECDH(this.card, CardConsts.KEYPAIR_LOCAL, CardConsts.KEYPAIR_REMOTE, CardConsts.EXPORT_FALSE, EC_Consts.TRANSFORMATION_COMPRESS, kaType), ExpectedValue.SUCCESS));
String kaDesc = "Test of the " + CardUtil.getKATypeString(kaType) + " KeyAgreement.";
Function<Test[], Result> kaCallback = (tests) -> {
@@ -101,7 +100,7 @@ public class CardDefaultSuite extends CardTestSuite {
for (byte sigType : EC_Consts.SIG_TYPES) {
Test allocate = runTest(CommandTest.expect(new Command.AllocateSignature(this.card, sigType), ExpectedValue.SUCCESS));
if (allocate.ok()) {
- Command ecdsa = new Command.ECDSA(this.card, ECTesterApplet.KEYPAIR_LOCAL, sigType, ECTesterApplet.EXPORT_FALSE, null);
+ Command ecdsa = new Command.ECDSA(this.card, CardConsts.KEYPAIR_LOCAL, sigType, CardConsts.EXPORT_FALSE, null);
Test expect = runTest(CommandTest.expect(ecdsa, ExpectedValue.SUCCESS));
String signDesc = "Test of the " + CardUtil.getSigTypeString(sigType) + " signature.";
@@ -112,10 +111,10 @@ public class CardDefaultSuite extends CardTestSuite {
Test compound;
if (expect.ok()) {
- Command ecdsaSign = new Command.ECDSA_sign(this.card, ECTesterApplet.KEYPAIR_LOCAL, sigType, ECTesterApplet.EXPORT_TRUE, sigData);
+ Command ecdsaSign = new Command.ECDSA_sign(this.card, CardConsts.KEYPAIR_LOCAL, sigType, CardConsts.EXPORT_TRUE, sigData);
PerformanceTest signTest = runTest(PerformanceTest.repeat(this.card, "Sign", ecdsaSign, 10));
byte[] signature = signTest.getResponses()[0].getParam(0);
- Command ecdsaVerify = new Command.ECDSA_verify(this.card, ECTesterApplet.KEYPAIR_LOCAL, sigType, sigData, signature);
+ Command ecdsaVerify = new Command.ECDSA_verify(this.card, CardConsts.KEYPAIR_LOCAL, sigType, sigData, signature);
PerformanceTest verifyTest = runTest(PerformanceTest.repeat(this.card, "Verify", ecdsaVerify, 10));
compound = runTest(CompoundTest.all(ExpectedValue.SUCCESS, signDesc, allocate, expect, signTest, verifyTest));
} else {
diff --git a/src/cz/crcs/ectester/reader/test/CardDegenerateSuite.java b/reader/src/main/java/cz/crcs/ectester/reader/test/CardDegenerateSuite.java
index f2e73b6..e2c07da 100644
--- a/src/cz/crcs/ectester/reader/test/CardDegenerateSuite.java
+++ b/reader/src/main/java/cz/crcs/ectester/reader/test/CardDegenerateSuite.java
@@ -1,13 +1,13 @@
package cz.crcs.ectester.reader.test;
-import cz.crcs.ectester.applet.ECTesterApplet;
-import cz.crcs.ectester.applet.EC_Consts;
+import cz.crcs.ectester.common.ec.EC_Consts;
import cz.crcs.ectester.common.ec.EC_Curve;
import cz.crcs.ectester.common.ec.EC_Key;
import cz.crcs.ectester.common.output.TestWriter;
import cz.crcs.ectester.common.test.CompoundTest;
import cz.crcs.ectester.common.test.Result;
import cz.crcs.ectester.common.test.Test;
+import cz.crcs.ectester.common.util.CardConsts;
import cz.crcs.ectester.common.util.CardUtil;
import cz.crcs.ectester.data.EC_Store;
import cz.crcs.ectester.reader.CardMngr;
@@ -36,22 +36,22 @@ public class CardDegenerateSuite extends CardTestSuite {
EC_Curve curve = e.getKey();
List<EC_Key.Public> keys = e.getValue();
- Test allocate = runTest(CommandTest.expect(new Command.Allocate(this.card, ECTesterApplet.KEYPAIR_BOTH, curve.getBits(), curve.getField()), Result.ExpectedValue.SUCCESS));
+ Test allocate = runTest(CommandTest.expect(new Command.Allocate(this.card, CardConsts.KEYPAIR_BOTH, curve.getBits(), curve.getField()), Result.ExpectedValue.SUCCESS));
if (!allocate.ok()) {
doTest(CompoundTest.all(Result.ExpectedValue.SUCCESS, "No support for " + curve.getId() + ".", allocate));
continue;
}
- Test set = CommandTest.expect(new Command.Set(this.card, ECTesterApplet.KEYPAIR_BOTH, EC_Consts.CURVE_external, curve.getParams(), curve.flatten()), Result.ExpectedValue.SUCCESS);
- Test generate = CommandTest.expect(new Command.Generate(this.card, ECTesterApplet.KEYPAIR_LOCAL), Result.ExpectedValue.SUCCESS);
+ Test set = CommandTest.expect(new Command.Set(this.card, CardConsts.KEYPAIR_BOTH, EC_Consts.CURVE_external, curve.getParams(), curve.flatten()), Result.ExpectedValue.SUCCESS);
+ Test generate = CommandTest.expect(new Command.Generate(this.card, CardConsts.KEYPAIR_LOCAL), Result.ExpectedValue.SUCCESS);
Test prepare = CompoundTest.all(Result.ExpectedValue.SUCCESS, "Prepare and generate keypair on " + curve.getId() + ".", allocate, set, generate);
List<Test> ecdhTests = new LinkedList<>();
for (EC_Key.Public pub : keys) {
- Test setPub = CommandTest.expect(new Command.Set(this.card, ECTesterApplet.KEYPAIR_REMOTE, EC_Consts.CURVE_external, pub.getParams(), pub.flatten()), Result.ExpectedValue.FAILURE);
- Test ecdh = CommandTest.expect(new Command.ECDH(this.card, ECTesterApplet.KEYPAIR_REMOTE, ECTesterApplet.KEYPAIR_LOCAL, ECTesterApplet.EXPORT_FALSE, EC_Consts.TRANSFORMATION_NONE, EC_Consts.KeyAgreement_ALG_EC_SVDP_DH), Result.ExpectedValue.FAILURE, "Card correctly rejected point on degenerate curve.", "Card incorrectly accepted point on degenerate curve.");
+ Test setPub = CommandTest.expect(new Command.Set(this.card, CardConsts.KEYPAIR_REMOTE, EC_Consts.CURVE_external, pub.getParams(), pub.flatten()), Result.ExpectedValue.FAILURE);
+ Test ecdh = CommandTest.expect(new Command.ECDH(this.card, CardConsts.KEYPAIR_REMOTE, CardConsts.KEYPAIR_LOCAL, CardConsts.EXPORT_FALSE, EC_Consts.TRANSFORMATION_NONE, EC_Consts.KeyAgreement_ALG_EC_SVDP_DH), Result.ExpectedValue.FAILURE, "Card correctly rejected point on degenerate curve.", "Card incorrectly accepted point on degenerate curve.");
Test objectEcdh = CompoundTest.any(Result.ExpectedValue.SUCCESS, CardUtil.getKATypeString(EC_Consts.KeyAgreement_ALG_EC_SVDP_DH) + " test with degenerate pubkey.", setPub, ecdh);
- Command ecdhCommand = new Command.ECDH_direct(this.card, ECTesterApplet.KEYPAIR_LOCAL, ECTesterApplet.EXPORT_FALSE, EC_Consts.TRANSFORMATION_NONE, EC_Consts.KeyAgreement_ALG_EC_SVDP_DH, pub.flatten());
+ Command ecdhCommand = new Command.ECDH_direct(this.card, CardConsts.KEYPAIR_LOCAL, CardConsts.EXPORT_FALSE, EC_Consts.TRANSFORMATION_NONE, EC_Consts.KeyAgreement_ALG_EC_SVDP_DH, pub.flatten());
Test rawEcdh = CommandTest.expect(ecdhCommand, Result.ExpectedValue.FAILURE, "Card correctly rejected point on degenerate curve.", "Card incorrectly accepted point on degenerate curve.");
ecdhTests.add(CompoundTest.all(Result.ExpectedValue.SUCCESS, pub.getId() + " degenerate key test.", objectEcdh, rawEcdh));
//TODO: actually get the result of ECDH here, as well as export privkey and compare to exponentiation in Fp^*.
diff --git a/src/cz/crcs/ectester/reader/test/CardEdgeCasesSuite.java b/reader/src/main/java/cz/crcs/ectester/reader/test/CardEdgeCasesSuite.java
index 9257b3d..0a82da3 100644
--- a/src/cz/crcs/ectester/reader/test/CardEdgeCasesSuite.java
+++ b/reader/src/main/java/cz/crcs/ectester/reader/test/CardEdgeCasesSuite.java
@@ -1,25 +1,20 @@
package cz.crcs.ectester.reader.test;
-import cz.crcs.ectester.applet.ECTesterApplet;
-import cz.crcs.ectester.applet.EC_Consts;
-import cz.crcs.ectester.common.ec.EC_Curve;
-import cz.crcs.ectester.common.ec.EC_KAResult;
-import cz.crcs.ectester.common.ec.EC_Key;
-import cz.crcs.ectester.common.ec.EC_Params;
+import cz.crcs.ectester.common.ec.*;
import cz.crcs.ectester.common.output.TestWriter;
import cz.crcs.ectester.common.test.CompoundTest;
import cz.crcs.ectester.common.test.Result;
import cz.crcs.ectester.common.test.Test;
import cz.crcs.ectester.common.test.TestCallback;
import cz.crcs.ectester.common.util.ByteUtil;
+import cz.crcs.ectester.common.util.CardConsts;
+import cz.crcs.ectester.common.util.CardUtil;
import cz.crcs.ectester.common.util.ECUtil;
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 cz.crcs.ectester.reader.response.Response;
-import javacard.security.CryptoException;
-import javacard.security.KeyPair;
import java.math.BigDecimal;
import java.math.BigInteger;
@@ -61,8 +56,8 @@ public class CardEdgeCasesSuite extends CardTestSuite {
EC_Curve curve = c.getKey();
List<Test> curveTests = new LinkedList<>();
- Test allocate = CommandTest.expect(new Command.Allocate(this.card, ECTesterApplet.KEYPAIR_BOTH, curve.getBits(), curve.getField()), Result.ExpectedValue.SUCCESS);
- Test set = CommandTest.expect(new Command.Set(this.card, ECTesterApplet.KEYPAIR_BOTH, EC_Consts.CURVE_external, curve.getParams(), curve.flatten()), Result.ExpectedValue.SUCCESS);
+ Test allocate = CommandTest.expect(new Command.Allocate(this.card, CardConsts.KEYPAIR_BOTH, curve.getBits(), curve.getField()), Result.ExpectedValue.SUCCESS);
+ Test set = CommandTest.expect(new Command.Set(this.card, CardConsts.KEYPAIR_BOTH, EC_Consts.CURVE_external, curve.getParams(), curve.flatten()), Result.ExpectedValue.SUCCESS);
Test prepareCurve = CompoundTest.greedyAll(Result.ExpectedValue.SUCCESS, "Prepare curve", allocate, set);
List<EC_KAResult> values = c.getValue();
@@ -74,14 +69,14 @@ public class CardEdgeCasesSuite extends CardTestSuite {
EC_Key.Private privkey = EC_Store.getInstance().getObject(EC_Key.Private.class, privkeyId);
EC_Key.Public pubkey = EC_Store.getInstance().getObject(EC_Key.Public.class, pubkeyId);
- Test setPrivkey = CommandTest.expect(new Command.Set(this.card, ECTesterApplet.KEYPAIR_LOCAL, EC_Consts.CURVE_external, privkey.getParams(), privkey.flatten()), Result.ExpectedValue.SUCCESS);
- Test setPubkey = CommandTest.expect(new Command.Set(this.card, ECTesterApplet.KEYPAIR_REMOTE, EC_Consts.CURVE_external, pubkey.getParams(), pubkey.flatten()), Result.ExpectedValue.SUCCESS);
- Test ecdhPreTest = CommandTest.expect(new Command.ECDH(this.card, ECTesterApplet.KEYPAIR_REMOTE, ECTesterApplet.KEYPAIR_LOCAL, ECTesterApplet.EXPORT_FALSE, EC_Consts.TRANSFORMATION_NONE, EC_Consts.KeyAgreement_ALG_EC_SVDP_DH), Result.ExpectedValue.SUCCESS);
- Test ecdh = CommandTest.function(new Command.ECDH(this.card, ECTesterApplet.KEYPAIR_REMOTE, ECTesterApplet.KEYPAIR_LOCAL, ECTesterApplet.EXPORT_TRUE, EC_Consts.TRANSFORMATION_NONE, value.getJavaCardKA()), new TestCallback<CommandTestable>() {
+ Test setPrivkey = CommandTest.expect(new Command.Set(this.card, CardConsts.KEYPAIR_LOCAL, EC_Consts.CURVE_external, privkey.getParams(), privkey.flatten()), Result.ExpectedValue.SUCCESS);
+ Test setPubkey = CommandTest.expect(new Command.Set(this.card, CardConsts.KEYPAIR_REMOTE, EC_Consts.CURVE_external, pubkey.getParams(), pubkey.flatten()), Result.ExpectedValue.SUCCESS);
+ Test ecdhPreTest = CommandTest.expect(new Command.ECDH(this.card, CardConsts.KEYPAIR_REMOTE, CardConsts.KEYPAIR_LOCAL, CardConsts.EXPORT_FALSE, EC_Consts.TRANSFORMATION_NONE, EC_Consts.KeyAgreement_ALG_EC_SVDP_DH), Result.ExpectedValue.SUCCESS);
+ Test ecdh = CommandTest.function(new Command.ECDH(this.card, CardConsts.KEYPAIR_REMOTE, CardConsts.KEYPAIR_LOCAL, CardConsts.EXPORT_TRUE, EC_Consts.TRANSFORMATION_NONE, value.getJavaCardKA()), new TestCallback<CommandTestable>() {
@Override
public Result apply(CommandTestable testable) {
Response.ECDH dh = (Response.ECDH) testable.getResponse();
- if (dh.getSW(0) == CryptoException.NO_SUCH_ALGORITHM) {
+ if (dh.getSW(0) == CardUtil.CryptoException.NO_SUCH_ALGORITHM) {
return new Result(Result.Value.SUCCESS, "ECDH algorithm unsupported.");
}
if (!dh.successful())
@@ -120,11 +115,11 @@ public class CardEdgeCasesSuite extends CardTestSuite {
EC_Curve curve = EC_Store.getInstance().getObject(EC_Curve.class, openssl_bug.getCurve());
EC_Key.Private skey = EC_Store.getInstance().getObject(EC_Key.Private.class, openssl_bug.getOtherKey());
EC_Key.Public pkey = EC_Store.getInstance().getObject(EC_Key.Public.class, openssl_bug.getOneKey());
- Test key = CommandTest.expect(new Command.Allocate(this.card, ECTesterApplet.KEYPAIR_BOTH, curve.getBits(), KeyPair.ALG_EC_FP), Result.ExpectedValue.SUCCESS);
- Test set = CommandTest.expect(new Command.Set(this.card, ECTesterApplet.KEYPAIR_BOTH, EC_Consts.CURVE_external, curve.getParams(), curve.flatten()), Result.ExpectedValue.SUCCESS);
- Test setPrivate = CommandTest.expect(new Command.Set(this.card, ECTesterApplet.KEYPAIR_LOCAL, EC_Consts.CURVE_external, EC_Consts.PARAMETER_S, skey.flatten(EC_Consts.PARAMETER_S)), Result.ExpectedValue.SUCCESS);
- Test setPublic = CommandTest.expect(new Command.Set(this.card, ECTesterApplet.KEYPAIR_REMOTE, EC_Consts.CURVE_external, EC_Consts.PARAMETER_W, pkey.flatten(EC_Consts.PARAMETER_W)), Result.ExpectedValue.SUCCESS);
- Test ecdh = CommandTest.function(new Command.ECDH(this.card, ECTesterApplet.KEYPAIR_REMOTE, ECTesterApplet.KEYPAIR_LOCAL, ECTesterApplet.EXPORT_TRUE, EC_Consts.TRANSFORMATION_NONE, openssl_bug.getJavaCardKA()), new TestCallback<CommandTestable>() {
+ Test key = CommandTest.expect(new Command.Allocate(this.card, CardConsts.KEYPAIR_BOTH, curve.getBits(), EC_Consts.ALG_EC_FP), Result.ExpectedValue.SUCCESS);
+ Test set = CommandTest.expect(new Command.Set(this.card, CardConsts.KEYPAIR_BOTH, EC_Consts.CURVE_external, curve.getParams(), curve.flatten()), Result.ExpectedValue.SUCCESS);
+ Test setPrivate = CommandTest.expect(new Command.Set(this.card, CardConsts.KEYPAIR_LOCAL, EC_Consts.CURVE_external, EC_Consts.PARAMETER_S, skey.flatten(EC_Consts.PARAMETER_S)), Result.ExpectedValue.SUCCESS);
+ Test setPublic = CommandTest.expect(new Command.Set(this.card, CardConsts.KEYPAIR_REMOTE, EC_Consts.CURVE_external, EC_Consts.PARAMETER_W, pkey.flatten(EC_Consts.PARAMETER_W)), Result.ExpectedValue.SUCCESS);
+ Test ecdh = CommandTest.function(new Command.ECDH(this.card, CardConsts.KEYPAIR_REMOTE, CardConsts.KEYPAIR_LOCAL, CardConsts.EXPORT_TRUE, EC_Consts.TRANSFORMATION_NONE, openssl_bug.getJavaCardKA()), new TestCallback<CommandTestable>() {
@Override
public Result apply(CommandTestable testable) {
Response.ECDH dh = (Response.ECDH) testable.getResponse();
@@ -143,25 +138,25 @@ public class CardEdgeCasesSuite extends CardTestSuite {
}
Map<String, EC_Curve> curveMap = EC_Store.getInstance().getObjects(EC_Curve.class, "secg");
- List<EC_Curve> curves = curveMap.entrySet().stream().filter((e) -> e.getKey().endsWith("r1") && e.getValue().getField() == KeyPair.ALG_EC_FP).map(Map.Entry::getValue).collect(Collectors.toList());
+ List<EC_Curve> curves = curveMap.entrySet().stream().filter((e) -> e.getKey().endsWith("r1") && e.getValue().getField() == EC_Consts.ALG_EC_FP).map(Map.Entry::getValue).collect(Collectors.toList());
curves.add(EC_Store.getInstance().getObject(EC_Curve.class, "cofactor/cofactor128p2"));
curves.add(EC_Store.getInstance().getObject(EC_Curve.class, "cofactor/cofactor160p4"));
Random rand = new Random();
for (EC_Curve curve : curves) {
- Test key = runTest(CommandTest.expect(new Command.Allocate(this.card, ECTesterApplet.KEYPAIR_BOTH, curve.getBits(), KeyPair.ALG_EC_FP), Result.ExpectedValue.SUCCESS));
+ Test key = runTest(CommandTest.expect(new Command.Allocate(this.card, CardConsts.KEYPAIR_BOTH, curve.getBits(), EC_Consts.ALG_EC_FP), Result.ExpectedValue.SUCCESS));
if (!key.ok()) {
doTest(CompoundTest.all(Result.ExpectedValue.FAILURE, "No support for " + curve.getBits() + "b " + curve.getId() + ".", key));
continue;
}
- Test set = CommandTest.expect(new Command.Set(this.card, ECTesterApplet.KEYPAIR_BOTH, EC_Consts.CURVE_external, curve.getParams(), curve.flatten()), Result.ExpectedValue.SUCCESS);
- Test generate = CommandTest.expect(new Command.Generate(this.card, ECTesterApplet.KEYPAIR_LOCAL), Result.ExpectedValue.SUCCESS);
- CommandTest export = CommandTest.expect(new Command.Export(this.card, ECTesterApplet.KEYPAIR_LOCAL, EC_Consts.KEY_PUBLIC, EC_Consts.PARAMETER_W), Result.ExpectedValue.SUCCESS);
+ Test set = CommandTest.expect(new Command.Set(this.card, CardConsts.KEYPAIR_BOTH, EC_Consts.CURVE_external, curve.getParams(), curve.flatten()), Result.ExpectedValue.SUCCESS);
+ Test generate = CommandTest.expect(new Command.Generate(this.card, CardConsts.KEYPAIR_LOCAL), Result.ExpectedValue.SUCCESS);
+ CommandTest export = CommandTest.expect(new Command.Export(this.card, CardConsts.KEYPAIR_LOCAL, EC_Consts.KEY_PUBLIC, EC_Consts.PARAMETER_W), Result.ExpectedValue.SUCCESS);
Test setup = runTest(CompoundTest.all(Result.ExpectedValue.SUCCESS, "KeyPair setup.", key, set, generate, export));
/*
byte[] pParam = curve.getParam(EC_Consts.PARAMETER_FP)[0];
BigInteger p = new BigInteger(1, pParam);
- byte[] wParam = ((Response.Export) export.getResponse()).getParameter(ECTesterApplet.KEYPAIR_LOCAL, EC_Consts.PARAMETER_W);
+ byte[] wParam = ((Response.Export) export.getResponse()).getParameter(CardConsts.KEYPAIR_LOCAL, EC_Consts.PARAMETER_W);
byte[] xValue = new byte[(wParam.length - 1) / 2];
byte[] yValue = new byte[(wParam.length - 1) / 2];
System.arraycopy(wParam, 1, xValue, 0, xValue.length);
@@ -171,11 +166,11 @@ public class CardEdgeCasesSuite extends CardTestSuite {
byte[] newY = ECUtil.toByteArray(negY, curve.getBits());
EC_Params negYParams = new EC_Params(EC_Consts.PARAMETER_W, new byte[][]{xValue, newY});
- Test negYTest = ecdhTest(new Command.Set(this.card, ECTesterApplet.KEYPAIR_LOCAL, EC_Consts.CURVE_external, negYParams.getParams(), negYParams.flatten()), "ECDH with pubkey negated.", Result.ExpectedValue.FAILURE, Result.ExpectedValue.FAILURE);
+ Test negYTest = ecdhTest(new Command.Set(this.card, CardConsts.KEYPAIR_LOCAL, EC_Consts.CURVE_external, negYParams.getParams(), negYParams.flatten()), "ECDH with pubkey negated.", Result.ExpectedValue.FAILURE, Result.ExpectedValue.FAILURE);
*/
- Test zeroS = ecdhTest(new Command.Transform(this.card, ECTesterApplet.KEYPAIR_REMOTE, EC_Consts.CURVE_external, EC_Consts.PARAMETER_S, EC_Consts.TRANSFORMATION_ZERO), "ECDH with S = 0.", Result.ExpectedValue.FAILURE, Result.ExpectedValue.FAILURE);
- Test oneS = ecdhTest(new Command.Transform(this.card, ECTesterApplet.KEYPAIR_REMOTE, EC_Consts.CURVE_external, EC_Consts.PARAMETER_S, EC_Consts.TRANSFORMATION_ONE), "ECDH with S = 1.", Result.ExpectedValue.FAILURE, Result.ExpectedValue.FAILURE);
+ Test zeroS = ecdhTest(new Command.Transform(this.card, CardConsts.KEYPAIR_REMOTE, EC_Consts.CURVE_external, EC_Consts.PARAMETER_S, EC_Consts.TRANSFORMATION_ZERO), "ECDH with S = 0.", Result.ExpectedValue.FAILURE, Result.ExpectedValue.FAILURE);
+ Test oneS = ecdhTest(new Command.Transform(this.card, CardConsts.KEYPAIR_REMOTE, EC_Consts.CURVE_external, EC_Consts.PARAMETER_S, EC_Consts.TRANSFORMATION_ONE), "ECDH with S = 1.", Result.ExpectedValue.FAILURE, Result.ExpectedValue.FAILURE);
byte[] rParam = curve.getParam(EC_Consts.PARAMETER_R)[0];
BigInteger R = new BigInteger(1, rParam);
@@ -194,31 +189,31 @@ public class CardEdgeCasesSuite extends CardTestSuite {
BigInteger alternateOther = alternate.xor(full);
EC_Params alternateParams = makeParams(alternate);
- Test alternateS = ecdhTest(new Command.Set(this.card, ECTesterApplet.KEYPAIR_REMOTE, EC_Consts.CURVE_external, alternateParams.getParams(), alternateParams.flatten()), "ECDH with S = 101010101...01010.", Result.ExpectedValue.SUCCESS, Result.ExpectedValue.SUCCESS);
+ Test alternateS = ecdhTest(new Command.Set(this.card, CardConsts.KEYPAIR_REMOTE, EC_Consts.CURVE_external, alternateParams.getParams(), alternateParams.flatten()), "ECDH with S = 101010101...01010.", Result.ExpectedValue.SUCCESS, Result.ExpectedValue.SUCCESS);
EC_Params alternateOtherParams = makeParams(alternateOther);
- Test alternateOtherS = ecdhTest(new Command.Set(this.card, ECTesterApplet.KEYPAIR_REMOTE, EC_Consts.CURVE_external, alternateOtherParams.getParams(), alternateOtherParams.flatten()), "ECDH with S = 010101010...10101.", Result.ExpectedValue.SUCCESS, Result.ExpectedValue.SUCCESS);
+ Test alternateOtherS = ecdhTest(new Command.Set(this.card, CardConsts.KEYPAIR_REMOTE, EC_Consts.CURVE_external, alternateOtherParams.getParams(), alternateOtherParams.flatten()), "ECDH with S = 010101010...10101.", Result.ExpectedValue.SUCCESS, Result.ExpectedValue.SUCCESS);
EC_Params fullParams = makeParams(full);
- Test fullS = ecdhTest(new Command.Set(this.card, ECTesterApplet.KEYPAIR_REMOTE, EC_Consts.CURVE_external, fullParams.getParams(), fullParams.flatten()), "ECDH with S = 111111111...11111 (but < r).", Result.ExpectedValue.SUCCESS, Result.ExpectedValue.SUCCESS);
+ Test fullS = ecdhTest(new Command.Set(this.card, CardConsts.KEYPAIR_REMOTE, EC_Consts.CURVE_external, fullParams.getParams(), fullParams.flatten()), "ECDH with S = 111111111...11111 (but < r).", Result.ExpectedValue.SUCCESS, Result.ExpectedValue.SUCCESS);
EC_Params smallerParams = makeParams(smaller);
- Test smallerS = ecdhTest(new Command.Set(this.card, ECTesterApplet.KEYPAIR_REMOTE, EC_Consts.CURVE_external, smallerParams.getParams(), smallerParams.flatten()), "ECDH with S < r.", Result.ExpectedValue.SUCCESS, Result.ExpectedValue.SUCCESS);
+ Test smallerS = ecdhTest(new Command.Set(this.card, CardConsts.KEYPAIR_REMOTE, EC_Consts.CURVE_external, smallerParams.getParams(), smallerParams.flatten()), "ECDH with S < r.", Result.ExpectedValue.SUCCESS, Result.ExpectedValue.SUCCESS);
EC_Params exactParams = makeParams(R);
- Test exactS = ecdhTest(new Command.Set(this.card, ECTesterApplet.KEYPAIR_REMOTE, EC_Consts.CURVE_external, exactParams.getParams(), exactParams.flatten()), "ECDH with S = r.", Result.ExpectedValue.FAILURE, Result.ExpectedValue.FAILURE);
+ Test exactS = ecdhTest(new Command.Set(this.card, CardConsts.KEYPAIR_REMOTE, EC_Consts.CURVE_external, exactParams.getParams(), exactParams.flatten()), "ECDH with S = r.", Result.ExpectedValue.FAILURE, Result.ExpectedValue.FAILURE);
EC_Params largerParams = makeParams(larger);
- Test largerS = ecdhTest(new Command.Set(this.card, ECTesterApplet.KEYPAIR_REMOTE, EC_Consts.CURVE_external, largerParams.getParams(), largerParams.flatten()), "ECDH with S > r.", Result.ExpectedValue.ANY, Result.ExpectedValue.ANY);
+ Test largerS = ecdhTest(new Command.Set(this.card, CardConsts.KEYPAIR_REMOTE, EC_Consts.CURVE_external, largerParams.getParams(), largerParams.flatten()), "ECDH with S > r.", Result.ExpectedValue.ANY, Result.ExpectedValue.ANY);
BigInteger rm1 = R.subtract(BigInteger.ONE);
BigInteger rp1 = R.add(BigInteger.ONE);
EC_Params rm1Params = makeParams(rm1);
- Test rm1S = ecdhTest(new Command.Set(this.card, ECTesterApplet.KEYPAIR_REMOTE, EC_Consts.CURVE_external, rm1Params.getParams(), rm1Params.flatten()), "ECDH with S = r - 1.", Result.ExpectedValue.SUCCESS, Result.ExpectedValue.SUCCESS);
+ Test rm1S = ecdhTest(new Command.Set(this.card, CardConsts.KEYPAIR_REMOTE, EC_Consts.CURVE_external, rm1Params.getParams(), rm1Params.flatten()), "ECDH with S = r - 1.", Result.ExpectedValue.SUCCESS, Result.ExpectedValue.SUCCESS);
EC_Params rp1Params = makeParams(rp1);
- Test rp1S = ecdhTest(new Command.Set(this.card, ECTesterApplet.KEYPAIR_REMOTE, EC_Consts.CURVE_external, rp1Params.getParams(), rp1Params.flatten()), "ECDH with S = r + 1.", Result.ExpectedValue.ANY, Result.ExpectedValue.ANY);
+ Test rp1S = ecdhTest(new Command.Set(this.card, CardConsts.KEYPAIR_REMOTE, EC_Consts.CURVE_external, rp1Params.getParams(), rp1Params.flatten()), "ECDH with S = r + 1.", Result.ExpectedValue.ANY, Result.ExpectedValue.ANY);
byte[] k = curve.getParam(EC_Consts.PARAMETER_K)[0];
BigInteger K = new BigInteger(1, k);
@@ -229,13 +224,13 @@ public class CardEdgeCasesSuite extends CardTestSuite {
Result.ExpectedValue kExpected = K.equals(BigInteger.ONE) ? Result.ExpectedValue.SUCCESS : Result.ExpectedValue.FAILURE;
EC_Params krParams = makeParams(kr);
- Test krS /*ONE!*/ = ecdhTest(new Command.Set(this.card, ECTesterApplet.KEYPAIR_REMOTE, EC_Consts.CURVE_external, krParams.getParams(), krParams.flatten()), "ECDH with S = k * r.", Result.ExpectedValue.FAILURE, Result.ExpectedValue.FAILURE);
+ Test krS /*ONE!*/ = ecdhTest(new Command.Set(this.card, CardConsts.KEYPAIR_REMOTE, EC_Consts.CURVE_external, krParams.getParams(), krParams.flatten()), "ECDH with S = k * r.", Result.ExpectedValue.FAILURE, Result.ExpectedValue.FAILURE);
EC_Params krm1Params = makeParams(krm1);
- Test krm1S = ecdhTest(new Command.Set(this.card, ECTesterApplet.KEYPAIR_REMOTE, EC_Consts.CURVE_external, krm1Params.getParams(), krm1Params.flatten()), "ECDH with S = (k * r) - 1.", kExpected, kExpected);
+ Test krm1S = ecdhTest(new Command.Set(this.card, CardConsts.KEYPAIR_REMOTE, EC_Consts.CURVE_external, krm1Params.getParams(), krm1Params.flatten()), "ECDH with S = (k * r) - 1.", kExpected, kExpected);
EC_Params krp1Params = makeParams(krp1);
- Test krp1S = ecdhTest(new Command.Set(this.card, ECTesterApplet.KEYPAIR_REMOTE, EC_Consts.CURVE_external, krp1Params.getParams(), krp1Params.flatten()), "ECDH with S = (k * r) + 1.", Result.ExpectedValue.ANY, Result.ExpectedValue.ANY);
+ Test krp1S = ecdhTest(new Command.Set(this.card, CardConsts.KEYPAIR_REMOTE, EC_Consts.CURVE_external, krp1Params.getParams(), krp1Params.flatten()), "ECDH with S = (k * r) + 1.", Result.ExpectedValue.ANY, Result.ExpectedValue.ANY);
if (cfg.cleanup) {
Test cleanup = CommandTest.expect(new Command.Cleanup(this.card), Result.ExpectedValue.ANY);
@@ -273,20 +268,20 @@ public class CardEdgeCasesSuite extends CardTestSuite {
Arrays.sort(ps);
Arrays.sort(zeros);
- Test key = runTest(CommandTest.expect(new Command.Allocate(this.card, ECTesterApplet.KEYPAIR_BOTH, secp160r1.getBits(), KeyPair.ALG_EC_FP), Result.ExpectedValue.SUCCESS));
+ Test key = runTest(CommandTest.expect(new Command.Allocate(this.card, CardConsts.KEYPAIR_BOTH, secp160r1.getBits(), EC_Consts.ALG_EC_FP), Result.ExpectedValue.SUCCESS));
if (!key.ok()) {
doTest(CompoundTest.all(Result.ExpectedValue.FAILURE, "No support for " + secp160r1.getBits() + "b secp160r1.", key));
return;
}
- Test set = CommandTest.expect(new Command.Set(this.card, ECTesterApplet.KEYPAIR_BOTH, EC_Consts.CURVE_external, secp160r1.getParams(), secp160r1.flatten()), Result.ExpectedValue.SUCCESS);
- Test generate = CommandTest.expect(new Command.Generate(this.card, ECTesterApplet.KEYPAIR_LOCAL), Result.ExpectedValue.SUCCESS);
+ Test set = CommandTest.expect(new Command.Set(this.card, CardConsts.KEYPAIR_BOTH, EC_Consts.CURVE_external, secp160r1.getParams(), secp160r1.flatten()), Result.ExpectedValue.SUCCESS);
+ Test generate = CommandTest.expect(new Command.Generate(this.card, CardConsts.KEYPAIR_LOCAL), Result.ExpectedValue.SUCCESS);
Test setup = CompoundTest.all(Result.ExpectedValue.SUCCESS, "KeyPair setup.", key, set, generate);
Test[] zeroTests = new Test[n];
int i = 0;
for (BigInteger nearZero : zeros) {
EC_Params params = makeParams(nearZero);
- zeroTests[i++] = ecdhTestBoth(new Command.Set(this.card, ECTesterApplet.KEYPAIR_REMOTE, EC_Consts.CURVE_external, params.getParams(), params.flatten()), nearZero.toString(16), Result.ExpectedValue.SUCCESS, Result.ExpectedValue.SUCCESS);
+ zeroTests[i++] = ecdhTestBoth(new Command.Set(this.card, CardConsts.KEYPAIR_REMOTE, EC_Consts.CURVE_external, params.getParams(), params.flatten()), nearZero.toString(16), Result.ExpectedValue.SUCCESS, Result.ExpectedValue.SUCCESS);
}
Test zeroTest = CompoundTest.all(Result.ExpectedValue.SUCCESS, "Near zero.", zeroTests);
@@ -294,7 +289,7 @@ public class CardEdgeCasesSuite extends CardTestSuite {
i = 0;
for (BigInteger nearP : ps) {
EC_Params params = makeParams(nearP);
- pTests[i++] = ecdhTestBoth(new Command.Set(this.card, ECTesterApplet.KEYPAIR_REMOTE, EC_Consts.CURVE_external, params.getParams(), params.flatten()), nearP.toString(16) + (nearP.compareTo(p) > 0 ? " (>p)" : " (<=p)"), Result.ExpectedValue.SUCCESS, Result.ExpectedValue.SUCCESS);
+ pTests[i++] = ecdhTestBoth(new Command.Set(this.card, CardConsts.KEYPAIR_REMOTE, EC_Consts.CURVE_external, params.getParams(), params.flatten()), nearP.toString(16) + (nearP.compareTo(p) > 0 ? " (>p)" : " (<=p)"), Result.ExpectedValue.SUCCESS, Result.ExpectedValue.SUCCESS);
}
Test pTest = CompoundTest.all(Result.ExpectedValue.SUCCESS, "Near p.", pTests);
@@ -303,9 +298,9 @@ public class CardEdgeCasesSuite extends CardTestSuite {
for (BigInteger nearR : rs) {
EC_Params params = makeParams(nearR);
if (nearR.compareTo(r) >= 0) {
- rTests[i++] = ecdhTest(new Command.Set(this.card, ECTesterApplet.KEYPAIR_REMOTE, EC_Consts.CURVE_external, params.getParams(), params.flatten()), nearR.toString(16) + " (>=r)", Result.ExpectedValue.FAILURE, Result.ExpectedValue.FAILURE);
+ rTests[i++] = ecdhTest(new Command.Set(this.card, CardConsts.KEYPAIR_REMOTE, EC_Consts.CURVE_external, params.getParams(), params.flatten()), nearR.toString(16) + " (>=r)", Result.ExpectedValue.FAILURE, Result.ExpectedValue.FAILURE);
} else {
- rTests[i++] = ecdhTestBoth(new Command.Set(this.card, ECTesterApplet.KEYPAIR_REMOTE, EC_Consts.CURVE_external, params.getParams(), params.flatten()), nearR.toString(16) + " (<r)", Result.ExpectedValue.SUCCESS, Result.ExpectedValue.SUCCESS);
+ rTests[i++] = ecdhTestBoth(new Command.Set(this.card, CardConsts.KEYPAIR_REMOTE, EC_Consts.CURVE_external, params.getParams(), params.flatten()), nearR.toString(16) + " (<r)", Result.ExpectedValue.SUCCESS, Result.ExpectedValue.SUCCESS);
}
}
Test rTest = CompoundTest.all(Result.ExpectedValue.SUCCESS, "Near r.", rTests);
@@ -314,14 +309,14 @@ public class CardEdgeCasesSuite extends CardTestSuite {
private Test ecdhTestBoth(Command setPriv, String desc, Result.ExpectedValue setExpect, Result.ExpectedValue ecdhExpect) {
Test set = CommandTest.expect(setPriv, setExpect);
- Test ecdh = CommandTest.expect(new Command.ECDH(this.card, ECTesterApplet.KEYPAIR_LOCAL, ECTesterApplet.KEYPAIR_REMOTE, ECTesterApplet.EXPORT_TRUE, EC_Consts.TRANSFORMATION_NONE, EC_Consts.KeyAgreement_ALG_EC_SVDP_DH), ecdhExpect);
+ Test ecdh = CommandTest.expect(new Command.ECDH(this.card, CardConsts.KEYPAIR_LOCAL, CardConsts.KEYPAIR_REMOTE, CardConsts.EXPORT_TRUE, EC_Consts.TRANSFORMATION_NONE, EC_Consts.KeyAgreement_ALG_EC_SVDP_DH), ecdhExpect);
return CompoundTest.all(Result.ExpectedValue.SUCCESS, desc, set, ecdh);
}
private Test ecdhTest(Command setPriv, String desc, Result.ExpectedValue setExpect, Result.ExpectedValue ecdhExpect) {
Test set = CommandTest.expect(setPriv, setExpect);
- Test ecdh = CommandTest.expect(new Command.ECDH(this.card, ECTesterApplet.KEYPAIR_LOCAL, ECTesterApplet.KEYPAIR_REMOTE, ECTesterApplet.EXPORT_TRUE, EC_Consts.TRANSFORMATION_NONE, EC_Consts.KeyAgreement_ALG_EC_SVDP_DH), ecdhExpect);
+ Test ecdh = CommandTest.expect(new Command.ECDH(this.card, CardConsts.KEYPAIR_LOCAL, CardConsts.KEYPAIR_REMOTE, CardConsts.EXPORT_TRUE, EC_Consts.TRANSFORMATION_NONE, EC_Consts.KeyAgreement_ALG_EC_SVDP_DH), ecdhExpect);
return CompoundTest.any(Result.ExpectedValue.SUCCESS, desc, set, ecdh);
}
diff --git a/src/cz/crcs/ectester/reader/test/CardInvalidSuite.java b/reader/src/main/java/cz/crcs/ectester/reader/test/CardInvalidSuite.java
index 5df379e..4657de0 100644
--- a/src/cz/crcs/ectester/reader/test/CardInvalidSuite.java
+++ b/reader/src/main/java/cz/crcs/ectester/reader/test/CardInvalidSuite.java
@@ -1,13 +1,13 @@
package cz.crcs.ectester.reader.test;
-import cz.crcs.ectester.applet.ECTesterApplet;
-import cz.crcs.ectester.applet.EC_Consts;
+import cz.crcs.ectester.common.ec.EC_Consts;
import cz.crcs.ectester.common.ec.EC_Curve;
import cz.crcs.ectester.common.ec.EC_Key;
import cz.crcs.ectester.common.output.TestWriter;
import cz.crcs.ectester.common.test.CompoundTest;
import cz.crcs.ectester.common.test.Result;
import cz.crcs.ectester.common.test.Test;
+import cz.crcs.ectester.common.util.CardConsts;
import cz.crcs.ectester.common.util.CardUtil;
import cz.crcs.ectester.data.EC_Store;
import cz.crcs.ectester.reader.CardMngr;
@@ -40,22 +40,22 @@ public class CardInvalidSuite extends CardTestSuite {
EC_Curve curve = e.getKey();
List<EC_Key.Public> keys = e.getValue();
- Test allocate = runTest(CommandTest.expect(new Command.Allocate(this.card, ECTesterApplet.KEYPAIR_BOTH, curve.getBits(), curve.getField()), ExpectedValue.SUCCESS));
+ Test allocate = runTest(CommandTest.expect(new Command.Allocate(this.card, CardConsts.KEYPAIR_BOTH, curve.getBits(), curve.getField()), ExpectedValue.SUCCESS));
if (!allocate.ok()) {
doTest(CompoundTest.all(Result.ExpectedValue.SUCCESS, "No support for " + curve.getId() + ".", allocate));
continue;
}
- Test set = CommandTest.expect(new Command.Set(this.card, ECTesterApplet.KEYPAIR_BOTH, EC_Consts.CURVE_external, curve.getParams(), curve.flatten()), ExpectedValue.SUCCESS);
- Test generate = CommandTest.expect(new Command.Generate(this.card, ECTesterApplet.KEYPAIR_LOCAL), ExpectedValue.SUCCESS);
+ Test set = CommandTest.expect(new Command.Set(this.card, CardConsts.KEYPAIR_BOTH, EC_Consts.CURVE_external, curve.getParams(), curve.flatten()), ExpectedValue.SUCCESS);
+ Test generate = CommandTest.expect(new Command.Generate(this.card, CardConsts.KEYPAIR_LOCAL), ExpectedValue.SUCCESS);
Test prepare = CompoundTest.all(ExpectedValue.SUCCESS, "Prepare and generate keypair on " + curve.getId() + ".", allocate, set, generate);
List<Test> ecdhTests = new LinkedList<>();
for (EC_Key.Public pub : keys) {
- Test setPub = CommandTest.expect(new Command.Set(this.card, ECTesterApplet.KEYPAIR_REMOTE, EC_Consts.CURVE_external, pub.getParams(), pub.flatten()), Result.ExpectedValue.FAILURE);
- Test ecdh = CommandTest.expect(new Command.ECDH(this.card, ECTesterApplet.KEYPAIR_REMOTE, ECTesterApplet.KEYPAIR_LOCAL, ECTesterApplet.EXPORT_FALSE, EC_Consts.TRANSFORMATION_NONE, EC_Consts.KeyAgreement_ALG_EC_SVDP_DH), Result.ExpectedValue.FAILURE);
+ Test setPub = CommandTest.expect(new Command.Set(this.card, CardConsts.KEYPAIR_REMOTE, EC_Consts.CURVE_external, pub.getParams(), pub.flatten()), Result.ExpectedValue.FAILURE);
+ Test ecdh = CommandTest.expect(new Command.ECDH(this.card, CardConsts.KEYPAIR_REMOTE, CardConsts.KEYPAIR_LOCAL, CardConsts.EXPORT_FALSE, EC_Consts.TRANSFORMATION_NONE, EC_Consts.KeyAgreement_ALG_EC_SVDP_DH), Result.ExpectedValue.FAILURE);
Test objectEcdh = CompoundTest.any(Result.ExpectedValue.SUCCESS, CardUtil.getKATypeString(EC_Consts.KeyAgreement_ALG_EC_SVDP_DH) + " test with invalid pubkey.", setPub, ecdh);
- Command ecdhCommand = new Command.ECDH_direct(this.card, ECTesterApplet.KEYPAIR_LOCAL, ECTesterApplet.EXPORT_FALSE, EC_Consts.TRANSFORMATION_NONE, EC_Consts.KeyAgreement_ALG_EC_SVDP_DH, pub.flatten());
+ Command ecdhCommand = new Command.ECDH_direct(this.card, CardConsts.KEYPAIR_LOCAL, CardConsts.EXPORT_FALSE, EC_Consts.TRANSFORMATION_NONE, EC_Consts.KeyAgreement_ALG_EC_SVDP_DH, pub.flatten());
Test rawEcdh = CommandTest.expect(ecdhCommand, ExpectedValue.FAILURE, "Card correctly rejected point on invalid curve.", "Card incorrectly accepted point on invalid curve.");
ecdhTests.add(CompoundTest.all(Result.ExpectedValue.SUCCESS, pub.getId() + " invalid key test.", objectEcdh, rawEcdh));
}
diff --git a/src/cz/crcs/ectester/reader/test/CardMiscSuite.java b/reader/src/main/java/cz/crcs/ectester/reader/test/CardMiscSuite.java
index dd49708..da4c0b5 100644
--- a/src/cz/crcs/ectester/reader/test/CardMiscSuite.java
+++ b/reader/src/main/java/cz/crcs/ectester/reader/test/CardMiscSuite.java
@@ -1,12 +1,12 @@
package cz.crcs.ectester.reader.test;
-import cz.crcs.ectester.applet.ECTesterApplet;
-import cz.crcs.ectester.applet.EC_Consts;
+import cz.crcs.ectester.common.ec.EC_Consts;
import cz.crcs.ectester.common.ec.EC_Curve;
import cz.crcs.ectester.common.output.TestWriter;
import cz.crcs.ectester.common.test.CompoundTest;
import cz.crcs.ectester.common.test.Result;
import cz.crcs.ectester.common.test.Test;
+import cz.crcs.ectester.common.util.CardConsts;
import cz.crcs.ectester.data.EC_Store;
import cz.crcs.ectester.reader.CardMngr;
import cz.crcs.ectester.reader.ECTesterReader;
@@ -49,16 +49,16 @@ public class CardMiscSuite extends CardTestSuite {
}
private void testCurve(EC_Curve curve, String catName, Result.ExpectedValue expected) {
- Test allocateFirst = runTest(CommandTest.expect(new Command.Allocate(this.card, ECTesterApplet.KEYPAIR_BOTH, curve.getBits(), curve.getField()), Result.ExpectedValue.SUCCESS));
+ Test allocateFirst = runTest(CommandTest.expect(new Command.Allocate(this.card, CardConsts.KEYPAIR_BOTH, curve.getBits(), curve.getField()), Result.ExpectedValue.SUCCESS));
if (!allocateFirst.ok()) {
doTest(CompoundTest.all(Result.ExpectedValue.SUCCESS, "No support for " + curve.getBits() + "b " + catName + " curve: " + curve.getId() + ".", allocateFirst));
return;
}
- Test set = CommandTest.expect(new Command.Set(this.card, ECTesterApplet.KEYPAIR_BOTH, EC_Consts.CURVE_external, curve.getParams(), curve.flatten()), Result.ExpectedValue.SUCCESS);
- Test generate = setupKeypairs(curve, Result.ExpectedValue.ANY, ECTesterApplet.KEYPAIR_BOTH);
- Test ka = CommandTest.expect(new Command.ECDH(this.card, ECTesterApplet.KEYPAIR_REMOTE, ECTesterApplet.KEYPAIR_LOCAL, ECTesterApplet.EXPORT_FALSE, EC_Consts.TRANSFORMATION_NONE, EC_Consts.KeyAgreement_ALG_EC_SVDP_DH), expected);
- Test sig = CommandTest.expect(new Command.ECDSA_sign(this.card, ECTesterApplet.KEYPAIR_LOCAL, EC_Consts.Signature_ALG_ECDSA_SHA, ECTesterApplet.EXPORT_FALSE, null), expected);
+ Test set = CommandTest.expect(new Command.Set(this.card, CardConsts.KEYPAIR_BOTH, EC_Consts.CURVE_external, curve.getParams(), curve.flatten()), Result.ExpectedValue.SUCCESS);
+ Test generate = setupKeypairs(curve, Result.ExpectedValue.ANY, CardConsts.KEYPAIR_BOTH);
+ Test ka = CommandTest.expect(new Command.ECDH(this.card, CardConsts.KEYPAIR_REMOTE, CardConsts.KEYPAIR_LOCAL, CardConsts.EXPORT_FALSE, EC_Consts.TRANSFORMATION_NONE, EC_Consts.KeyAgreement_ALG_EC_SVDP_DH), expected);
+ Test sig = CommandTest.expect(new Command.ECDSA_sign(this.card, CardConsts.KEYPAIR_LOCAL, EC_Consts.Signature_ALG_ECDSA_SHA, CardConsts.EXPORT_FALSE, null), expected);
Test perform = CompoundTest.all(Result.ExpectedValue.SUCCESS, "Perform ECDH and ECDSA.", ka, sig);
if (cfg.cleanup) {
diff --git a/src/cz/crcs/ectester/reader/test/CardSignatureSuite.java b/reader/src/main/java/cz/crcs/ectester/reader/test/CardSignatureSuite.java
index 0e4ca8e..086654a 100644
--- a/src/cz/crcs/ectester/reader/test/CardSignatureSuite.java
+++ b/reader/src/main/java/cz/crcs/ectester/reader/test/CardSignatureSuite.java
@@ -1,7 +1,6 @@
package cz.crcs.ectester.reader.test;
-import cz.crcs.ectester.applet.ECTesterApplet;
-import cz.crcs.ectester.applet.EC_Consts;
+import cz.crcs.ectester.common.ec.EC_Consts;
import cz.crcs.ectester.common.ec.EC_Curve;
import cz.crcs.ectester.common.ec.EC_Key;
import cz.crcs.ectester.common.ec.EC_SigResult;
@@ -9,6 +8,7 @@ import cz.crcs.ectester.common.output.TestWriter;
import cz.crcs.ectester.common.test.CompoundTest;
import cz.crcs.ectester.common.test.Result;
import cz.crcs.ectester.common.test.Test;
+import cz.crcs.ectester.common.util.CardConsts;
import cz.crcs.ectester.data.EC_Store;
import cz.crcs.ectester.reader.CardMngr;
import cz.crcs.ectester.reader.ECTesterReader;
@@ -52,10 +52,10 @@ public class CardSignatureSuite extends CardTestSuite {
}
EC_Curve curve = EC_Store.getInstance().getObject(EC_Curve.class, sig.getCurve());
- Test allocate = CommandTest.expect(new Command.Allocate(this.card, ECTesterApplet.KEYPAIR_LOCAL, curve.getBits(), curve.getField()), Result.ExpectedValue.SUCCESS);
- Test set = CommandTest.expect(new Command.Set(this.card, ECTesterApplet.KEYPAIR_LOCAL, EC_Consts.CURVE_external, curve.getParams(), curve.flatten()), Result.ExpectedValue.SUCCESS);
- Test setVerifyKey = CommandTest.expect(new Command.Set(this.card, ECTesterApplet.KEYPAIR_LOCAL, EC_Consts.CURVE_external, pubkey.getParams(), pubkey.flatten()), Result.ExpectedValue.SUCCESS);
- Test ecdsaVerify = CommandTest.expect(new Command.ECDSA_verify(this.card, ECTesterApplet.KEYPAIR_LOCAL, sig.getJavaCardSig(), data, sig.getData(0)), expected);
+ Test allocate = CommandTest.expect(new Command.Allocate(this.card, CardConsts.KEYPAIR_LOCAL, curve.getBits(), curve.getField()), Result.ExpectedValue.SUCCESS);
+ Test set = CommandTest.expect(new Command.Set(this.card, CardConsts.KEYPAIR_LOCAL, EC_Consts.CURVE_external, curve.getParams(), curve.flatten()), Result.ExpectedValue.SUCCESS);
+ Test setVerifyKey = CommandTest.expect(new Command.Set(this.card, CardConsts.KEYPAIR_LOCAL, EC_Consts.CURVE_external, pubkey.getParams(), pubkey.flatten()), Result.ExpectedValue.SUCCESS);
+ Test ecdsaVerify = CommandTest.expect(new Command.ECDSA_verify(this.card, CardConsts.KEYPAIR_LOCAL, sig.getJavaCardSig(), data, sig.getData(0)), expected);
if (cfg.cleanup) {
Test cleanup = CommandTest.expect(new Command.Cleanup(this.card), Result.ExpectedValue.ANY);
diff --git a/src/cz/crcs/ectester/reader/test/CardTestSuite.java b/reader/src/main/java/cz/crcs/ectester/reader/test/CardTestSuite.java
index fc60ae5..15c4469 100644
--- a/src/cz/crcs/ectester/reader/test/CardTestSuite.java
+++ b/reader/src/main/java/cz/crcs/ectester/reader/test/CardTestSuite.java
@@ -1,7 +1,6 @@
package cz.crcs.ectester.reader.test;
-import cz.crcs.ectester.applet.ECTesterApplet;
-import cz.crcs.ectester.applet.EC_Consts;
+import cz.crcs.ectester.common.ec.EC_Consts;
import cz.crcs.ectester.common.ec.EC_Curve;
import cz.crcs.ectester.common.ec.EC_Params;
import cz.crcs.ectester.common.output.TestWriter;
@@ -9,6 +8,7 @@ import cz.crcs.ectester.common.test.CompoundTest;
import cz.crcs.ectester.common.test.Result;
import cz.crcs.ectester.common.test.Test;
import cz.crcs.ectester.common.test.TestSuite;
+import cz.crcs.ectester.common.util.CardConsts;
import cz.crcs.ectester.common.util.ECUtil;
import cz.crcs.ectester.reader.CardMngr;
import cz.crcs.ectester.reader.ECTesterReader;
@@ -50,17 +50,17 @@ public abstract class CardTestSuite extends TestSuite {
public Test setupKeypairs(EC_Curve curve, Result.ExpectedValue expected, byte keyPair) {
if ((Arrays.asList(options).contains("preset") && cfg.testOptions.contains("preset")) || (Arrays.asList(options).contains("random") && cfg.testOptions.contains("random"))) {
Test setLocal = null;
- if ((keyPair & ECTesterApplet.KEYPAIR_LOCAL) != 0) {
+ if ((keyPair & CardConsts.KEYPAIR_LOCAL) != 0) {
EC_Params priv;
if (cfg.testOptions.contains("preset")) {
priv = ECUtil.fixedRandomKey(curve);
} else {
priv = ECUtil.fullRandomKey(curve);
}
- setLocal = CommandTest.expect(new Command.Set(this.card, ECTesterApplet.KEYPAIR_LOCAL, EC_Consts.CURVE_external, priv.getParams(), priv.flatten()), expected);
+ setLocal = CommandTest.expect(new Command.Set(this.card, CardConsts.KEYPAIR_LOCAL, EC_Consts.CURVE_external, priv.getParams(), priv.flatten()), expected);
}
Test setRemote = null;
- if ((keyPair & ECTesterApplet.KEYPAIR_REMOTE) != 0) {
+ if ((keyPair & CardConsts.KEYPAIR_REMOTE) != 0) {
EC_Params pub;
if (cfg.testOptions.contains("preset")) {
pub = ECUtil.fixedRandomPoint(curve);
@@ -68,15 +68,15 @@ public abstract class CardTestSuite extends TestSuite {
pub = ECUtil.fullRandomPoint(curve);
}
if (pub == null) {
- setRemote = CommandTest.expect(new Command.Generate(this.card, ECTesterApplet.KEYPAIR_REMOTE), expected);
+ setRemote = CommandTest.expect(new Command.Generate(this.card, CardConsts.KEYPAIR_REMOTE), expected);
} else {
- setRemote = CommandTest.expect(new Command.Set(this.card, ECTesterApplet.KEYPAIR_REMOTE, EC_Consts.CURVE_external, pub.getParams(), pub.flatten()), expected);
+ setRemote = CommandTest.expect(new Command.Set(this.card, CardConsts.KEYPAIR_REMOTE, EC_Consts.CURVE_external, pub.getParams(), pub.flatten()), expected);
}
}
- if (keyPair == ECTesterApplet.KEYPAIR_LOCAL) {
+ if (keyPair == CardConsts.KEYPAIR_LOCAL) {
return setLocal;
- } else if (keyPair == ECTesterApplet.KEYPAIR_REMOTE) {
+ } else if (keyPair == CardConsts.KEYPAIR_REMOTE) {
return setRemote;
} else {
String desc;
diff --git a/src/cz/crcs/ectester/reader/test/CardTestVectorSuite.java b/reader/src/main/java/cz/crcs/ectester/reader/test/CardTestVectorSuite.java
index d143852..07b38d0 100644
--- a/src/cz/crcs/ectester/reader/test/CardTestVectorSuite.java
+++ b/reader/src/main/java/cz/crcs/ectester/reader/test/CardTestVectorSuite.java
@@ -1,7 +1,5 @@
package cz.crcs.ectester.reader.test;
-import cz.crcs.ectester.applet.ECTesterApplet;
-import cz.crcs.ectester.applet.EC_Consts;
import cz.crcs.ectester.common.ec.*;
import cz.crcs.ectester.common.output.TestWriter;
import cz.crcs.ectester.common.test.CompoundTest;
@@ -9,6 +7,7 @@ import cz.crcs.ectester.common.test.Result;
import cz.crcs.ectester.common.test.Test;
import cz.crcs.ectester.common.test.TestCallback;
import cz.crcs.ectester.common.util.ByteUtil;
+import cz.crcs.ectester.common.util.CardConsts;
import cz.crcs.ectester.common.util.CardUtil;
import cz.crcs.ectester.common.util.ECUtil;
import cz.crcs.ectester.data.EC_Store;
@@ -16,7 +15,6 @@ import cz.crcs.ectester.reader.CardMngr;
import cz.crcs.ectester.reader.ECTesterReader;
import cz.crcs.ectester.reader.command.Command;
import cz.crcs.ectester.reader.response.Response;
-import javacard.security.KeyPair;
import javax.crypto.KeyAgreement;
import java.io.IOException;
@@ -65,17 +63,17 @@ public class CardTestVectorSuite extends CardTestSuite {
throw new IOException("Test vector keys couldn't be located.");
}
List<Test> testVector = new LinkedList<>();
- Test allocate = runTest(CommandTest.expect(new Command.Allocate(this.card, ECTesterApplet.KEYPAIR_BOTH, curve.getBits(), curve.getField()), ExpectedValue.SUCCESS));
+ Test allocate = runTest(CommandTest.expect(new Command.Allocate(this.card, CardConsts.KEYPAIR_BOTH, curve.getBits(), curve.getField()), ExpectedValue.SUCCESS));
if (!allocate.ok()) {
doTest(CompoundTest.all(ExpectedValue.SUCCESS, "No support for " + curve.getBits() + "b " + CardUtil.getKeyTypeString(curve.getField()) + ".", allocate));
continue;
}
testVector.add(allocate);
- testVector.add(CommandTest.expect(new Command.Set(this.card, ECTesterApplet.KEYPAIR_BOTH, EC_Consts.CURVE_external, curve.getParams(), curve.flatten()), ExpectedValue.SUCCESS));
- testVector.add(CommandTest.expect(new Command.Set(this.card, ECTesterApplet.KEYPAIR_LOCAL, EC_Consts.CURVE_external, EC_Consts.PARAMETER_S, onekey.flatten(EC_Consts.PARAMETER_S)), ExpectedValue.SUCCESS));
- testVector.add(CommandTest.expect(new Command.Set(this.card, ECTesterApplet.KEYPAIR_REMOTE, EC_Consts.CURVE_external, EC_Consts.PARAMETER_W, otherkey.flatten(EC_Consts.PARAMETER_W)), ExpectedValue.SUCCESS));
- testVector.add(CommandTest.function(new Command.ECDH(this.card, ECTesterApplet.KEYPAIR_REMOTE, ECTesterApplet.KEYPAIR_LOCAL, ECTesterApplet.EXPORT_TRUE, EC_Consts.TRANSFORMATION_NONE, result.getJavaCardKA()), new TestCallback<CommandTestable>() {
+ testVector.add(CommandTest.expect(new Command.Set(this.card, CardConsts.KEYPAIR_BOTH, EC_Consts.CURVE_external, curve.getParams(), curve.flatten()), ExpectedValue.SUCCESS));
+ testVector.add(CommandTest.expect(new Command.Set(this.card, CardConsts.KEYPAIR_LOCAL, EC_Consts.CURVE_external, EC_Consts.PARAMETER_S, onekey.flatten(EC_Consts.PARAMETER_S)), ExpectedValue.SUCCESS));
+ testVector.add(CommandTest.expect(new Command.Set(this.card, CardConsts.KEYPAIR_REMOTE, EC_Consts.CURVE_external, EC_Consts.PARAMETER_W, otherkey.flatten(EC_Consts.PARAMETER_W)), ExpectedValue.SUCCESS));
+ testVector.add(CommandTest.function(new Command.ECDH(this.card, CardConsts.KEYPAIR_REMOTE, CardConsts.KEYPAIR_LOCAL, CardConsts.EXPORT_TRUE, EC_Consts.TRANSFORMATION_NONE, result.getJavaCardKA()), new TestCallback<CommandTestable>() {
@Override
public Result apply(CommandTestable testable) {
Response.ECDH dh = (Response.ECDH) testable.getResponse();
@@ -110,25 +108,25 @@ public class CardTestVectorSuite extends CardTestSuite {
}
List<EC_Curve> testCurves = new ArrayList<>();
- testCurves.addAll(EC_Store.getInstance().getObjects(EC_Curve.class, "secg").values().stream().filter((curve) -> curve.getField() == KeyPair.ALG_EC_FP).collect(Collectors.toList()));
- testCurves.addAll(EC_Store.getInstance().getObjects(EC_Curve.class, "brainpool").values().stream().filter((curve) -> curve.getField() == KeyPair.ALG_EC_FP).collect(Collectors.toList()));
+ testCurves.addAll(EC_Store.getInstance().getObjects(EC_Curve.class, "secg").values().stream().filter((curve) -> curve.getField() == EC_Consts.ALG_EC_FP).collect(Collectors.toList()));
+ testCurves.addAll(EC_Store.getInstance().getObjects(EC_Curve.class, "brainpool").values().stream().filter((curve) -> curve.getField() == EC_Consts.ALG_EC_FP).collect(Collectors.toList()));
for (EC_Curve curve : testCurves) {
List<Test> testVector = new LinkedList<>();
- Test allocate = runTest(CommandTest.expect(new Command.Allocate(this.card, ECTesterApplet.KEYPAIR_BOTH, curve.getBits(), curve.getField()), ExpectedValue.SUCCESS));
+ Test allocate = runTest(CommandTest.expect(new Command.Allocate(this.card, CardConsts.KEYPAIR_BOTH, curve.getBits(), curve.getField()), ExpectedValue.SUCCESS));
if (!allocate.ok()) {
doTest(CompoundTest.all(ExpectedValue.SUCCESS, "No support for " + curve.getBits() + "b " + CardUtil.getKeyTypeString(curve.getField()) + ".", allocate));
continue;
}
testVector.add(allocate);
- testVector.add(CommandTest.expect(new Command.Set(this.card, ECTesterApplet.KEYPAIR_BOTH, EC_Consts.CURVE_external, curve.getParams(), curve.flatten()), ExpectedValue.SUCCESS));
- testVector.add(CommandTest.expect(new Command.Generate(this.card, ECTesterApplet.KEYPAIR_BOTH), ExpectedValue.SUCCESS));
- CommandTest exportLocal = CommandTest.expect(new Command.Export(this.card, ECTesterApplet.KEYPAIR_LOCAL, EC_Consts.KEY_PUBLIC, EC_Consts.PARAMETER_W), ExpectedValue.ANY);
- CommandTest exportRemote = CommandTest.expect(new Command.Export(this.card, ECTesterApplet.KEYPAIR_REMOTE, EC_Consts.KEY_PRIVATE, EC_Consts.PARAMETER_S), ExpectedValue.ANY);
+ testVector.add(CommandTest.expect(new Command.Set(this.card, CardConsts.KEYPAIR_BOTH, EC_Consts.CURVE_external, curve.getParams(), curve.flatten()), ExpectedValue.SUCCESS));
+ testVector.add(CommandTest.expect(new Command.Generate(this.card, CardConsts.KEYPAIR_BOTH), ExpectedValue.SUCCESS));
+ CommandTest exportLocal = CommandTest.expect(new Command.Export(this.card, CardConsts.KEYPAIR_LOCAL, EC_Consts.KEY_PUBLIC, EC_Consts.PARAMETER_W), ExpectedValue.ANY);
+ CommandTest exportRemote = CommandTest.expect(new Command.Export(this.card, CardConsts.KEYPAIR_REMOTE, EC_Consts.KEY_PRIVATE, EC_Consts.PARAMETER_S), ExpectedValue.ANY);
testVector.add(exportLocal);
testVector.add(exportRemote);
BiFunction<Response.Export, Response.Export, Key[]> getKeys = (localData, remoteData) -> {
- byte[] pkey = localData.getParameter(ECTesterApplet.KEYPAIR_LOCAL, EC_Consts.PARAMETER_W);
- byte[] skey = remoteData.getParameter(ECTesterApplet.KEYPAIR_REMOTE, EC_Consts.PARAMETER_S);
+ byte[] pkey = localData.getParameter(CardConsts.KEYPAIR_LOCAL, EC_Consts.PARAMETER_W);
+ byte[] skey = remoteData.getParameter(CardConsts.KEYPAIR_REMOTE, EC_Consts.PARAMETER_S);
ECParameterSpec spec = curve.toSpec();
ECPrivateKeySpec privKeySpec = new ECPrivateKeySpec(new BigInteger(1, skey), spec);
ECPublicKeySpec pubKeySpec = new ECPublicKeySpec(ECUtil.fromX962(pkey, curve.toCurve()), spec);
@@ -191,8 +189,8 @@ public class CardTestVectorSuite extends CardTestSuite {
}
}
};
- Test ecdhTest = CommandTest.function(new Command.ECDH(this.card, ECTesterApplet.KEYPAIR_LOCAL, ECTesterApplet.KEYPAIR_REMOTE, ECTesterApplet.EXPORT_TRUE, EC_Consts.TRANSFORMATION_NONE, EC_Consts.KeyAgreement_ALG_EC_SVDP_DH), kaCallback);
- Test ecdhRawTest = CommandTest.function(new Command.ECDH(this.card, ECTesterApplet.KEYPAIR_LOCAL, ECTesterApplet.KEYPAIR_REMOTE, ECTesterApplet.EXPORT_TRUE, EC_Consts.TRANSFORMATION_NONE, EC_Consts.KeyAgreement_ALG_EC_SVDP_DH_PLAIN), kaCallback);
+ Test ecdhTest = CommandTest.function(new Command.ECDH(this.card, CardConsts.KEYPAIR_LOCAL, CardConsts.KEYPAIR_REMOTE, CardConsts.EXPORT_TRUE, EC_Consts.TRANSFORMATION_NONE, EC_Consts.KeyAgreement_ALG_EC_SVDP_DH), kaCallback);
+ Test ecdhRawTest = CommandTest.function(new Command.ECDH(this.card, CardConsts.KEYPAIR_LOCAL, CardConsts.KEYPAIR_REMOTE, CardConsts.EXPORT_TRUE, EC_Consts.TRANSFORMATION_NONE, EC_Consts.KeyAgreement_ALG_EC_SVDP_DH_PLAIN), kaCallback);
byte[] data = new byte[32];
TestCallback<CommandTestable> sigCallback = new TestCallback<CommandTestable>() {
@Override
@@ -224,7 +222,7 @@ public class CardTestVectorSuite extends CardTestSuite {
}
}
};
- Test ecdsaTest = CommandTest.function(new Command.ECDSA_sign(this.card, ECTesterApplet.KEYPAIR_LOCAL, EC_Consts.Signature_ALG_ECDSA_SHA, ECTesterApplet.EXPORT_TRUE, data), sigCallback);
+ Test ecdsaTest = CommandTest.function(new Command.ECDSA_sign(this.card, CardConsts.KEYPAIR_LOCAL, EC_Consts.Signature_ALG_ECDSA_SHA, CardConsts.EXPORT_TRUE, data), sigCallback);
testVector.add(CompoundTest.all(ExpectedValue.SUCCESS, "Test.", ecdhTest, ecdhRawTest, ecdsaTest));
if (cfg.cleanup) {
testVector.add(CommandTest.expect(new Command.Cleanup(this.card), ExpectedValue.ANY));
diff --git a/src/cz/crcs/ectester/reader/test/CardTwistSuite.java b/reader/src/main/java/cz/crcs/ectester/reader/test/CardTwistSuite.java
index a6bca6c..5c35be7 100644
--- a/src/cz/crcs/ectester/reader/test/CardTwistSuite.java
+++ b/reader/src/main/java/cz/crcs/ectester/reader/test/CardTwistSuite.java
@@ -1,13 +1,13 @@
package cz.crcs.ectester.reader.test;
-import cz.crcs.ectester.applet.ECTesterApplet;
-import cz.crcs.ectester.applet.EC_Consts;
+import cz.crcs.ectester.common.ec.EC_Consts;
import cz.crcs.ectester.common.ec.EC_Curve;
import cz.crcs.ectester.common.ec.EC_Key;
import cz.crcs.ectester.common.output.TestWriter;
import cz.crcs.ectester.common.test.CompoundTest;
import cz.crcs.ectester.common.test.Result;
import cz.crcs.ectester.common.test.Test;
+import cz.crcs.ectester.common.util.CardConsts;
import cz.crcs.ectester.common.util.CardUtil;
import cz.crcs.ectester.data.EC_Store;
import cz.crcs.ectester.reader.CardMngr;
@@ -34,22 +34,22 @@ public class CardTwistSuite extends CardTestSuite {
EC_Curve curve = e.getKey();
List<EC_Key.Public> keys = e.getValue();
- Test allocate = runTest(CommandTest.expect(new Command.Allocate(this.card, ECTesterApplet.KEYPAIR_BOTH, curve.getBits(), curve.getField()), Result.ExpectedValue.SUCCESS));
+ Test allocate = runTest(CommandTest.expect(new Command.Allocate(this.card, CardConsts.KEYPAIR_BOTH, curve.getBits(), curve.getField()), Result.ExpectedValue.SUCCESS));
if (!allocate.ok()) {
doTest(CompoundTest.all(Result.ExpectedValue.SUCCESS, "No support for " + curve.getId() + ".", allocate));
continue;
}
- Test set = CommandTest.expect(new Command.Set(this.card, ECTesterApplet.KEYPAIR_BOTH, EC_Consts.CURVE_external, curve.getParams(), curve.flatten()), Result.ExpectedValue.SUCCESS);
- Test generate = CommandTest.expect(new Command.Generate(this.card, ECTesterApplet.KEYPAIR_LOCAL), Result.ExpectedValue.SUCCESS);
+ Test set = CommandTest.expect(new Command.Set(this.card, CardConsts.KEYPAIR_BOTH, EC_Consts.CURVE_external, curve.getParams(), curve.flatten()), Result.ExpectedValue.SUCCESS);
+ Test generate = CommandTest.expect(new Command.Generate(this.card, CardConsts.KEYPAIR_LOCAL), Result.ExpectedValue.SUCCESS);
Test prepare = CompoundTest.all(Result.ExpectedValue.SUCCESS, "Prepare and generate keypair on " + curve.getId() + ".", allocate, set, generate);
List<Test> ecdhTests = new LinkedList<>();
for (EC_Key.Public pub : keys) {
- Test setPub = CommandTest.expect(new Command.Set(this.card, ECTesterApplet.KEYPAIR_REMOTE, EC_Consts.CURVE_external, pub.getParams(), pub.flatten()), Result.ExpectedValue.FAILURE);
- Test ecdh = CommandTest.expect(new Command.ECDH(this.card, ECTesterApplet.KEYPAIR_REMOTE, ECTesterApplet.KEYPAIR_LOCAL, ECTesterApplet.EXPORT_FALSE, EC_Consts.TRANSFORMATION_NONE, EC_Consts.KeyAgreement_ALG_EC_SVDP_DH), Result.ExpectedValue.FAILURE, "Card correctly rejected point on twist.", "Card incorrectly accepted point on twist.");
+ Test setPub = CommandTest.expect(new Command.Set(this.card, CardConsts.KEYPAIR_REMOTE, EC_Consts.CURVE_external, pub.getParams(), pub.flatten()), Result.ExpectedValue.FAILURE);
+ Test ecdh = CommandTest.expect(new Command.ECDH(this.card, CardConsts.KEYPAIR_REMOTE, CardConsts.KEYPAIR_LOCAL, CardConsts.EXPORT_FALSE, EC_Consts.TRANSFORMATION_NONE, EC_Consts.KeyAgreement_ALG_EC_SVDP_DH), Result.ExpectedValue.FAILURE, "Card correctly rejected point on twist.", "Card incorrectly accepted point on twist.");
Test objectEcdh = CompoundTest.any(Result.ExpectedValue.SUCCESS, CardUtil.getKATypeString(EC_Consts.KeyAgreement_ALG_EC_SVDP_DH) + " test with twist pubkey.", setPub, ecdh);
- Command ecdhCommand = new Command.ECDH_direct(this.card, ECTesterApplet.KEYPAIR_LOCAL, ECTesterApplet.EXPORT_FALSE, EC_Consts.TRANSFORMATION_NONE, EC_Consts.KeyAgreement_ALG_EC_SVDP_DH, pub.flatten());
+ Command ecdhCommand = new Command.ECDH_direct(this.card, CardConsts.KEYPAIR_LOCAL, CardConsts.EXPORT_FALSE, EC_Consts.TRANSFORMATION_NONE, EC_Consts.KeyAgreement_ALG_EC_SVDP_DH, pub.flatten());
Test rawEcdh = CommandTest.expect(ecdhCommand, Result.ExpectedValue.FAILURE, "Card correctly rejected point on twist.", "Card incorrectly accepted point on twist.");
ecdhTests.add(CompoundTest.all(Result.ExpectedValue.SUCCESS, pub.getId() + " twist key test.", objectEcdh, rawEcdh));
}
diff --git a/src/cz/crcs/ectester/reader/test/CardWrongSuite.java b/reader/src/main/java/cz/crcs/ectester/reader/test/CardWrongSuite.java
index 13a3f8b..0b030b8 100644
--- a/src/cz/crcs/ectester/reader/test/CardWrongSuite.java
+++ b/reader/src/main/java/cz/crcs/ectester/reader/test/CardWrongSuite.java
@@ -1,7 +1,6 @@
package cz.crcs.ectester.reader.test;
-import cz.crcs.ectester.applet.ECTesterApplet;
-import cz.crcs.ectester.applet.EC_Consts;
+import cz.crcs.ectester.common.ec.EC_Consts;
import cz.crcs.ectester.common.ec.EC_Curve;
import cz.crcs.ectester.common.ec.EC_Params;
import cz.crcs.ectester.common.output.TestWriter;
@@ -9,13 +8,13 @@ import cz.crcs.ectester.common.test.CompoundTest;
import cz.crcs.ectester.common.test.Result;
import cz.crcs.ectester.common.test.Test;
import cz.crcs.ectester.common.util.ByteUtil;
+import cz.crcs.ectester.common.util.CardConsts;
import cz.crcs.ectester.common.util.CardUtil;
import cz.crcs.ectester.common.util.ECUtil;
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.math.BigInteger;
import java.util.LinkedList;
@@ -43,21 +42,21 @@ public class CardWrongSuite extends CardTestSuite {
for (Map.Entry<String, EC_Curve> e : curves.entrySet()) {
EC_Curve curve = e.getValue();
List<Test> tests = new LinkedList<>();
- Test key = runTest(CommandTest.expect(new Command.Allocate(this.card, ECTesterApplet.KEYPAIR_BOTH, curve.getBits(), curve.getField()), ExpectedValue.SUCCESS));
+ Test key = runTest(CommandTest.expect(new Command.Allocate(this.card, CardConsts.KEYPAIR_BOTH, curve.getBits(), curve.getField()), ExpectedValue.SUCCESS));
if (!key.ok()) {
doTest(CompoundTest.all(ExpectedValue.FAILURE, "No support for " + curve.getBits() + "b " + CardUtil.getKeyTypeString(curve.getField()), key));
continue;
}
tests.add(key);
- Test set = runTest(CommandTest.expect(new Command.Set(this.card, ECTesterApplet.KEYPAIR_BOTH, EC_Consts.CURVE_external, curve.getParams(), curve.flatten()), ExpectedValue.FAILURE));
- Test generate = runTest(setupKeypairs(curve, ExpectedValue.SUCCESS, ECTesterApplet.KEYPAIR_BOTH));
+ Test set = runTest(CommandTest.expect(new Command.Set(this.card, CardConsts.KEYPAIR_BOTH, EC_Consts.CURVE_external, curve.getParams(), curve.flatten()), ExpectedValue.FAILURE));
+ Test generate = runTest(setupKeypairs(curve, ExpectedValue.SUCCESS, CardConsts.KEYPAIR_BOTH));
Test setup = runTest(CompoundTest.any(ExpectedValue.SUCCESS, "Set wrong curve and generate keypairs.", set, generate));
tests.add(setup);
for (byte kaType : EC_Consts.KA_TYPES) {
Test allocate = runTest(CommandTest.expect(new Command.AllocateKeyAgreement(this.card, kaType), ExpectedValue.SUCCESS));
if (allocate.ok()) {
- Test ka = runTest(CommandTest.expect(new Command.ECDH(this.card, ECTesterApplet.KEYPAIR_REMOTE, ECTesterApplet.KEYPAIR_LOCAL, ECTesterApplet.EXPORT_FALSE, EC_Consts.TRANSFORMATION_NONE, kaType), ExpectedValue.FAILURE));
+ Test ka = runTest(CommandTest.expect(new Command.ECDH(this.card, CardConsts.KEYPAIR_REMOTE, CardConsts.KEYPAIR_LOCAL, CardConsts.EXPORT_FALSE, EC_Consts.TRANSFORMATION_NONE, kaType), ExpectedValue.FAILURE));
Test kaTest = runTest(CompoundTest.all(ExpectedValue.SUCCESS, "Allocate and perform KA.", allocate, ka));
tests.add(kaTest);
}
@@ -82,52 +81,46 @@ public class CardWrongSuite extends CardTestSuite {
*/
Random r = new Random();
for (short keyLength : EC_Consts.FP_SIZES) {
- byte curve = EC_Consts.getCurve(keyLength, KeyPair.ALG_EC_FP);
- Test key = runTest(CommandTest.expect(new Command.Allocate(this.card, ECTesterApplet.KEYPAIR_BOTH, keyLength, KeyPair.ALG_EC_FP), ExpectedValue.SUCCESS));
+ byte curve = EC_Consts.getCurve(keyLength, EC_Consts.ALG_EC_FP);
+ Test key = runTest(CommandTest.expect(new Command.Allocate(this.card, CardConsts.KEYPAIR_BOTH, keyLength, EC_Consts.ALG_EC_FP), ExpectedValue.SUCCESS));
if (!key.ok()) {
doTest(CompoundTest.all(ExpectedValue.FAILURE, "No support for " + keyLength + "b ALG_EC_FP.", key));
continue;
}
- Test set = CommandTest.expect(new Command.Set(this.card, ECTesterApplet.KEYPAIR_BOTH, curve, EC_Consts.PARAMETERS_DOMAIN_FP, null), ExpectedValue.SUCCESS);
+ Test set = CommandTest.expect(new Command.Set(this.card, CardConsts.KEYPAIR_BOTH, curve, EC_Consts.PARAMETERS_DOMAIN_FP, null), ExpectedValue.SUCCESS);
Test setup = CompoundTest.all(ExpectedValue.SUCCESS, "KeyPair setup.", key, set);
- Test prime0 = ecdhTest(new Command.Transform(this.card, ECTesterApplet.KEYPAIR_BOTH, EC_Consts.KEY_BOTH, EC_Consts.PARAMETER_FP, EC_Consts.TRANSFORMATION_ZERO), "Set p = 0.", "ECDH with p = 0.");
- Test prime1 = ecdhTest(new Command.Transform(this.card, ECTesterApplet.KEYPAIR_BOTH, EC_Consts.KEY_BOTH, EC_Consts.PARAMETER_FP, EC_Consts.TRANSFORMATION_ONE), "Set p = 1.", "ECDH with p = 1.");
+ Test prime0 = ecdhTest(new Command.Transform(this.card, CardConsts.KEYPAIR_BOTH, EC_Consts.KEY_BOTH, EC_Consts.PARAMETER_FP, EC_Consts.TRANSFORMATION_ZERO), "Set p = 0.", "ECDH with p = 0.");
+ Test prime1 = ecdhTest(new Command.Transform(this.card, CardConsts.KEYPAIR_BOTH, EC_Consts.KEY_BOTH, EC_Consts.PARAMETER_FP, EC_Consts.TRANSFORMATION_ONE), "Set p = 1.", "ECDH with p = 1.");
short keyHalf = (short) (keyLength / 2);
BigInteger prime = new BigInteger(keyHalf, 50, r);
BigInteger primePow = prime.pow(2);
byte[] primePowBytes = ECUtil.toByteArray(primePow, keyLength);
EC_Params primePowData = new EC_Params(EC_Consts.PARAMETER_FP, new byte[][]{primePowBytes});
- Test primePower = ecdhTest(new Command.Set(this.card, ECTesterApplet.KEYPAIR_BOTH, EC_Consts.CURVE_external, primePowData.getParams(), primePowData.flatten()), "Set p = square of a prime.", "ECDH with p = q^2.");
+ Test primePower = ecdhTest(new Command.Set(this.card, CardConsts.KEYPAIR_BOTH, EC_Consts.CURVE_external, primePowData.getParams(), primePowData.flatten()), "Set p = square of a prime.", "ECDH with p = q^2.");
BigInteger q = new BigInteger(keyHalf, r);
BigInteger s = new BigInteger(keyHalf, r);
BigInteger compositeValue = q.multiply(s);
byte[] compositeBytes = ECUtil.toByteArray(compositeValue, keyLength);
EC_Params compositeData = new EC_Params(EC_Consts.PARAMETER_FP, new byte[][]{compositeBytes});
- Test composite = ecdhTest(new Command.Set(this.card, ECTesterApplet.KEYPAIR_BOTH, EC_Consts.CURVE_external, compositeData.getParams(), compositeData.flatten()), "Set p = product of two primes.", "ECDH with p = q * s.");
+ Test composite = ecdhTest(new Command.Set(this.card, CardConsts.KEYPAIR_BOTH, EC_Consts.CURVE_external, compositeData.getParams(), compositeData.flatten()), "Set p = product of two primes.", "ECDH with p = q * s.");
Test wrongPrime = CompoundTest.all(ExpectedValue.SUCCESS, "Tests with corrupted prime parameter.", prime0, prime1, primePower, composite);
Test resetSetup = CompoundTest.all(ExpectedValue.SUCCESS, "Reset keypair.", set.clone());
- Test randomG = ecdhTest(new Command.Transform(this.card, ECTesterApplet.KEYPAIR_BOTH, EC_Consts.KEY_BOTH, EC_Consts.PARAMETER_G, (short) (EC_Consts.TRANSFORMATION_FULLRANDOM | EC_Consts.TRANSFORMATION_04_MASK)), "Set G = random non-point/point-like.", "ECDH with non-point G.");
- Test fullRandomG = ecdhTest(new Command.Transform(this.card, ECTesterApplet.KEYPAIR_BOTH, EC_Consts.KEY_BOTH, EC_Consts.PARAMETER_G, EC_Consts.TRANSFORMATION_FULLRANDOM), "Set G = random data.", "ECDH with G = random data.");
- Test zeroG = ecdhTest(new Command.Transform(this.card, ECTesterApplet.KEYPAIR_BOTH, EC_Consts.KEY_BOTH, EC_Consts.PARAMETER_G, EC_Consts.TRANSFORMATION_INFINITY), "Set G = inifnity.", "ECDH with G = infinity.");
+ Test randomG = ecdhTest(new Command.Transform(this.card, CardConsts.KEYPAIR_BOTH, EC_Consts.KEY_BOTH, EC_Consts.PARAMETER_G, (short) (EC_Consts.TRANSFORMATION_FULLRANDOM | EC_Consts.TRANSFORMATION_04_MASK)), "Set G = random non-point/point-like.", "ECDH with non-point G.");
+ Test fullRandomG = ecdhTest(new Command.Transform(this.card, CardConsts.KEYPAIR_BOTH, EC_Consts.KEY_BOTH, EC_Consts.PARAMETER_G, EC_Consts.TRANSFORMATION_FULLRANDOM), "Set G = random data.", "ECDH with G = random data.");
+ Test zeroG = ecdhTest(new Command.Transform(this.card, CardConsts.KEYPAIR_BOTH, EC_Consts.KEY_BOTH, EC_Consts.PARAMETER_G, EC_Consts.TRANSFORMATION_INFINITY), "Set G = inifnity.", "ECDH with G = infinity.");
Test wrongG = CompoundTest.all(ExpectedValue.SUCCESS, "Tests with corrupted G parameter.", randomG, fullRandomG, zeroG);
- byte[] originalR = new byte[((keyLength + 7) / 8) + 1];
- short origRlen = EC_Consts.getCurveParameter(curve, EC_Consts.PARAMETER_R, originalR, (short) 0);
- if (origRlen != originalR.length) {
- byte[] copyR = new byte[origRlen];
- System.arraycopy(originalR, 0, copyR, 0, origRlen);
- originalR = copyR;
- }
+ byte[] originalR = EC_Consts.getCurveParameter(curve, EC_Consts.PARAMETER_R);
BigInteger originalBigR = new BigInteger(1, originalR);
- Test zeroR = ecdhTest(new Command.Transform(this.card, ECTesterApplet.KEYPAIR_BOTH, EC_Consts.CURVE_external, EC_Consts.PARAMETER_R, EC_Consts.TRANSFORMATION_ZERO), "Set R = 0.", "ECDH with R = 0.");
- Test oneR = ecdhTest(new Command.Transform(this.card, ECTesterApplet.KEYPAIR_BOTH, EC_Consts.CURVE_external, EC_Consts.PARAMETER_R, EC_Consts.TRANSFORMATION_ONE), "Set R = 1.", "ECDH with R = 1.");
+ Test zeroR = ecdhTest(new Command.Transform(this.card, CardConsts.KEYPAIR_BOTH, EC_Consts.CURVE_external, EC_Consts.PARAMETER_R, EC_Consts.TRANSFORMATION_ZERO), "Set R = 0.", "ECDH with R = 0.");
+ Test oneR = ecdhTest(new Command.Transform(this.card, CardConsts.KEYPAIR_BOTH, EC_Consts.CURVE_external, EC_Consts.PARAMETER_R, EC_Consts.TRANSFORMATION_ONE), "Set R = 1.", "ECDH with R = 1.");
BigInteger prevPrimeR;
do {
@@ -135,31 +128,31 @@ public class CardWrongSuite extends CardTestSuite {
} while (prevPrimeR.compareTo(originalBigR) >= 0);
byte[] prevRBytes = ECUtil.toByteArray(prevPrimeR, keyLength);
EC_Params prevRData = new EC_Params(EC_Consts.PARAMETER_R, new byte[][]{prevRBytes});
- Test prevprimeWrongR = ecdhTest(new Command.Set(this.card, ECTesterApplet.KEYPAIR_BOTH, EC_Consts.CURVE_external, prevRData.getParams(), prevRData.flatten()), "Set R = some prime (but [r]G != infinity) smaller than original R.", "ECDH with wrong R, prevprime.");
+ Test prevprimeWrongR = ecdhTest(new Command.Set(this.card, CardConsts.KEYPAIR_BOTH, EC_Consts.CURVE_external, prevRData.getParams(), prevRData.flatten()), "Set R = some prime (but [r]G != infinity) smaller than original R.", "ECDH with wrong R, prevprime.");
BigInteger nextPrimeR = originalBigR.nextProbablePrime();
byte[] nextRBytes = ECUtil.toByteArray(nextPrimeR, keyLength);
EC_Params nextRData = new EC_Params(EC_Consts.PARAMETER_R, new byte[][]{nextRBytes});
- Test nextprimeWrongR = ecdhTest(new Command.Set(this.card, ECTesterApplet.KEYPAIR_BOTH, EC_Consts.CURVE_external, nextRData.getParams(), nextRData.flatten()), "Set R = some prime (but [r]G != infinity) larger than original R.", "ECDH with wrong R, nextprime.");
+ Test nextprimeWrongR = ecdhTest(new Command.Set(this.card, CardConsts.KEYPAIR_BOTH, EC_Consts.CURVE_external, nextRData.getParams(), nextRData.flatten()), "Set R = some prime (but [r]G != infinity) larger than original R.", "ECDH with wrong R, nextprime.");
byte[] nonprimeRBytes = nextRBytes.clone();
nonprimeRBytes[nonprimeRBytes.length - 1] ^= 1;
EC_Params nonprimeWrongRData = new EC_Params(EC_Consts.PARAMETER_R, new byte[][]{nonprimeRBytes});
- Test nonprimeWrongR = ecdhTest(new Command.Set(this.card, ECTesterApplet.KEYPAIR_BOTH, EC_Consts.CURVE_external, nonprimeWrongRData.getParams(), nonprimeWrongRData.flatten()), "Set R = some composite (but [r]G != infinity).", "ECDH with wrong R, composite.");
+ Test nonprimeWrongR = ecdhTest(new Command.Set(this.card, CardConsts.KEYPAIR_BOTH, EC_Consts.CURVE_external, nonprimeWrongRData.getParams(), nonprimeWrongRData.flatten()), "Set R = some composite (but [r]G != infinity).", "ECDH with wrong R, composite.");
Test wrongR = CompoundTest.all(ExpectedValue.SUCCESS, "Tests with corrupted R parameter.", zeroR, oneR, prevprimeWrongR, nextprimeWrongR, nonprimeWrongR);
byte[] kRaw = new byte[]{(byte) 0xff};
EC_Params kData = new EC_Params(EC_Consts.PARAMETER_K, new byte[][]{kRaw});
- Test bigK = ecdhTest(new Command.Set(this.card, ECTesterApplet.KEYPAIR_BOTH, EC_Consts.CURVE_external, kData.getParams(), kData.flatten()), "", "");
+ Test bigK = ecdhTest(new Command.Set(this.card, CardConsts.KEYPAIR_BOTH, EC_Consts.CURVE_external, kData.getParams(), kData.flatten()), "", "");
byte[] kZero = new byte[]{(byte) 0};
EC_Params kZeroData = new EC_Params(EC_Consts.PARAMETER_K, new byte[][]{kZero});
- Test zeroK = ecdhTest(new Command.Set(this.card, ECTesterApplet.KEYPAIR_BOTH, EC_Consts.CURVE_external, kZeroData.getParams(), kZeroData.flatten()), "", "");
+ Test zeroK = ecdhTest(new Command.Set(this.card, CardConsts.KEYPAIR_BOTH, EC_Consts.CURVE_external, kZeroData.getParams(), kZeroData.flatten()), "", "");
Test wrongK = CompoundTest.all(ExpectedValue.SUCCESS, "Tests with corrupted K parameter.", bigK, zeroK);
- doTest(CompoundTest.all(ExpectedValue.SUCCESS, "Tests of " + keyLength + "b " + CardUtil.getKeyTypeString(KeyPair.ALG_EC_FP), setup, wrongPrime, resetSetup, wrongG, resetSetup.clone(), wrongR, resetSetup.clone(), wrongK, resetSetup.clone()));
+ doTest(CompoundTest.all(ExpectedValue.SUCCESS, "Tests of " + keyLength + "b " + CardUtil.getKeyTypeString(EC_Consts.ALG_EC_FP), setup, wrongPrime, resetSetup, wrongG, resetSetup.clone(), wrongR, resetSetup.clone(), wrongK, resetSetup.clone()));
}
/*
@@ -168,16 +161,16 @@ public class CardWrongSuite extends CardTestSuite {
* - e1 = e2 = e3 = 0
*/
for (short keyLength : EC_Consts.F2M_SIZES) {
- byte curve = EC_Consts.getCurve(keyLength, KeyPair.ALG_EC_F2M);
- Test key = runTest(CommandTest.expect(new Command.Allocate(this.card, ECTesterApplet.KEYPAIR_BOTH, keyLength, KeyPair.ALG_EC_F2M), ExpectedValue.SUCCESS));
+ byte curve = EC_Consts.getCurve(keyLength, EC_Consts.ALG_EC_F2M);
+ Test key = runTest(CommandTest.expect(new Command.Allocate(this.card, CardConsts.KEYPAIR_BOTH, keyLength, EC_Consts.ALG_EC_F2M), ExpectedValue.SUCCESS));
if (!key.ok()) {
doTest(CompoundTest.all(ExpectedValue.FAILURE, "No support for " + keyLength + "b ALG_EC_F2M.", key));
continue;
}
- Test set = CommandTest.expect(new Command.Set(this.card, ECTesterApplet.KEYPAIR_BOTH, curve, EC_Consts.PARAMETERS_DOMAIN_F2M, null), ExpectedValue.SUCCESS);
+ Test set = CommandTest.expect(new Command.Set(this.card, CardConsts.KEYPAIR_BOTH, curve, EC_Consts.PARAMETERS_DOMAIN_F2M, null), ExpectedValue.SUCCESS);
Test setup = CompoundTest.all(ExpectedValue.SUCCESS, "KeyPair setup.", key, set);
- Test coeff0 = ecdhTest(new Command.Transform(this.card, ECTesterApplet.KEYPAIR_BOTH, EC_Consts.KEY_BOTH, EC_Consts.PARAMETER_F2M, EC_Consts.TRANSFORMATION_ZERO), "Set e1 = e2 = e3 = 0.", "ECDH with wrong field polynomial: x^" + keyLength);
+ Test coeff0 = ecdhTest(new Command.Transform(this.card, CardConsts.KEYPAIR_BOTH, EC_Consts.KEY_BOTH, EC_Consts.PARAMETER_F2M, EC_Consts.TRANSFORMATION_ZERO), "Set e1 = e2 = e3 = 0.", "ECDH with wrong field polynomial: x^" + keyLength);
short e1 = (short) (2 * keyLength);
short e2 = (short) (3 * keyLength);
@@ -188,10 +181,10 @@ public class CardWrongSuite extends CardTestSuite {
ByteUtil.shortToBytes(e2),
ByteUtil.shortToBytes(e3)};
EC_Params coeffParams = new EC_Params(EC_Consts.PARAMETER_F2M, coeffBytes);
- Test coeffLarger = ecdhTest(new Command.Set(this.card, ECTesterApplet.KEYPAIR_BOTH, EC_Consts.CURVE_external, coeffParams.getParams(), coeffParams.flatten()), "Set e1=" + e1 + ", e2=" + e2 + ", e3=" + e3, "ECDH with wrong field poly, powers larger than " + keyLength);
+ Test coeffLarger = ecdhTest(new Command.Set(this.card, CardConsts.KEYPAIR_BOTH, EC_Consts.CURVE_external, coeffParams.getParams(), coeffParams.flatten()), "Set e1=" + e1 + ", e2=" + e2 + ", e3=" + e3, "ECDH with wrong field poly, powers larger than " + keyLength);
Test wrong = CompoundTest.all(ExpectedValue.SUCCESS, "Tests with corrupted field polynomial parameter.", coeff0, coeffLarger);
- doTest(CompoundTest.all(ExpectedValue.SUCCESS, "Tests of " + keyLength + "b " + CardUtil.getKeyTypeString(KeyPair.ALG_EC_F2M), setup, wrong));
+ doTest(CompoundTest.all(ExpectedValue.SUCCESS, "Tests of " + keyLength + "b " + CardUtil.getKeyTypeString(EC_Consts.ALG_EC_F2M), setup, wrong));
}
/*
@@ -205,10 +198,10 @@ public class CardWrongSuite extends CardTestSuite {
private Test ecdhTest(Command setupCmd, String prepareDesc, String fullDesc) {
Test setup = CommandTest.expect(setupCmd, ExpectedValue.FAILURE);
- Test generate = CommandTest.expect(new Command.Generate(this.card, ECTesterApplet.KEYPAIR_BOTH), ExpectedValue.FAILURE);
+ Test generate = CommandTest.expect(new Command.Generate(this.card, CardConsts.KEYPAIR_BOTH), ExpectedValue.FAILURE);
Test preparePhase = CompoundTest.any(ExpectedValue.SUCCESS, prepareDesc, setup, generate);
Test allocateECDH = CommandTest.expect(new Command.AllocateKeyAgreement(this.card, EC_Consts.KeyAgreement_ALG_EC_SVDP_DH), ExpectedValue.SUCCESS);
- Test ecdh = CommandTest.expect(new Command.ECDH(this.card, ECTesterApplet.KEYPAIR_LOCAL, ECTesterApplet.KEYPAIR_REMOTE, ECTesterApplet.EXPORT_FALSE, EC_Consts.TRANSFORMATION_NONE, EC_Consts.KeyAgreement_ALG_EC_SVDP_DH), ExpectedValue.FAILURE);
+ Test ecdh = CommandTest.expect(new Command.ECDH(this.card, CardConsts.KEYPAIR_LOCAL, CardConsts.KEYPAIR_REMOTE, CardConsts.EXPORT_FALSE, EC_Consts.TRANSFORMATION_NONE, EC_Consts.KeyAgreement_ALG_EC_SVDP_DH), ExpectedValue.FAILURE);
return CompoundTest.function((tests) -> {
diff --git a/src/cz/crcs/ectester/reader/test/CommandTest.java b/reader/src/main/java/cz/crcs/ectester/reader/test/CommandTest.java
index b05d3e4..b05d3e4 100644
--- a/src/cz/crcs/ectester/reader/test/CommandTest.java
+++ b/reader/src/main/java/cz/crcs/ectester/reader/test/CommandTest.java
diff --git a/src/cz/crcs/ectester/reader/test/CommandTestable.java b/reader/src/main/java/cz/crcs/ectester/reader/test/CommandTestable.java
index f670534..f670534 100644
--- a/src/cz/crcs/ectester/reader/test/CommandTestable.java
+++ b/reader/src/main/java/cz/crcs/ectester/reader/test/CommandTestable.java
diff --git a/src/cz/crcs/ectester/reader/test/PerformanceTest.java b/reader/src/main/java/cz/crcs/ectester/reader/test/PerformanceTest.java
index f9cba46..a725dc2 100644
--- a/src/cz/crcs/ectester/reader/test/PerformanceTest.java
+++ b/reader/src/main/java/cz/crcs/ectester/reader/test/PerformanceTest.java
@@ -1,10 +1,10 @@
package cz.crcs.ectester.reader.test;
-import cz.crcs.ectester.applet.ECTesterApplet;
import cz.crcs.ectester.common.test.Result;
import cz.crcs.ectester.common.test.SimpleTest;
import cz.crcs.ectester.common.test.TestCallback;
import cz.crcs.ectester.common.test.TestException;
+import cz.crcs.ectester.common.util.CardConsts;
import cz.crcs.ectester.reader.CardMngr;
import cz.crcs.ectester.reader.command.Command;
import cz.crcs.ectester.reader.response.Response;
@@ -56,7 +56,7 @@ public class PerformanceTest extends SimpleTest<CommandTestable> {
protected void runSelf() {
long baseTime;
try {
- new Command.SetDryRunMode(cardManager, ECTesterApplet.MODE_DRY_RUN).send();
+ new Command.SetDryRunMode(cardManager, CardConsts.MODE_DRY_RUN).send();
testable.run();
baseTime = testable.getResponse().getDuration();
testable.reset();
@@ -64,7 +64,7 @@ public class PerformanceTest extends SimpleTest<CommandTestable> {
baseTime += testable.getResponse().getDuration();
testable.reset();
baseTime /= 2;
- new Command.SetDryRunMode(cardManager, ECTesterApplet.MODE_NORMAL).send();
+ new Command.SetDryRunMode(cardManager, CardConsts.MODE_NORMAL).send();
} catch (CardException ce) {
throw new TestException(ce);
}
diff --git a/settings.gradle.kts b/settings.gradle.kts
new file mode 100644
index 0000000..9e6c60e
--- /dev/null
+++ b/settings.gradle.kts
@@ -0,0 +1,12 @@
+/*
+ * The settings file is used to specify which projects to include in your build.
+ * For more detailed information on multi-project builds, please refer to https://docs.gradle.org/8.6/userguide/multi_project_builds.html in the Gradle documentation.
+ */
+
+plugins {
+ // Apply the foojay-resolver plugin to allow automatic download of JDKs
+ id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0"
+}
+
+rootProject.name = "ECTester"
+include("common", "applet", "reader", "standalone")
diff --git a/standalone/build.gradle.kts b/standalone/build.gradle.kts
new file mode 100644
index 0000000..68bfd13
--- /dev/null
+++ b/standalone/build.gradle.kts
@@ -0,0 +1,62 @@
+
+plugins {
+ application
+ id("com.google.osdetector") version "1.7.3"
+}
+
+repositories {
+ mavenCentral()
+}
+
+dependencies {
+ implementation(files("$rootDir/ext/wolfcrypt-jni.jar"))
+ implementation(project(":common"))
+
+ testImplementation(platform("org.junit:junit-bom:5.10.2"))
+ testImplementation("org.junit.jupiter:junit-jupiter")
+ testRuntimeOnly("org.junit.platform:junit-platform-launcher")
+}
+
+application {
+ applicationName = "ECTesterStandalone"
+ mainClass = "cz.crcs.ectester.standalone.ECTesterStandalone"
+ version = "0.3.3"
+}
+
+tasks.named<Test>("test") {
+ useJUnitPlatform()
+}
+
+tasks.withType<JavaCompile> {
+ if (JavaVersion.current() > JavaVersion.VERSION_1_8) {
+ options.compilerArgs.addAll(arrayOf(
+ "--add-modules", "jdk.crypto.ec",
+ "--add-exports", "jdk.crypto.ec/sun.security.ec=ALL-UNNAMED"
+ ))
+ }
+}
+
+tasks.register<Exec>("libs") {
+ workingDir("src/main/resources/cz/crcs/ectester/standalone/libs/jni")
+ environment("PROJECT_ROOT_PATH", rootDir.absolutePath)
+ if (osdetector.os == "windows") {
+ commandLine("makefile.bat", "/c")
+ } else if (osdetector.os == "linux"){
+ commandLine("make", "-k", "-B")
+ }
+}
+
+tasks.register<Jar>("uberJar") {
+ archiveFileName = "ECTesterStandalone.jar"
+
+ from(sourceSets.main.get().output)
+
+ manifest {
+ attributes["Main-Class"] = application.mainClass
+ }
+
+ dependsOn(configurations.runtimeClasspath)
+ from({
+ configurations.runtimeClasspath.get().filter { it.name.endsWith("jar") }.map { zipTree(it).matching { exclude("META-INF/*.DSA", "META-INF/*.SF", "META-INF/*.RSA", "META-INF/versions/*/module-info.class") } }
+ })
+} \ No newline at end of file
diff --git a/src/cz/crcs/ectester/standalone/ECTesterStandalone.java b/standalone/src/main/java/cz/crcs/ectester/standalone/ECTesterStandalone.java
index a26cc7c..5d3bad2 100644
--- a/src/cz/crcs/ectester/standalone/ECTesterStandalone.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/ECTesterStandalone.java
@@ -23,8 +23,8 @@
*/
package cz.crcs.ectester.standalone;
-import cz.crcs.ectester.applet.EC_Consts;
import cz.crcs.ectester.common.cli.*;
+import cz.crcs.ectester.common.ec.EC_Consts;
import cz.crcs.ectester.common.ec.EC_Curve;
import cz.crcs.ectester.common.output.TestWriter;
import cz.crcs.ectester.common.test.TestException;
@@ -598,8 +598,8 @@ public class ECTesterStandalone {
timeUnit = lib.getNativeTimingUnit();
}
- String hashAlgo = sigIdent.getHashAlgo() != null ? String.format("[%s]", sigIdent.getHashAlgo()) : "";
- out.println(String.format("index;signTime[%s];verifyTime[%s];data;pubW;privS;signature%s;nonce;verified", timeUnit, timeUnit, hashAlgo));
+ String hashAlgoOut = sigIdent.getHashAlgo() != null ? String.format("[%s]", sigIdent.getHashAlgo()) : "";
+ out.println(String.format("index;signTime[%s];verifyTime[%s];data;pubW;privS;signature%s;nonce;verified", timeUnit, timeUnit, hashAlgoOut));
ECPrivateKey privkey = (ECPrivateKey) ECUtil.loadKey(EC_Consts.PARAMETER_S, cli.getOptionValue("ecdsa.named-private"), cli.getOptionValue("ecdsa.private"), spec);
ECPublicKey pubkey = (ECPublicKey) ECUtil.loadKey(EC_Consts.PARAMETER_W, cli.getOptionValue("ecdsa.named-public"), cli.getOptionValue("ecdsa.public"), spec);
@@ -658,7 +658,14 @@ public class ECTesterStandalone {
kSpec = privkey.getParams();
}
if (kSpec != null) {
- BigInteger kValue = ECUtil.recoverSignatureNonce(signature, data, privkey.getS(), kSpec, sigIdent);
+ // Parse the types out of SignatureIdent.
+ String hashAlgo = sigIdent.getHashAlgo();
+ String sigType = sigIdent.getSigType();
+ if (sigType == null) {
+ sigType = sigIdent.toString();
+ }
+
+ BigInteger kValue = ECUtil.recoverSignatureNonce(signature, data, privkey.getS(), kSpec, hashAlgo, sigType);
if (kValue != null) {
k = ByteUtil.bytesToHex(kValue.toByteArray(), false);
}
diff --git a/src/cz/crcs/ectester/standalone/consts/Ident.java b/standalone/src/main/java/cz/crcs/ectester/standalone/consts/Ident.java
index fcc811d..fcc811d 100644
--- a/src/cz/crcs/ectester/standalone/consts/Ident.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/consts/Ident.java
diff --git a/src/cz/crcs/ectester/standalone/consts/KeyAgreementIdent.java b/standalone/src/main/java/cz/crcs/ectester/standalone/consts/KeyAgreementIdent.java
index 9b912cb..60c60e8 100644
--- a/src/cz/crcs/ectester/standalone/consts/KeyAgreementIdent.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/consts/KeyAgreementIdent.java
@@ -90,8 +90,12 @@ public class KeyAgreementIdent extends Ident {
int split = alias.indexOf("with");
this.algo = alias.substring(0, split);
this.kdf = alias.substring(split + 4);
+ break;
}
}
+ if (this.algo == null) {
+ this.algo = name;
+ }
}
}
diff --git a/src/cz/crcs/ectester/standalone/consts/KeyPairGeneratorIdent.java b/standalone/src/main/java/cz/crcs/ectester/standalone/consts/KeyPairGeneratorIdent.java
index 83eef75..83eef75 100644
--- a/src/cz/crcs/ectester/standalone/consts/KeyPairGeneratorIdent.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/consts/KeyPairGeneratorIdent.java
diff --git a/src/cz/crcs/ectester/standalone/consts/SignatureIdent.java b/standalone/src/main/java/cz/crcs/ectester/standalone/consts/SignatureIdent.java
index c3913b7..c3913b7 100644
--- a/src/cz/crcs/ectester/standalone/consts/SignatureIdent.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/consts/SignatureIdent.java
diff --git a/src/cz/crcs/ectester/standalone/libs/BoringsslLib.java b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/BoringsslLib.java
index 60ca5d9..60ca5d9 100644
--- a/src/cz/crcs/ectester/standalone/libs/BoringsslLib.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/BoringsslLib.java
diff --git a/src/cz/crcs/ectester/standalone/libs/BotanLib.java b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/BotanLib.java
index cd28791..cd28791 100644
--- a/src/cz/crcs/ectester/standalone/libs/BotanLib.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/BotanLib.java
diff --git a/src/cz/crcs/ectester/standalone/libs/BouncyCastleLib.java b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/BouncyCastleLib.java
index c6600f9..c6600f9 100644
--- a/src/cz/crcs/ectester/standalone/libs/BouncyCastleLib.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/BouncyCastleLib.java
diff --git a/src/cz/crcs/ectester/standalone/libs/CryptoppLib.java b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/CryptoppLib.java
index 5112d7d..5112d7d 100644
--- a/src/cz/crcs/ectester/standalone/libs/CryptoppLib.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/CryptoppLib.java
diff --git a/src/cz/crcs/ectester/standalone/libs/ECLibrary.java b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/ECLibrary.java
index 0f81978..0f81978 100644
--- a/src/cz/crcs/ectester/standalone/libs/ECLibrary.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/ECLibrary.java
diff --git a/src/cz/crcs/ectester/standalone/libs/GcryptLib.java b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/GcryptLib.java
index a0a7fc8..a0a7fc8 100644
--- a/src/cz/crcs/ectester/standalone/libs/GcryptLib.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/GcryptLib.java
diff --git a/src/cz/crcs/ectester/standalone/libs/IppcpLib.java b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/IppcpLib.java
index 0dec0a2..0dec0a2 100644
--- a/src/cz/crcs/ectester/standalone/libs/IppcpLib.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/IppcpLib.java
diff --git a/src/cz/crcs/ectester/standalone/libs/LibresslLib.java b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/LibresslLib.java
index cee4e4d..cee4e4d 100644
--- a/src/cz/crcs/ectester/standalone/libs/LibresslLib.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/LibresslLib.java
diff --git a/src/cz/crcs/ectester/standalone/libs/MatrixsslLib.java b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/MatrixsslLib.java
index fcc13ea..fcc13ea 100644
--- a/src/cz/crcs/ectester/standalone/libs/MatrixsslLib.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/MatrixsslLib.java
diff --git a/src/cz/crcs/ectester/standalone/libs/MbedTLSLib.java b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/MbedTLSLib.java
index ace10d7..ace10d7 100644
--- a/src/cz/crcs/ectester/standalone/libs/MbedTLSLib.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/MbedTLSLib.java
diff --git a/src/cz/crcs/ectester/standalone/libs/MscngLib.java b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/MscngLib.java
index 527a65b..527a65b 100644
--- a/src/cz/crcs/ectester/standalone/libs/MscngLib.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/MscngLib.java
diff --git a/src/cz/crcs/ectester/standalone/libs/NativeECLibrary.java b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/NativeECLibrary.java
index db85b02..2f469aa 100644
--- a/src/cz/crcs/ectester/standalone/libs/NativeECLibrary.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/NativeECLibrary.java
@@ -34,7 +34,11 @@ public abstract class NativeECLibrary extends ProviderECLibrary {
Path libPath = libDir.resolve(resource + "." + suffix);
/* Write the shim. */
- FileUtil.writeNewer(ECTesterStandalone.LIB_RESOURCE_DIR + resource + "." + suffix, libPath);
+ boolean found = FileUtil.writeNewer(ECTesterStandalone.LIB_RESOURCE_DIR + resource + "." + suffix, libPath);
+ if (!found) {
+ //System.err.printf("Resource %s not found.\n", resource);
+ return false;
+ }
/* Load the requirements, if they are bundled, write them in and load them. */
try {
@@ -42,13 +46,19 @@ public abstract class NativeECLibrary extends ProviderECLibrary {
if (requirement.endsWith(suffix)) {
/* The requirement is bundled, write it */
Path reqPath = libReqDir.resolve(requirement);
- FileUtil.writeNewer(ECTesterStandalone.LIB_RESOURCE_DIR + requirement, reqPath);
+ found = FileUtil.writeNewer(ECTesterStandalone.LIB_RESOURCE_DIR + requirement, reqPath);
+ if (!found) {
+ //System.err.printf("Requirement %s not found for %s.\n", requirement, resource);
+ return false;
+ }
System.load(reqPath.toString());
} else {
System.loadLibrary(requirement);
}
}
} catch (UnsatisfiedLinkError ule) {
+ System.err.println(resource);
+ ule.printStackTrace();
return false;
}
@@ -57,6 +67,8 @@ public abstract class NativeECLibrary extends ProviderECLibrary {
provider = createProvider();
return super.initialize();
} catch (IOException | UnsatisfiedLinkError ignored) {
+ System.err.println(resource);
+ ignored.printStackTrace();
}
return false;
}
diff --git a/src/cz/crcs/ectester/standalone/libs/NettleLib.java b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/NettleLib.java
index 00e3b39..00e3b39 100644
--- a/src/cz/crcs/ectester/standalone/libs/NettleLib.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/NettleLib.java
diff --git a/src/cz/crcs/ectester/standalone/libs/OpensslLib.java b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/OpensslLib.java
index e558336..e558336 100644
--- a/src/cz/crcs/ectester/standalone/libs/OpensslLib.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/OpensslLib.java
diff --git a/src/cz/crcs/ectester/standalone/libs/ProviderECLibrary.java b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/ProviderECLibrary.java
index dd8e49c..dd8e49c 100644
--- a/src/cz/crcs/ectester/standalone/libs/ProviderECLibrary.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/ProviderECLibrary.java
diff --git a/src/cz/crcs/ectester/standalone/libs/SunECLib.java b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/SunECLib.java
index 3aec842..3aec842 100644
--- a/src/cz/crcs/ectester/standalone/libs/SunECLib.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/SunECLib.java
diff --git a/src/cz/crcs/ectester/standalone/libs/TomcryptLib.java b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/TomcryptLib.java
index 78db00e..78db00e 100644
--- a/src/cz/crcs/ectester/standalone/libs/TomcryptLib.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/TomcryptLib.java
diff --git a/src/cz/crcs/ectester/standalone/libs/WolfCryptLib.java b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/WolfCryptLib.java
index b58eb91..b58eb91 100644
--- a/src/cz/crcs/ectester/standalone/libs/WolfCryptLib.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/WolfCryptLib.java
diff --git a/src/cz/crcs/ectester/standalone/libs/jni/NativeECPrivateKey.java b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/jni/NativeECPrivateKey.java
index 81bd387..81bd387 100644
--- a/src/cz/crcs/ectester/standalone/libs/jni/NativeECPrivateKey.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/jni/NativeECPrivateKey.java
diff --git a/src/cz/crcs/ectester/standalone/libs/jni/NativeECPublicKey.java b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/jni/NativeECPublicKey.java
index 7a8de83..7a8de83 100644
--- a/src/cz/crcs/ectester/standalone/libs/jni/NativeECPublicKey.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/jni/NativeECPublicKey.java
diff --git a/src/cz/crcs/ectester/standalone/libs/jni/NativeKeyAgreementSpi.java b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/jni/NativeKeyAgreementSpi.java
index 1e68f78..1e68f78 100644
--- a/src/cz/crcs/ectester/standalone/libs/jni/NativeKeyAgreementSpi.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/jni/NativeKeyAgreementSpi.java
diff --git a/src/cz/crcs/ectester/standalone/libs/jni/NativeKeyPairGeneratorSpi.java b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/jni/NativeKeyPairGeneratorSpi.java
index 636f423..636f423 100644
--- a/src/cz/crcs/ectester/standalone/libs/jni/NativeKeyPairGeneratorSpi.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/jni/NativeKeyPairGeneratorSpi.java
diff --git a/src/cz/crcs/ectester/standalone/libs/jni/NativeProvider.java b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/jni/NativeProvider.java
index e036937..e036937 100644
--- a/src/cz/crcs/ectester/standalone/libs/jni/NativeProvider.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/jni/NativeProvider.java
diff --git a/src/cz/crcs/ectester/standalone/libs/jni/NativeSignatureSpi.java b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/jni/NativeSignatureSpi.java
index d6e814c..d6e814c 100644
--- a/src/cz/crcs/ectester/standalone/libs/jni/NativeSignatureSpi.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/jni/NativeSignatureSpi.java
diff --git a/src/cz/crcs/ectester/standalone/output/TextTestWriter.java b/standalone/src/main/java/cz/crcs/ectester/standalone/output/TextTestWriter.java
index d7be4dc..d7be4dc 100644
--- a/src/cz/crcs/ectester/standalone/output/TextTestWriter.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/output/TextTestWriter.java
diff --git a/src/cz/crcs/ectester/standalone/output/XMLTestWriter.java b/standalone/src/main/java/cz/crcs/ectester/standalone/output/XMLTestWriter.java
index 812634f..812634f 100644
--- a/src/cz/crcs/ectester/standalone/output/XMLTestWriter.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/output/XMLTestWriter.java
diff --git a/src/cz/crcs/ectester/standalone/output/YAMLTestWriter.java b/standalone/src/main/java/cz/crcs/ectester/standalone/output/YAMLTestWriter.java
index ee8a199..ee8a199 100644
--- a/src/cz/crcs/ectester/standalone/output/YAMLTestWriter.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/output/YAMLTestWriter.java
diff --git a/src/cz/crcs/ectester/standalone/test/base/KeyAgreementTest.java b/standalone/src/main/java/cz/crcs/ectester/standalone/test/base/KeyAgreementTest.java
index fd48212..fd48212 100644
--- a/src/cz/crcs/ectester/standalone/test/base/KeyAgreementTest.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/test/base/KeyAgreementTest.java
diff --git a/src/cz/crcs/ectester/standalone/test/base/KeyAgreementTestable.java b/standalone/src/main/java/cz/crcs/ectester/standalone/test/base/KeyAgreementTestable.java
index 7fd1c5a..7fd1c5a 100644
--- a/src/cz/crcs/ectester/standalone/test/base/KeyAgreementTestable.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/test/base/KeyAgreementTestable.java
diff --git a/src/cz/crcs/ectester/standalone/test/base/KeyGeneratorTest.java b/standalone/src/main/java/cz/crcs/ectester/standalone/test/base/KeyGeneratorTest.java
index 32f82cb..32f82cb 100644
--- a/src/cz/crcs/ectester/standalone/test/base/KeyGeneratorTest.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/test/base/KeyGeneratorTest.java
diff --git a/src/cz/crcs/ectester/standalone/test/base/KeyGeneratorTestable.java b/standalone/src/main/java/cz/crcs/ectester/standalone/test/base/KeyGeneratorTestable.java
index c05d6e3..c05d6e3 100644
--- a/src/cz/crcs/ectester/standalone/test/base/KeyGeneratorTestable.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/test/base/KeyGeneratorTestable.java
diff --git a/src/cz/crcs/ectester/standalone/test/base/PerformanceTest.java b/standalone/src/main/java/cz/crcs/ectester/standalone/test/base/PerformanceTest.java
index 258ca12..258ca12 100644
--- a/src/cz/crcs/ectester/standalone/test/base/PerformanceTest.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/test/base/PerformanceTest.java
diff --git a/src/cz/crcs/ectester/standalone/test/base/SignatureTest.java b/standalone/src/main/java/cz/crcs/ectester/standalone/test/base/SignatureTest.java
index a817691..a817691 100644
--- a/src/cz/crcs/ectester/standalone/test/base/SignatureTest.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/test/base/SignatureTest.java
diff --git a/src/cz/crcs/ectester/standalone/test/base/SignatureTestable.java b/standalone/src/main/java/cz/crcs/ectester/standalone/test/base/SignatureTestable.java
index fe81b10..fe81b10 100644
--- a/src/cz/crcs/ectester/standalone/test/base/SignatureTestable.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/test/base/SignatureTestable.java
diff --git a/src/cz/crcs/ectester/standalone/test/base/StandaloneTestable.java b/standalone/src/main/java/cz/crcs/ectester/standalone/test/base/StandaloneTestable.java
index 47bffc1..47bffc1 100644
--- a/src/cz/crcs/ectester/standalone/test/base/StandaloneTestable.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/test/base/StandaloneTestable.java
diff --git a/src/cz/crcs/ectester/standalone/test/suites/StandaloneCofactorSuite.java b/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneCofactorSuite.java
index 52b0fbf..52b0fbf 100644
--- a/src/cz/crcs/ectester/standalone/test/suites/StandaloneCofactorSuite.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneCofactorSuite.java
diff --git a/src/cz/crcs/ectester/standalone/test/suites/StandaloneCompositeSuite.java b/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneCompositeSuite.java
index c59d864..c59d864 100644
--- a/src/cz/crcs/ectester/standalone/test/suites/StandaloneCompositeSuite.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneCompositeSuite.java
diff --git a/src/cz/crcs/ectester/standalone/test/suites/StandaloneDefaultSuite.java b/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneDefaultSuite.java
index 1c14ecc..1c14ecc 100644
--- a/src/cz/crcs/ectester/standalone/test/suites/StandaloneDefaultSuite.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneDefaultSuite.java
diff --git a/src/cz/crcs/ectester/standalone/test/suites/StandaloneDegenerateSuite.java b/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneDegenerateSuite.java
index 9ab8a39..9ab8a39 100644
--- a/src/cz/crcs/ectester/standalone/test/suites/StandaloneDegenerateSuite.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneDegenerateSuite.java
diff --git a/src/cz/crcs/ectester/standalone/test/suites/StandaloneEdgeCasesSuite.java b/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneEdgeCasesSuite.java
index 3624aaa..1900bea 100644
--- a/src/cz/crcs/ectester/standalone/test/suites/StandaloneEdgeCasesSuite.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneEdgeCasesSuite.java
@@ -1,6 +1,5 @@
package cz.crcs.ectester.standalone.test.suites;
-import cz.crcs.ectester.applet.EC_Consts;
import cz.crcs.ectester.common.cli.TreeCommandLine;
import cz.crcs.ectester.common.ec.*;
import cz.crcs.ectester.common.output.TestWriter;
diff --git a/src/cz/crcs/ectester/standalone/test/suites/StandaloneInvalidSuite.java b/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneInvalidSuite.java
index ace8945..ace8945 100644
--- a/src/cz/crcs/ectester/standalone/test/suites/StandaloneInvalidSuite.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneInvalidSuite.java
diff --git a/src/cz/crcs/ectester/standalone/test/suites/StandaloneMiscSuite.java b/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneMiscSuite.java
index f3a10eb..f3a10eb 100644
--- a/src/cz/crcs/ectester/standalone/test/suites/StandaloneMiscSuite.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneMiscSuite.java
diff --git a/src/cz/crcs/ectester/standalone/test/suites/StandalonePerformanceSuite.java b/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandalonePerformanceSuite.java
index dd50862..dd50862 100644
--- a/src/cz/crcs/ectester/standalone/test/suites/StandalonePerformanceSuite.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandalonePerformanceSuite.java
diff --git a/src/cz/crcs/ectester/standalone/test/suites/StandaloneSignatureSuite.java b/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneSignatureSuite.java
index 94e810e..94e810e 100644
--- a/src/cz/crcs/ectester/standalone/test/suites/StandaloneSignatureSuite.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneSignatureSuite.java
diff --git a/src/cz/crcs/ectester/standalone/test/suites/StandaloneTestSuite.java b/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneTestSuite.java
index e4e0013..e4e0013 100644
--- a/src/cz/crcs/ectester/standalone/test/suites/StandaloneTestSuite.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneTestSuite.java
diff --git a/src/cz/crcs/ectester/standalone/test/suites/StandaloneTestVectorSuite.java b/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneTestVectorSuite.java
index 1e1889c..1e1889c 100644
--- a/src/cz/crcs/ectester/standalone/test/suites/StandaloneTestVectorSuite.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneTestVectorSuite.java
diff --git a/src/cz/crcs/ectester/standalone/test/suites/StandaloneTwistSuite.java b/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneTwistSuite.java
index f182952..f182952 100644
--- a/src/cz/crcs/ectester/standalone/test/suites/StandaloneTwistSuite.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneTwistSuite.java
diff --git a/src/cz/crcs/ectester/standalone/test/suites/StandaloneWrongSuite.java b/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneWrongSuite.java
index 79b0b7d..a457a33 100644
--- a/src/cz/crcs/ectester/standalone/test/suites/StandaloneWrongSuite.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/test/suites/StandaloneWrongSuite.java
@@ -1,6 +1,5 @@
package cz.crcs.ectester.standalone.test.suites;
-import cz.crcs.ectester.applet.EC_Consts;
import cz.crcs.ectester.common.cli.TreeCommandLine;
import cz.crcs.ectester.common.ec.*;
import cz.crcs.ectester.common.output.TestWriter;
@@ -253,7 +252,7 @@ public class StandaloneWrongSuite extends StandaloneTestSuite {
*/
curveMap = EC_Store.getInstance().getObjects(EC_Curve.class, "secg");
curves = curveMap.entrySet().stream().filter((e) -> e.getKey().endsWith("r1") &&
- e.getValue().getField() == javacard.security.KeyPair.ALG_EC_F2M).map(Map.Entry::getValue).collect(Collectors.toList());
+ e.getValue().getField() == EC_Consts.ALG_EC_F2M).map(Map.Entry::getValue).collect(Collectors.toList());
for (EC_Curve curve : curves) {
short bits = curve.getBits();
byte[][] coeffBytes;
diff --git a/src/cz/crcs/ectester/standalone/libs/jni/.clang-format b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/.clang-format
index 0aa8562..0aa8562 100644
--- a/src/cz/crcs/ectester/standalone/libs/jni/.clang-format
+++ b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/.clang-format
diff --git a/src/cz/crcs/ectester/standalone/libs/jni/.gitignore b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/.gitignore
index 7e8075a..777d8e0 100644
--- a/src/cz/crcs/ectester/standalone/libs/jni/.gitignore
+++ b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/.gitignore
@@ -1,6 +1,8 @@
libcore_s.a
libcrypt_s.a
matrixssl/
+*.o
+*.so
CMakeLists.txt
cmake-build-debug \ No newline at end of file
diff --git a/src/cz/crcs/ectester/standalone/libs/jni/Makefile b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/Makefile
index c3995e3..cc3f24f 100644
--- a/src/cz/crcs/ectester/standalone/libs/jni/Makefile
+++ b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/Makefile
@@ -9,6 +9,7 @@ CFLAGS+=-fPIC -I"$(JNI_INCLUDEDIR)" -I"$(JNI_PLATFORMINCLUDEDIR)" -I.
CXXFLAGS+=-fPIC -I"$(JNI_INCLUDEDIR)" -I"$(JNI_PLATFORMINCLUDEDIR)" -I.
DEBUG ?= 0
+PROJECT_ROOT_PATH ?= ../../../../../../../../../..
ifeq ($(DEBUG), 1)
CFLAGS+=-g -Wall
@@ -85,13 +86,13 @@ openssl.o: openssl.c
boringssl: boringssl_provider.so
lib_boringssl.so:
- cp ../../../../../../../ext/boringssl/build/crypto/libcrypto.so lib_boringssl.so
+ cp $(PROJECT_ROOT_PATH)/ext/boringssl/build/crypto/libcrypto.so lib_boringssl.so
boringssl_provider.so: boringssl.o c_utils.o | lib_timing.so lib_boringssl.so
$(CC) $(LFLAGS) -o $@ -Wl,-rpath,'$$ORIGIN/lib' $^ -L. lib_boringssl.so -l:lib_timing.so
boringssl.o: boringssl.c
- $(CC) -I../../../../../../../ext/boringssl/include/ $(CFLAGS) -c $<
+ $(CC) -I$(PROJECT_ROOT_PATH)/ext/boringssl/include/ $(CFLAGS) -c $<
# libgcrypt shim
@@ -152,13 +153,13 @@ mbedtls.o: mbedtls.c
ippcp: ippcp_provider.so
lib_ippcp.so:
- cp ../../../../../../../ext/ipp-crypto/build/.build/RELEASE/lib/libippcp.so lib_ippcp.so
+ cp $(PROJECT_ROOT_PATH)/ext/ipp-crypto/build/.build/RELEASE/lib/libippcp.so lib_ippcp.so
ippcp_provider.so: ippcp.o c_utils.o | lib_timing.so lib_ippcp.so
$(CC) $(LFLAGS) -o $@ -Wl,-rpath,'$$ORIGIN/lib' $^ -L. lib_ippcp.so -l:lib_timing.so
ippcp.o: ippcp.c
- $(CC) -I../../../../../../../ext/ipp-crypto/build/.build/RELEASE/include/ $(CFLAGS) -c $<
+ $(CC) -I$(PROJECT_ROOT_PATH)/ext/ipp-crypto/build/.build/RELEASE/include/ $(CFLAGS) -c $<
# MatrixSSL shim
@@ -185,13 +186,13 @@ nettle.o: nettle.c
libressl: libressl_provider.so
lib_libressl.so:
- cp ../../../../../../../ext/libressl/build/crypto/libcrypto.so lib_libressl.so
+ cp $(PROJECT_ROOT_PATH)/ext/libressl/build/crypto/libcrypto.so lib_libressl.so
libressl_provider.so: libressl.o c_utils.o | lib_timing.so lib_libressl.so
$(CC) $(LFLAGS) -o $@ -Wl,-rpath,'$$ORIGIN/lib' $^ -L. lib_libressl.so -l:lib_timing.so
libressl.o: libressl.c
- $(CC) -I../../../../../../../ext/libressl/include/ $(CFLAGS) -c $<
+ $(CC) -I$(PROJECT_ROOT_PATH)/ext/libressl/include/ $(CFLAGS) -c $<
help:
diff --git a/src/cz/crcs/ectester/standalone/libs/jni/Makefile.bat b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/Makefile.bat
index a8b51f4..e6c98d5 100755
--- a/src/cz/crcs/ectester/standalone/libs/jni/Makefile.bat
+++ b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/Makefile.bat
@@ -1,163 +1,163 @@
-@if not defined _echo echo off
-setlocal EnableDelayedExpansion
-
-:: ENV variables respected:
-:: - JAVA_HOME
-:: - CC
-:: - USE_EXT_MSCNG
-:: - DEBUG
-
-:: See if we are cleaning.
-if "%1" == "clean" (
- echo ** cleaning
- del *.dll *.exp *.lib *.obj
- exit
-)
-
-set TAB=
-
-
-:: Determine arch.
-reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL 2>&1 && (set ARCH=32& set ARCH_S=x86& set ARCH_VS=x86) || (set ARCH=64& set ARCH_S=x64& set ARCH_VS=amd64)
-
-echo ** ARCH%TAB%%TAB%%ARCH_S%
-
-
-:: Find a working visual studio environment.
-set found=0
-set vsw_path="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
-
-set vs_path=
-for /f "usebackq delims=" %%i in (`%vsw_path% -nologo -prerelease -latest -property installationPath`) do (
- if exist "%%i\Common7\Tools\vsdevcmd.bat" (
- echo ** VsDevCmd%TAB%%TAB%%%i\Common7\Tools\vsdevcmd.bat
- call "%%i\Common7\Tools\vsdevcmd.bat" -no_logo -arch=%ARCH_VS%
- if ERRORLEVEL 1 (
- echo nope.
- ) else (
- set found=1
- set vs_path=%%i
- break
- )
- )
-)
-
-:: Test if we have a visual studio env.
-if %found% EQU 0 (
- echo Working VsDevCmd not found.
- exit /b 2
-)
-
-echo ** VS_PATH%TAB%%TAB%%vs_path%
-
-
-:: Try to find vcruntime.
-set vc_base=%vs_path%\VC\Tools\MSVC\
-if exist %vc_base% (
- set vc_version=
- for /f "delims=" %%i in ('dir /b /on "!vc_base!"') do (
- set vc_version=%%i
- )
- echo ** VC_VERSION%TAB%!vc_version!
- set vc_include=%vc_base%!vc_version!\include
- set vc_lib=%vc_base%!vc_version!\lib\%ARCH_S%
-)
-
-
-:: Get the paths to Microsoft CNG SDK.
-set root_rel=..\..\..\..\..\..\..\
-set mscng_rel_include=ext\mscng\10\Include
-set mscng_rel_lib=ext\mscng\10\Lib
-
-pushd %root_rel%
-pushd %mscng_rel_include%
-set mscng_include=%CD%
-popd
-pushd %mscng_rel_lib%
-set mscng_lib=%CD%
-popd
-popd
-
-set mscng_lib_arch=%mscng_lib%\X%ARCH%
-
-echo ** CNG_INCLUDE%TAB%%mscng_include%
-echo ** CNG_LIB%TAB%%TAB%%mscng_lib_arch%
-
-
-:: Get the paths to Java JNI.
-if not defined JAVA_HOME (
- set jva=
- for /f "delims=" %%i in ('where javac') do (
- set jva=%%~dpi
- )
- pushd !jva!\..
- set JAVA_HOME=!CD!
- popd
-)
-
-echo ** JAVA_HOME%TAB%%JAVA_HOME%
-
-set JNI_INCLUDEDIR=%JAVA_HOME%\include
-set JNI_PLATFORMINCLUDEDIR=%JNI_INCLUDEDIR%\win32
-set JNI_LIBDIR=%JAVA_HOME%\lib
-
-
-:: Setup binaries.
-if not defined CC (
- set CC=cl.exe
-)
-
-echo ** CC%TAB%%TAB%%CC%
-
-
-:: Try to find uCRT.
-set ucrt_base=%ProgramFiles(x86)%\Windows Kits\10\
-if exist %ucrt_base% (
- set ucrt_version=
- for /f "delims=" %%i in ('dir /b /on "!ucrt_base!\Include"') do (
- set ucrt_version=%%i
- )
- echo ** uCRT%TAB%%TAB%!ucrt_version!
- set ucrt_include=%ucrt_base%Include\!ucrt_version!\ucrt
- set ucrt_lib=%ucrt_base%Lib\!ucrt_version!
- set ucrt_lib_arch=!ucrt_lib!\ucrt\%ARCH_S%
-)
-
-
-:: Setup INCLUDE paths.
-set INCLUDE_CLI=/I. /I"%JNI_INCLUDEDIR%" /I"%JNI_PLATFORMINCLUDEDIR%"
-
-if defined USE_EXT_MSCNG (
- set INCLUDE_CLI=!INCLUDE_CLI! /I"%mscng_include%"
-)
-
-echo ** INCLUDE%TAB%%TAB%%INCLUDE%
-echo ** INCLUDE_CLI%TAB%%INCLUDE_CLI%
-
-
-:: Setup LIB paths.
-set LIBPATH=/LIBPATH:"%JNI_LIBDIR%"
-
-if defined USE_EXT_MSCNG (
- set LIBPATH=!LIBPATH! /LIBPATH:"%mscng_lib_arch%"
-)
-
-echo ** LIB%TAB%%TAB%%LIB%
-echo ** LIBPATH%TAB%%TAB%%LIBPATH%
-
-
-:: Setup DEBUB options.
-set OTHER_CLI=
-if defined DEBUG (
- set OTHER_CLI=/Od /Z7
-) else (
- set OTHER_CLI=/O2
-)
-
-echo ** OTHER_CLI%TAB%%OTHER_CLI%
-echo.
-
-echo ^>^> %CC% /W2 /EHsc %OTHER_CLI% %INCLUDE_CLI% mscng.c c_utils.c c_timing.c bcrypt.lib jvm.lib kernel32.lib /Femscng_provider.dll /LD /link %LIBPATH% /nologo
-echo.
-
-%CC% /W2 /EHsc %OTHER_CLI% %INCLUDE_CLI% mscng.c c_utils.c c_timing.c bcrypt.lib jvm.lib kernel32.lib /Femscng_provider.dll /LD /link %LIBPATH% /nologo
+@if not defined _echo echo off
+setlocal EnableDelayedExpansion
+
+:: ENV variables respected:
+:: - JAVA_HOME
+:: - CC
+:: - USE_EXT_MSCNG
+:: - DEBUG
+
+:: See if we are cleaning.
+if "%1" == "clean" (
+ echo ** cleaning
+ del *.dll *.exp *.lib *.obj
+ exit
+)
+
+set TAB=
+
+
+:: Determine arch.
+reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL 2>&1 && (set ARCH=32& set ARCH_S=x86& set ARCH_VS=x86) || (set ARCH=64& set ARCH_S=x64& set ARCH_VS=amd64)
+
+echo ** ARCH%TAB%%TAB%%ARCH_S%
+
+
+:: Find a working visual studio environment.
+set found=0
+set vsw_path="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
+
+set vs_path=
+for /f "usebackq delims=" %%i in (`%vsw_path% -nologo -prerelease -latest -property installationPath`) do (
+ if exist "%%i\Common7\Tools\vsdevcmd.bat" (
+ echo ** VsDevCmd%TAB%%TAB%%%i\Common7\Tools\vsdevcmd.bat
+ call "%%i\Common7\Tools\vsdevcmd.bat" -no_logo -arch=%ARCH_VS%
+ if ERRORLEVEL 1 (
+ echo nope.
+ ) else (
+ set found=1
+ set vs_path=%%i
+ break
+ )
+ )
+)
+
+:: Test if we have a visual studio env.
+if %found% EQU 0 (
+ echo Working VsDevCmd not found.
+ exit /b 2
+)
+
+echo ** VS_PATH%TAB%%TAB%%vs_path%
+
+
+:: Try to find vcruntime.
+set vc_base=%vs_path%\VC\Tools\MSVC\
+if exist %vc_base% (
+ set vc_version=
+ for /f "delims=" %%i in ('dir /b /on "!vc_base!"') do (
+ set vc_version=%%i
+ )
+ echo ** VC_VERSION%TAB%!vc_version!
+ set vc_include=%vc_base%!vc_version!\include
+ set vc_lib=%vc_base%!vc_version!\lib\%ARCH_S%
+)
+
+
+:: Get the paths to Microsoft CNG SDK.
+set root_rel=..\..\..\..\..\..\..\
+set mscng_rel_include=ext\mscng\10\Include
+set mscng_rel_lib=ext\mscng\10\Lib
+
+pushd %root_rel%
+pushd %mscng_rel_include%
+set mscng_include=%CD%
+popd
+pushd %mscng_rel_lib%
+set mscng_lib=%CD%
+popd
+popd
+
+set mscng_lib_arch=%mscng_lib%\X%ARCH%
+
+echo ** CNG_INCLUDE%TAB%%mscng_include%
+echo ** CNG_LIB%TAB%%TAB%%mscng_lib_arch%
+
+
+:: Get the paths to Java JNI.
+if not defined JAVA_HOME (
+ set jva=
+ for /f "delims=" %%i in ('where javac') do (
+ set jva=%%~dpi
+ )
+ pushd !jva!\..
+ set JAVA_HOME=!CD!
+ popd
+)
+
+echo ** JAVA_HOME%TAB%%JAVA_HOME%
+
+set JNI_INCLUDEDIR=%JAVA_HOME%\include
+set JNI_PLATFORMINCLUDEDIR=%JNI_INCLUDEDIR%\win32
+set JNI_LIBDIR=%JAVA_HOME%\lib
+
+
+:: Setup binaries.
+if not defined CC (
+ set CC=cl.exe
+)
+
+echo ** CC%TAB%%TAB%%CC%
+
+
+:: Try to find uCRT.
+set ucrt_base=%ProgramFiles(x86)%\Windows Kits\10\
+if exist %ucrt_base% (
+ set ucrt_version=
+ for /f "delims=" %%i in ('dir /b /on "!ucrt_base!\Include"') do (
+ set ucrt_version=%%i
+ )
+ echo ** uCRT%TAB%%TAB%!ucrt_version!
+ set ucrt_include=%ucrt_base%Include\!ucrt_version!\ucrt
+ set ucrt_lib=%ucrt_base%Lib\!ucrt_version!
+ set ucrt_lib_arch=!ucrt_lib!\ucrt\%ARCH_S%
+)
+
+
+:: Setup INCLUDE paths.
+set INCLUDE_CLI=/I. /I"%JNI_INCLUDEDIR%" /I"%JNI_PLATFORMINCLUDEDIR%"
+
+if defined USE_EXT_MSCNG (
+ set INCLUDE_CLI=!INCLUDE_CLI! /I"%mscng_include%"
+)
+
+echo ** INCLUDE%TAB%%TAB%%INCLUDE%
+echo ** INCLUDE_CLI%TAB%%INCLUDE_CLI%
+
+
+:: Setup LIB paths.
+set LIBPATH=/LIBPATH:"%JNI_LIBDIR%"
+
+if defined USE_EXT_MSCNG (
+ set LIBPATH=!LIBPATH! /LIBPATH:"%mscng_lib_arch%"
+)
+
+echo ** LIB%TAB%%TAB%%LIB%
+echo ** LIBPATH%TAB%%TAB%%LIBPATH%
+
+
+:: Setup DEBUB options.
+set OTHER_CLI=
+if defined DEBUG (
+ set OTHER_CLI=/Od /Z7
+) else (
+ set OTHER_CLI=/O2
+)
+
+echo ** OTHER_CLI%TAB%%OTHER_CLI%
+echo.
+
+echo ^>^> %CC% /W2 /EHsc %OTHER_CLI% %INCLUDE_CLI% mscng.c c_utils.c c_timing.c bcrypt.lib jvm.lib kernel32.lib /Femscng_provider.dll /LD /link %LIBPATH% /nologo
+echo.
+
+%CC% /W2 /EHsc %OTHER_CLI% %INCLUDE_CLI% mscng.c c_utils.c c_timing.c bcrypt.lib jvm.lib kernel32.lib /Femscng_provider.dll /LD /link %LIBPATH% /nologo
diff --git a/src/cz/crcs/ectester/standalone/libs/jni/boringssl.c b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/boringssl.c
index bca2ead..bca2ead 100644
--- a/src/cz/crcs/ectester/standalone/libs/jni/boringssl.c
+++ b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/boringssl.c
diff --git a/src/cz/crcs/ectester/standalone/libs/jni/botan.cpp b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/botan.cpp
index c0d249c..c0d249c 100644
--- a/src/cz/crcs/ectester/standalone/libs/jni/botan.cpp
+++ b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/botan.cpp
diff --git a/src/cz/crcs/ectester/standalone/libs/jni/c_timing.c b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/c_timing.c
index 018ceda..018ceda 100644
--- a/src/cz/crcs/ectester/standalone/libs/jni/c_timing.c
+++ b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/c_timing.c
diff --git a/src/cz/crcs/ectester/standalone/libs/jni/c_timing.h b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/c_timing.h
index e12ccdd..e12ccdd 100644
--- a/src/cz/crcs/ectester/standalone/libs/jni/c_timing.h
+++ b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/c_timing.h
diff --git a/src/cz/crcs/ectester/standalone/libs/jni/c_utils.c b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/c_utils.c
index 46286fd..46286fd 100644
--- a/src/cz/crcs/ectester/standalone/libs/jni/c_utils.c
+++ b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/c_utils.c
diff --git a/src/cz/crcs/ectester/standalone/libs/jni/c_utils.h b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/c_utils.h
index f2f3f2f..f2f3f2f 100644
--- a/src/cz/crcs/ectester/standalone/libs/jni/c_utils.h
+++ b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/c_utils.h
diff --git a/src/cz/crcs/ectester/standalone/libs/jni/cpp_utils.cpp b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/cpp_utils.cpp
index 20d9a3c..20d9a3c 100644
--- a/src/cz/crcs/ectester/standalone/libs/jni/cpp_utils.cpp
+++ b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/cpp_utils.cpp
diff --git a/src/cz/crcs/ectester/standalone/libs/jni/cpp_utils.hpp b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/cpp_utils.hpp
index ed26c01..ed26c01 100644
--- a/src/cz/crcs/ectester/standalone/libs/jni/cpp_utils.hpp
+++ b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/cpp_utils.hpp
diff --git a/src/cz/crcs/ectester/standalone/libs/jni/cryptopp.cpp b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/cryptopp.cpp
index eb782b7..eb782b7 100644
--- a/src/cz/crcs/ectester/standalone/libs/jni/cryptopp.cpp
+++ b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/cryptopp.cpp
diff --git a/src/cz/crcs/ectester/standalone/libs/jni/gcrypt.c b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/gcrypt.c
index 5d29d2c..5d29d2c 100644
--- a/src/cz/crcs/ectester/standalone/libs/jni/gcrypt.c
+++ b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/gcrypt.c
diff --git a/src/cz/crcs/ectester/standalone/libs/jni/ippcp.c b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/ippcp.c
index 98a4c36..98a4c36 100644
--- a/src/cz/crcs/ectester/standalone/libs/jni/ippcp.c
+++ b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/ippcp.c
diff --git a/src/cz/crcs/ectester/standalone/libs/jni/libressl.c b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/libressl.c
index 79227f8..79227f8 100644
--- a/src/cz/crcs/ectester/standalone/libs/jni/libressl.c
+++ b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/libressl.c
diff --git a/src/cz/crcs/ectester/standalone/libs/jni/matrixssl.c b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/matrixssl.c
index 8324dd4..8324dd4 100644
--- a/src/cz/crcs/ectester/standalone/libs/jni/matrixssl.c
+++ b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/matrixssl.c
diff --git a/src/cz/crcs/ectester/standalone/libs/jni/mbedtls.c b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/mbedtls.c
index 2cff6ff..2cff6ff 100644
--- a/src/cz/crcs/ectester/standalone/libs/jni/mbedtls.c
+++ b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/mbedtls.c
diff --git a/src/cz/crcs/ectester/standalone/libs/jni/mscng.c b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/mscng.c
index a182b98..bb27887 100644
--- a/src/cz/crcs/ectester/standalone/libs/jni/mscng.c
+++ b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/mscng.c
@@ -1,1273 +1,1273 @@
-#include <windows.h>
-#include <bcrypt.h>
-#include "native.h"
-
-#include "c_timing.h"
-#include "c_utils.h"
-
-// BCRYPT and NT things.
-#define NT_SUCCESS(status) (((NTSTATUS)(status)) >= 0)
-#define NT_FAILURE(status) !NT_SUCCESS(status)
-
-#define STATUS_SUCCESS 0x00000000
-#define STATUS_INVALID_SIGNATURE 0xC000A000
-
-typedef struct {
- ULONG dwVersion; // Version of the structure
- ECC_CURVE_TYPE_ENUM dwCurveType; // Supported curve types.
- ECC_CURVE_ALG_ID_ENUM dwCurveGenerationAlgId; // For X.592 verification purposes, if we include Seed we will need to include the algorithm ID.
- ULONG cbFieldLength; // Byte length of the fields P, A, B, X, Y.
- ULONG cbSubgroupOrder; // Byte length of the subgroup.
- ULONG cbCofactor; // Byte length of cofactor of G in E.
- ULONG cbSeed; // Byte length of the seed used to generate the curve.
-} BCRYPT_ECC_PARAMETER_HEADER;
-
-// Provider things
-static jclass provider_class;
-
-#define KEYFLAG_IMPLICIT 0 // Mscng native key, over named curve
-#define KEYFLAG_EXPLICIT 1 // Mscng native key, over explicit ecc parameters
-#define KEYFLAG_NIST 2 // Mscng native key, over NIST parameters, custom ECDH/ECDSA_P* algo
-#define KEYFLAG_OTHER 3 // Other key, explicit ecc parameters
-
-JNIEXPORT jobject JNICALL Java_cz_crcs_ectester_standalone_libs_MscngLib_createProvider(JNIEnv *env, jobject self) {
- jclass local_provider_class = (*env)->FindClass(env, "cz/crcs/ectester/standalone/libs/jni/NativeProvider$Mscng");
- provider_class = (*env)->NewGlobalRef(env, local_provider_class);
-
- jmethodID init = (*env)->GetMethodID(env, local_provider_class, "<init>", "(Ljava/lang/String;DLjava/lang/String;)V");
-
- jstring name = (*env)->NewStringUTF(env, "Microsoft CNG");
- double version = 1.0;
-
- return (*env)->NewObject(env, provider_class, init, name, version, name);
-}
-
-JNIEXPORT void JNICALL Java_cz_crcs_ectester_standalone_libs_jni_NativeProvider_00024Mscng_setup(JNIEnv *env, jobject self) {
- INIT_PROVIDER(env, provider_class);
-
- ADD_KPG(env, self, "ECDH", "MscngECDH");
- ADD_KPG(env, self, "ECDSA", "MscngECDSA");
-
- ADD_KA(env, self, "ECDHwithSHA1KDF(CNG)", "MscngECDHwithSHA1KDF");
- ADD_KA(env, self, "ECDHwithSHA256KDF(CNG)", "MscngECDHwithSHA256KDF");
- ADD_KA(env, self, "ECDHwithSHA384KDF(CNG)", "MscngECDHwithSHA384KDF");
- ADD_KA(env, self, "ECDHwithSHA512KDF(CNG)", "MscngECDHwithSHA512KDF");
-
- ADD_SIG(env, self, "SHA1withECDSA", "MscngECDSAwithSHA1");
- ADD_SIG(env, self, "SHA256withECDSA", "MscngECDSAwithSHA256");
- ADD_SIG(env, self, "SHA384withECDSA", "MscngECDSAwithSHA384");
- ADD_SIG(env, self, "SHA512withECDSA", "MscngECDSAwithSHA112");
-
- init_classes(env, "Mscng");
-}
-
-typedef struct {
- LPCSTR name;
- ULONG bits;
-} named_curve_t;
-
-static named_curve_t named_curves[] = {
- {"curve25519", 256}, {"brainpoolP160r1", 160}, {"brainpoolP160t1", 160}, {"brainpoolP192r1", 192}, {"brainpoolP192t1", 192},
- {"brainpoolP224r1", 224}, {"brainpoolP224t1", 224}, {"brainpoolP256r1", 256}, {"brainpoolP256t1", 256}, {"brainpoolP320r1", 320},
- {"brainpoolP320t1", 320}, {"brainpoolP384r1", 384}, {"brainpoolP384t1", 384}, {"brainpoolP512r1", 512}, {"brainpoolP512t1", 512},
- {"ec192wapi", 192}, {"nistP192", 192}, {"nistP224", 224}, {"nistP256", 256}, {"nistP384", 384},
- {"nistP521", 521}, {"numsP256t1", 256}, {"numsP384t1", 384}, {"numsP512t1", 512}, {"secP160k1", 160},
- {"secP160r1", 160}, {"secP160r2", 160}, {"secP192k1", 192}, {"secP192r1", 192}, {"secP224k1", 224},
- {"secP224r1", 224}, {"secP256k1", 256}, {"secP256r1", 256}, {"secP384r1", 384}, {"secP521r1", 521},
- {"wtls12", 224}, {"wtls7", 160}, {"wtls9", 160}, {"x962P192v1", 192}, {"x962P192v2", 192},
- {"x962P192v3", 192}, {"x962P239v1", 239}, {"x962P239v2", 239}, {"x962P239v3", 239}, {"x962P256v1", 256}};
-
-static const named_curve_t *lookup_curve(const char *name) {
- for (size_t i = 0; i < sizeof(named_curves) / sizeof(named_curve_t); ++i) {
- if (strcmp(name, named_curves[i].name) == 0) {
- return &named_curves[i];
- }
- }
- return NULL;
-}
-
-static ULONG utf_16to8(NPSTR *out_buf, LPCWSTR in_str) {
- INT result = WideCharToMultiByte(CP_UTF8, 0, in_str, -1, NULL, 0, NULL, NULL);
- *out_buf = calloc(result, 1);
- return WideCharToMultiByte(CP_UTF8, 0, in_str, -1, *out_buf, result, NULL, NULL);
-}
-
-static ULONG utf_8to16(NWPSTR *out_buf, LPCSTR in_str) {
- INT result = MultiByteToWideChar(CP_UTF8, 0, in_str, -1, NULL, 0);
- *out_buf = calloc(result * sizeof(WCHAR), 1);
- return MultiByteToWideChar(CP_UTF8, 0, in_str, -1, *out_buf, result);
-}
-
-/**
- * Convert Java String to UTF-16 NWPSTR null-terminated.
- * Returns: Length of NWPSTR in bytes!
- */
-static ULONG utf_strto16(NWPSTR *out_buf, JNIEnv *env, jobject str) {
- jsize len = (*env)->GetStringLength(env, str);
- *out_buf = calloc(len * sizeof(jchar) + 1, 1);
- const jchar *chars = (*env)->GetStringChars(env, str, NULL);
- memcpy(*out_buf, chars, len * sizeof(jchar));
- (*env)->ReleaseStringChars(env, str, chars);
- return len * sizeof(jchar);
-}
-
-JNIEXPORT jobject JNICALL Java_cz_crcs_ectester_standalone_libs_MscngLib_getCurves(JNIEnv *env, jobject self) {
- jclass hash_set_class = (*env)->FindClass(env, "java/util/TreeSet");
-
- jmethodID hash_set_ctr = (*env)->GetMethodID(env, hash_set_class, "<init>", "()V");
- jmethodID hash_set_add = (*env)->GetMethodID(env, hash_set_class, "add", "(Ljava/lang/Object;)Z");
-
- jobject result = (*env)->NewObject(env, hash_set_class, hash_set_ctr);
-
- NTSTATUS status;
- BCRYPT_ALG_HANDLE handle;
-
- if (NT_FAILURE(status = BCryptOpenAlgorithmProvider(&handle, BCRYPT_ECDH_ALGORITHM, MS_PRIMITIVE_PROVIDER, 0))) {
- wprintf(L"**** Error 0x%x returned by BCryptOpenAlgorithmProvider\n", status);
- return result;
- }
-
- ULONG bufSize;
- if (NT_FAILURE(status = BCryptGetProperty(handle, BCRYPT_ECC_CURVE_NAME_LIST, NULL, 0, &bufSize, 0))) {
- wprintf(L"**** Error 0x%x returned by BCryptGetProperty(length only)\n", status);
- BCryptCloseAlgorithmProvider(handle, 0);
- return result;
- }
-
- BCRYPT_ECC_CURVE_NAMES *curves = (BCRYPT_ECC_CURVE_NAMES *)calloc(bufSize, 1);
- if (NT_FAILURE(status = BCryptGetProperty(handle, BCRYPT_ECC_CURVE_NAME_LIST, (PBYTE)curves, bufSize, &bufSize, 0))) {
- wprintf(L"**** Error 0x%x returned by BCryptGetProperty(whole)\n", status);
- BCryptCloseAlgorithmProvider(handle, 0);
- free(curves);
- return result;
- }
-
- for (size_t i = 0; i < curves->dwEccCurveNames; ++i) {
- NPSTR curve_name;
- ULONG len = utf_16to8(&curve_name, curves->pEccCurveNames[i]);
- jstring c_name = (*env)->NewStringUTF(env, curve_name);
- (*env)->CallBooleanMethod(env, result, hash_set_add, c_name);
- free(curve_name);
- }
-
- free(curves);
-
- BCryptCloseAlgorithmProvider(handle, 0);
- return result;
-}
-
-JNIEXPORT jboolean JNICALL Java_cz_crcs_ectester_standalone_libs_jni_NativeKeyPairGeneratorSpi_00024Mscng_keysizeSupported(JNIEnv *env,
- jobject self,
- jint keysize) {
- switch (keysize) {
- case 256:
- case 384:
- case 521:
- return JNI_TRUE;
- default:
- return JNI_FALSE;
- }
-}
-
-JNIEXPORT jboolean JNICALL Java_cz_crcs_ectester_standalone_libs_jni_NativeKeyPairGeneratorSpi_00024Mscng_paramsSupported(JNIEnv *env,
- jobject self,
- jobject params) {
- if (params == NULL) {
- return JNI_FALSE;
- }
-
- if ((*env)->IsInstanceOf(env, params, ecgen_parameter_spec_class)) {
- jmethodID get_name = (*env)->GetMethodID(env, ecgen_parameter_spec_class, "getName", "()Ljava/lang/String;");
- jstring name = (*env)->CallObjectMethod(env, params, get_name);
- const char *utf_name = (*env)->GetStringUTFChars(env, name, NULL);
- const named_curve_t *curve = lookup_curve(utf_name);
- (*env)->ReleaseStringUTFChars(env, name, utf_name);
- return curve == NULL ? JNI_FALSE : JNI_TRUE;
- } else if ((*env)->IsInstanceOf(env, params, ec_parameter_spec_class)) {
- jmethodID get_curve = (*env)->GetMethodID(env, ec_parameter_spec_class, "getCurve", "()Ljava/security/spec/EllipticCurve;");
- jobject curve = (*env)->CallObjectMethod(env, params, get_curve);
-
- jmethodID get_field = (*env)->GetMethodID(env, elliptic_curve_class, "getField", "()Ljava/security/spec/ECField;");
- jobject field = (*env)->CallObjectMethod(env, curve, get_field);
-
- if ((*env)->IsInstanceOf(env, field, fp_field_class)) {
- return JNI_TRUE;
- } else {
- return JNI_FALSE;
- }
- } else {
- return JNI_FALSE;
- }
-}
-
-static jobject bytes_to_biginteger(JNIEnv *env, PBYTE bytes, int len) {
- jmethodID biginteger_init = (*env)->GetMethodID(env, biginteger_class, "<init>", "(I[B)V");
- jbyteArray byte_array = (*env)->NewByteArray(env, len);
- jbyte *data = (*env)->GetByteArrayElements(env, byte_array, NULL);
- memcpy(data, bytes, len);
- (*env)->ReleaseByteArrayElements(env, byte_array, data, 0);
- jobject result = (*env)->NewObject(env, biginteger_class, biginteger_init, 1, byte_array);
- return result;
-}
-
-static void biginteger_to_bytes(JNIEnv *env, jobject bigint, PBYTE bytes, ULONG len) {
- jmethodID to_byte_array = (*env)->GetMethodID(env, biginteger_class, "toByteArray", "()[B");
-
- jbyteArray byte_array = (jbyteArray)(*env)->CallObjectMethod(env, bigint, to_byte_array);
- jsize byte_length = (*env)->GetArrayLength(env, byte_array);
- jbyte *byte_data = (*env)->GetByteArrayElements(env, byte_array, NULL);
- memcpy(bytes, &byte_data[byte_length - len], len);
- (*env)->ReleaseByteArrayElements(env, byte_array, byte_data, JNI_ABORT);
-}
-
-static jobject create_ec_param_spec(JNIEnv *env, PBYTE eccParams, PULONG paramLength) {
- //
- // BCRYPT_ECCFULLKEY_BLOB header
- // P[cbFieldLength] Prime specifying the base field.
- // A[cbFieldLength] Coefficient A of the equation y^2 = x^3 + A*x + B mod p
- // B[cbFieldLength] Coefficient B of the equation y^2 = x^3 + A*x + B mod p
- // Gx[cbFieldLength] X-coordinate of the base point.
- // Gy[cbFieldLength] Y-coordinate of the base point.
- // n[cbSubgroupOrder] Order of the group generated by G = (x,y)
- // h[cbCofactor] Cofactor of G in E.
- // S[cbSeed] Seed of the curve.
-
- BCRYPT_ECCFULLKEY_BLOB *header = (BCRYPT_ECCFULLKEY_BLOB *)eccParams;
- PBYTE paramsStart = &eccParams[sizeof(BCRYPT_ECCFULLKEY_BLOB)];
-
- // cbFieldLength
- PBYTE P = paramsStart;
- PBYTE A = P + header->cbFieldLength;
- PBYTE B = A + header->cbFieldLength;
- PBYTE GX = B + header->cbFieldLength;
- PBYTE GY = GX + header->cbFieldLength;
-
- // cbSubgroupOrder
- PBYTE N = GY + header->cbFieldLength;
-
- // cbCofactor
- PBYTE H = N + header->cbSubgroupOrder;
-
- // cbSeed
- PBYTE S = H + header->cbCofactor;
-
- *paramLength =
- sizeof(BCRYPT_ECCFULLKEY_BLOB) + 5 * header->cbFieldLength + header->cbSubgroupOrder + header->cbCofactor + header->cbSeed;
-
- jobject p_int = bytes_to_biginteger(env, P, header->cbFieldLength);
-
- jmethodID fp_field_init = (*env)->GetMethodID(env, fp_field_class, "<init>", "(Ljava/math/BigInteger;)V");
- jobject field = (*env)->NewObject(env, fp_field_class, fp_field_init, p_int);
-
- jobject a_int = bytes_to_biginteger(env, A, header->cbFieldLength);
- jobject b_int = bytes_to_biginteger(env, B, header->cbFieldLength);
-
- jmethodID elliptic_curve_init = (*env)->GetMethodID(env, elliptic_curve_class, "<init>",
- "(Ljava/security/spec/ECField;Ljava/math/BigInteger;Ljava/math/BigInteger;)V");
- jobject elliptic_curve = (*env)->NewObject(env, elliptic_curve_class, elliptic_curve_init, field, a_int, b_int);
-
- jobject gx_int = bytes_to_biginteger(env, GX, header->cbFieldLength);
- jobject gy_int = bytes_to_biginteger(env, GY, header->cbFieldLength);
-
- jmethodID point_init = (*env)->GetMethodID(env, point_class, "<init>", "(Ljava/math/BigInteger;Ljava/math/BigInteger;)V");
- jobject g = (*env)->NewObject(env, point_class, point_init, gx_int, gy_int);
-
- jobject n_int = bytes_to_biginteger(env, N, header->cbSubgroupOrder);
-
- jobject h_int = bytes_to_biginteger(env, H, header->cbCofactor);
- jmethodID bigint_to_int = (*env)->GetMethodID(env, biginteger_class, "intValue", "()I");
- jint cof = (*env)->CallIntMethod(env, h_int, bigint_to_int);
-
- jmethodID ec_parameter_spec_init = (*env)->GetMethodID(
- env, ec_parameter_spec_class, "<init>", "(Ljava/security/spec/EllipticCurve;Ljava/security/spec/ECPoint;Ljava/math/BigInteger;I)V");
- return (*env)->NewObject(env, ec_parameter_spec_class, ec_parameter_spec_init, elliptic_curve, g, n_int, cof);
-}
-
-static ULONG create_curve(JNIEnv *env, jobject params, PBYTE *curve) {
- jmethodID get_curve = (*env)->GetMethodID(env, ec_parameter_spec_class, "getCurve", "()Ljava/security/spec/EllipticCurve;");
- jobject elliptic_curve = (*env)->CallObjectMethod(env, params, get_curve);
-
- jmethodID get_field = (*env)->GetMethodID(env, elliptic_curve_class, "getField", "()Ljava/security/spec/ECField;");
- jobject field = (*env)->CallObjectMethod(env, elliptic_curve, get_field);
-
- jmethodID get_bits = (*env)->GetMethodID(env, fp_field_class, "getFieldSize", "()I");
- jint bits = (*env)->CallIntMethod(env, field, get_bits);
- jint bytes = (bits + 7) / 8;
-
- jmethodID get_a = (*env)->GetMethodID(env, elliptic_curve_class, "getA", "()Ljava/math/BigInteger;");
- jobject a = (*env)->CallObjectMethod(env, elliptic_curve, get_a);
-
- jmethodID get_b = (*env)->GetMethodID(env, elliptic_curve_class, "getB", "()Ljava/math/BigInteger;");
- jobject b = (*env)->CallObjectMethod(env, elliptic_curve, get_b);
-
- jmethodID get_p = (*env)->GetMethodID(env, fp_field_class, "getP", "()Ljava/math/BigInteger;");
- jobject p = (*env)->CallObjectMethod(env, field, get_p);
-
- jmethodID get_g = (*env)->GetMethodID(env, ec_parameter_spec_class, "getGenerator", "()Ljava/security/spec/ECPoint;");
- jobject g = (*env)->CallObjectMethod(env, params, get_g);
-
- jmethodID get_x = (*env)->GetMethodID(env, point_class, "getAffineX", "()Ljava/math/BigInteger;");
- jobject gx = (*env)->CallObjectMethod(env, g, get_x);
-
- jmethodID get_y = (*env)->GetMethodID(env, point_class, "getAffineY", "()Ljava/math/BigInteger;");
- jobject gy = (*env)->CallObjectMethod(env, g, get_y);
-
- jmethodID get_n = (*env)->GetMethodID(env, ec_parameter_spec_class, "getOrder", "()Ljava/math/BigInteger;");
- jobject n = (*env)->CallObjectMethod(env, params, get_n);
-
- jmethodID get_h = (*env)->GetMethodID(env, ec_parameter_spec_class, "getCofactor", "()I");
- jint h = (*env)->CallIntMethod(env, params, get_h);
-
- jmethodID get_bitlength = (*env)->GetMethodID(env, biginteger_class, "bitLength", "()I");
- jint order_bits = (*env)->CallIntMethod(env, n, get_bitlength);
- jint order_bytes = (order_bits + 7) / 8;
-
- // header_size + 5*bytes + order_bytes + cof_size + 0
- ULONG bufSize = sizeof(BCRYPT_ECC_PARAMETER_HEADER) + 5 * bytes + order_bytes + 1 + 0;
- *curve = calloc(bufSize, 1);
- BCRYPT_ECC_PARAMETER_HEADER *header = (BCRYPT_ECC_PARAMETER_HEADER *)*curve;
- header->dwVersion = 1;
- header->dwCurveType = 1; // 1 -> Prime short Weierstrass, 2 -> Prime Twisted Edwards, 3 -> Montgomery
- header->dwCurveGenerationAlgId = 0;
- header->cbFieldLength = bytes;
- header->cbSubgroupOrder = order_bytes;
- header->cbCofactor = 1;
- header->cbSeed = 0;
-
- PBYTE paramsStart = &(*curve)[sizeof(BCRYPT_ECC_PARAMETER_HEADER)];
-
- biginteger_to_bytes(env, p, paramsStart, bytes);
- biginteger_to_bytes(env, a, paramsStart + bytes, bytes);
- biginteger_to_bytes(env, b, paramsStart + 2 * bytes, bytes);
- biginteger_to_bytes(env, gx, paramsStart + 3 * bytes, bytes);
- biginteger_to_bytes(env, gy, paramsStart + 4 * bytes, bytes);
- biginteger_to_bytes(env, n, paramsStart + 5 * bytes, order_bytes);
- PBYTE cof_ptr = (PBYTE)(paramsStart + 5 * bytes + order_bytes);
- *cof_ptr = (BYTE)h;
- return bufSize;
-}
-
-static ULONG init_algo(JNIEnv *env, BCRYPT_ALG_HANDLE *handle, jint *keyflag, NWPSTR *curve_name, LPCWSTR algo, jobject params) {
- NTSTATUS status;
- if (NT_FAILURE(status = BCryptOpenAlgorithmProvider(handle, algo, MS_PRIMITIVE_PROVIDER, 0))) {
- wprintf(L"**** Error 0x%x returned by BCryptOpenAlgorithmProvider\n", status);
- return 0;
- }
- ULONG result = 0;
- if ((*env)->IsInstanceOf(env, params, ecgen_parameter_spec_class)) {
- jmethodID get_name = (*env)->GetMethodID(env, ecgen_parameter_spec_class, "getName", "()Ljava/lang/String;");
- jstring name = (*env)->CallObjectMethod(env, params, get_name);
- jint utf_length = (*env)->GetStringUTFLength(env, name);
- PUCHAR chars = calloc(utf_length + 1, 1);
- (*env)->GetStringUTFRegion(env, name, 0, utf_length, chars);
- const named_curve_t *curve = lookup_curve(chars);
- ULONG ret = utf_8to16(curve_name, chars);
- if (NT_FAILURE(status = BCryptSetProperty(*handle, BCRYPT_ECC_CURVE_NAME, (PUCHAR)*curve_name, ret * sizeof(WCHAR), 0))) {
- wprintf(L"**** Error 0x%x returned by BCryptSetProperty\n", status);
- return 0;
- }
- free(chars);
- result = curve->bits;
- *keyflag = KEYFLAG_IMPLICIT;
- } else if ((*env)->IsInstanceOf(env, params, ec_parameter_spec_class)) {
- PBYTE curve;
- ULONG curveLen = create_curve(env, params, &curve);
- if (NT_FAILURE(status = BCryptSetProperty(*handle, BCRYPT_ECC_PARAMETERS, curve, curveLen, 0))) {
- wprintf(L"**** Error 0x%x returned by BCryptSetProperty\n", status);
- return 0;
- }
- free(curve);
-
- jmethodID get_curve = (*env)->GetMethodID(env, ec_parameter_spec_class, "getCurve", "()Ljava/security/spec/EllipticCurve;");
- jobject elliptic_curve = (*env)->CallObjectMethod(env, params, get_curve);
-
- jmethodID get_field = (*env)->GetMethodID(env, elliptic_curve_class, "getField", "()Ljava/security/spec/ECField;");
- jobject field = (*env)->CallObjectMethod(env, elliptic_curve, get_field);
-
- jmethodID get_bits = (*env)->GetMethodID(env, fp_field_class, "getFieldSize", "()I");
- jint bits = (*env)->CallIntMethod(env, field, get_bits);
- result = bits;
- *keyflag = KEYFLAG_EXPLICIT;
- *curve_name = NULL;
- }
- return result;
-}
-
-static jobject key_to_privkey(JNIEnv *env, BCRYPT_KEY_HANDLE key, jint flag, LPCWSTR curve) {
- NTSTATUS status;
- ULONG bufSize = 0;
- if (NT_FAILURE(status = BCryptExportKey(key, NULL, BCRYPT_ECCFULLPRIVATE_BLOB, NULL, 0, &bufSize, 0))) {
- wprintf(L"**** Error 0x%x returned by BCryptExportKey(full, length only)\n", status);
- return NULL;
- }
- if (bufSize == 0) {
- printf("buf 0\n");
- return NULL;
- }
-
- PBYTE fullBuf = calloc(bufSize, 1);
- if (NT_FAILURE(status = BCryptExportKey(key, NULL, BCRYPT_ECCFULLPRIVATE_BLOB, fullBuf, bufSize, &bufSize, 0))) {
- wprintf(L"**** Error 0x%x returned by BCryptExportKey(full, whole)\n", status);
- free(fullBuf);
- return NULL;
- }
-
- ULONG paramLength;
- jobject ec_priv_param_spec = create_ec_param_spec(env, fullBuf, &paramLength);
-
- // fullBuf looks like:
- // BCRYPT_ECCFULLKEY_BLOB header
- // P[cbFieldLength] Prime specifying the base field.
- // A[cbFieldLength] Coefficient A of the equation y^2 = x^3 + A*x + B mod p
- // B[cbFieldLength] Coefficient B of the equation y^2 = x^3 + A*x + B mod p
- // Gx[cbFieldLength] X-coordinate of the base point.
- // Gy[cbFieldLength] Y-coordinate of the base point.
- // n[cbSubgroupOrder] Order of the group generated by G = (x,y)
- // h[cbCofactor] Cofactor of G in E.
- // S[cbSeed] Seed of the curve.
- // Qx[cbFieldLength] X-coordinate of the public point.
- // Qy[cbFieldLength] Y-coordinate of the public point.
- // d[cbSubgroupOrder] Private key.
- BCRYPT_ECCFULLKEY_BLOB *privHeader = (BCRYPT_ECCFULLKEY_BLOB *)fullBuf;
- PBYTE priv_x = &fullBuf[paramLength];
- PBYTE priv_y = priv_x + privHeader->cbFieldLength;
- PBYTE priv = priv_y + privHeader->cbFieldLength;
-
- jbyteArray meta_bytes = NULL;
- jbyteArray header_bytes = NULL;
- switch (flag) {
- case 0: {
- // meta = curve
- jint meta_len = (wcslen(curve) + 1) * sizeof(WCHAR);
- meta_bytes = (*env)->NewByteArray(env, meta_len);
- jbyte *meta_data = (*env)->GetByteArrayElements(env, meta_bytes, NULL);
- memcpy(meta_data, curve, meta_len);
- (*env)->ReleaseByteArrayElements(env, meta_bytes, meta_data, 0);
- }
- case 1:
- case 2: {
- // meta = null
- // header = full
- header_bytes = (*env)->NewByteArray(env, paramLength);
- jbyte *header_data = (*env)->GetByteArrayElements(env, header_bytes, NULL);
- memcpy(header_data, fullBuf, paramLength);
- (*env)->ReleaseByteArrayElements(env, header_bytes, header_data, 0);
- break;
- }
- default:
- // header = small
- if (NT_FAILURE(status = BCryptExportKey(key, NULL, BCRYPT_ECCPRIVATE_BLOB, NULL, 0, &bufSize, 0))) {
- wprintf(L"**** Error 0x%x returned by BCryptExportKey(small, length only)\n", status);
- free(fullBuf);
- return NULL;
- }
- if (bufSize == 0) {
- printf("buf 0\n");
- free(fullBuf);
- return NULL;
- }
- PBYTE smallBuf = calloc(bufSize, 1);
- if (NT_FAILURE(status = BCryptExportKey(key, NULL, BCRYPT_ECCPRIVATE_BLOB, smallBuf, bufSize, &bufSize, 0))) {
- wprintf(L"**** Error 0x%x returned by BCryptExportKey(small, whole)\n", status);
- free(fullBuf);
- free(smallBuf);
- return NULL;
- }
- // smallBuf looks like:
- // BCRYPT_ECCKEY_BLOB header
- // Qx[cbFieldLength] X-coordinate of the public point.
- // Qy[cbFieldLength] Y-coordinate of the public point.
- // d[cbSubgroupOrder] Private key.
- header_bytes = (*env)->NewByteArray(env, sizeof(BCRYPT_ECCKEY_BLOB));
- jbyte *header_data = (*env)->GetByteArrayElements(env, header_bytes, NULL);
- memcpy(header_data, smallBuf, sizeof(BCRYPT_ECCKEY_BLOB));
- (*env)->ReleaseByteArrayElements(env, header_bytes, header_data, 0);
- free(smallBuf);
- break;
- }
-
- jbyteArray x_bytes = (*env)->NewByteArray(env, privHeader->cbFieldLength);
- jbyte *x_data = (*env)->GetByteArrayElements(env, x_bytes, NULL);
- memcpy(x_data, priv_x, privHeader->cbFieldLength);
- (*env)->ReleaseByteArrayElements(env, x_bytes, x_data, 0);
-
- jbyteArray y_bytes = (*env)->NewByteArray(env, privHeader->cbFieldLength);
- jbyte *y_data = (*env)->GetByteArrayElements(env, y_bytes, NULL);
- memcpy(y_data, priv_y, privHeader->cbFieldLength);
- (*env)->ReleaseByteArrayElements(env, y_bytes, y_data, 0);
-
- jbyteArray priv_bytes = (*env)->NewByteArray(env, privHeader->cbSubgroupOrder);
- jbyte *key_priv = (*env)->GetByteArrayElements(env, priv_bytes, NULL);
- memcpy(key_priv, priv, privHeader->cbSubgroupOrder);
- (*env)->ReleaseByteArrayElements(env, priv_bytes, key_priv, 0);
-
- free(fullBuf);
-
- jmethodID ec_priv_init = (*env)->GetMethodID(env, privkey_class, "<init>", "(I[B[B[B[B[BLjava/security/spec/ECParameterSpec;)V");
- return (*env)->NewObject(env, privkey_class, ec_priv_init, flag, meta_bytes, header_bytes, x_bytes, y_bytes, priv_bytes,
- ec_priv_param_spec);
-}
-
-static jobject key_to_pubkey(JNIEnv *env, BCRYPT_KEY_HANDLE key, jint flag, LPCWSTR curve) {
- NTSTATUS status;
- ULONG bufSize = 0;
- if (NT_FAILURE(status = BCryptExportKey(key, NULL, BCRYPT_ECCFULLPUBLIC_BLOB, NULL, 0, &bufSize, 0))) {
- wprintf(L"**** Error 0x%x returned by BCryptExportKey(full, length only)\n", status);
- return NULL;
- }
- if (bufSize == 0) {
- printf("err0\n");
- return NULL;
- }
-
- PBYTE fullBuf = calloc(bufSize, 1);
- if (NT_FAILURE(status = BCryptExportKey(key, NULL, BCRYPT_ECCFULLPUBLIC_BLOB, fullBuf, bufSize, &bufSize, 0))) {
- wprintf(L"**** Error 0x%x returned by BCryptExportKey(full, whole)\n", status);
- return NULL;
- }
-
- ULONG paramLength;
- jobject ec_pub_param_spec = create_ec_param_spec(env, fullBuf, &paramLength);
-
- // fullBuf looks like:
- // BCRYPT_ECCFULLKEY_BLOB header
- // P[cbFieldLength] Prime specifying the base field.
- // A[cbFieldLength] Coefficient A of the equation y^2 = x^3 + A*x + B mod p
- // B[cbFieldLength] Coefficient B of the equation y^2 = x^3 + A*x + B mod p
- // Gx[cbFieldLength] X-coordinate of the base point.
- // Gy[cbFieldLength] Y-coordinate of the base point.
- // n[cbSubgroupOrder] Order of the group generated by G = (x,y)
- // h[cbCofactor] Cofactor of G in E.
- // S[cbSeed] Seed of the curve.
- // Qx[cbFieldLength] X-coordinate of the public point.
- // Qy[cbFieldLength] Y-coordinate of the public point.
- BCRYPT_ECCFULLKEY_BLOB *pubHeader = (BCRYPT_ECCFULLKEY_BLOB *)fullBuf;
- PBYTE pub_x = &fullBuf[paramLength];
- PBYTE pub_y = pub_x + pubHeader->cbFieldLength;
-
- jbyteArray meta_bytes = NULL;
- jbyteArray header_bytes = NULL;
- switch (flag) {
- case 0: {
- // meta = curve
- jint meta_len = (wcslen(curve) + 1) * sizeof(WCHAR);
- meta_bytes = (*env)->NewByteArray(env, meta_len);
- jbyte *meta_data = (*env)->GetByteArrayElements(env, meta_bytes, NULL);
- memcpy(meta_data, curve, meta_len);
- (*env)->ReleaseByteArrayElements(env, meta_bytes, meta_data, 0);
- }
- case 1:
- case 2: {
- header_bytes = (*env)->NewByteArray(env, paramLength);
- jbyte *header_data = (*env)->GetByteArrayElements(env, header_bytes, NULL);
- memcpy(header_data, pubHeader, paramLength);
- (*env)->ReleaseByteArrayElements(env, header_bytes, header_data, 0);
- break;
- }
- default:
- // header = small
- if (NT_FAILURE(status = BCryptExportKey(key, NULL, BCRYPT_ECCPUBLIC_BLOB, NULL, 0, &bufSize, 0))) {
- wprintf(L"**** Error 0x%x returned by BCryptExportKey(small, length only)\n", status);
- free(fullBuf);
- return NULL;
- }
- if (bufSize == 0) {
- printf("buf 0\n");
- free(fullBuf);
- return NULL;
- }
- PBYTE smallBuf = calloc(bufSize, 1);
- if (NT_FAILURE(status = BCryptExportKey(key, NULL, BCRYPT_ECCPUBLIC_BLOB, smallBuf, bufSize, &bufSize, 0))) {
- wprintf(L"**** Error 0x%x returned by BCryptExportKey(small, whole)\n", status);
- free(fullBuf);
- free(smallBuf);
- return NULL;
- }
- // smallBuf looks like:
- // BCRYPT_ECCKEY_BLOB header
- // Qx[cbFieldLength] X-coordinate of the public point.
- // Qy[cbFieldLength] Y-coordinate of the public point.
- header_bytes = (*env)->NewByteArray(env, sizeof(BCRYPT_ECCKEY_BLOB));
- jbyte *header_data = (*env)->GetByteArrayElements(env, header_bytes, NULL);
- memcpy(header_data, smallBuf, sizeof(BCRYPT_ECCKEY_BLOB));
- (*env)->ReleaseByteArrayElements(env, header_bytes, header_data, 0);
- free(smallBuf);
- break;
- }
-
- jbyteArray x_bytes = (*env)->NewByteArray(env, pubHeader->cbFieldLength);
- jbyte *x_data = (*env)->GetByteArrayElements(env, x_bytes, NULL);
- memcpy(x_data, pub_x, pubHeader->cbFieldLength);
- (*env)->ReleaseByteArrayElements(env, x_bytes, x_data, 0);
-
- jbyteArray y_bytes = (*env)->NewByteArray(env, pubHeader->cbFieldLength);
- jbyte *y_data = (*env)->GetByteArrayElements(env, y_bytes, NULL);
- memcpy(y_data, pub_y, pubHeader->cbFieldLength);
- (*env)->ReleaseByteArrayElements(env, y_bytes, y_data, 0);
-
- free(fullBuf);
-
- jmethodID ec_pub_init = (*env)->GetMethodID(env, pubkey_class, "<init>", "(I[B[B[B[BLjava/security/spec/ECParameterSpec;)V");
- return (*env)->NewObject(env, pubkey_class, ec_pub_init, flag, meta_bytes, header_bytes, x_bytes, y_bytes, ec_pub_param_spec);
-}
-
-JNIEXPORT jobject JNICALL
-Java_cz_crcs_ectester_standalone_libs_jni_NativeKeyPairGeneratorSpi_00024Mscng_generate__ILjava_security_SecureRandom_2(JNIEnv *env,
- jobject self,
- jint keysize,
- jobject random) {
- NTSTATUS status;
- BCRYPT_ALG_HANDLE handle = NULL;
-
- jclass mscng_kpg_class = (*env)->FindClass(env, "cz/crcs/ectester/standalone/libs/jni/NativeKeyPairGeneratorSpi$Mscng");
- jfieldID type_id = (*env)->GetFieldID(env, mscng_kpg_class, "type", "Ljava/lang/String;");
- jstring type = (jstring)(*env)->GetObjectField(env, self, type_id);
- const char *type_data = (*env)->GetStringUTFChars(env, type, NULL);
- LPCWSTR algo;
- if (strcmp(type_data, "ECDH") == 0) {
- switch (keysize) {
- case 256:
- algo = BCRYPT_ECDH_P256_ALGORITHM;
- break;
- case 384:
- algo = BCRYPT_ECDH_P384_ALGORITHM;
- break;
- case 521:
- algo = BCRYPT_ECDH_P521_ALGORITHM;
- break;
- default:
- // unreachable
- return NULL;
- }
- } else if (strcmp(type_data, "ECDSA") == 0) {
- switch (keysize) {
- case 256:
- algo = BCRYPT_ECDSA_P256_ALGORITHM;
- break;
- case 384:
- algo = BCRYPT_ECDSA_P384_ALGORITHM;
- break;
- case 521:
- algo = BCRYPT_ECDSA_P521_ALGORITHM;
- break;
- default:
- // unreachable
- return NULL;
- }
- } else {
- // unreachable
- return NULL;
- }
- (*env)->ReleaseStringUTFChars(env, type, type_data);
-
- if (NT_FAILURE(status = BCryptOpenAlgorithmProvider(&handle, algo, MS_PRIMITIVE_PROVIDER, 0))) {
- throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptOpenAlgorithmProvider", status);
- return NULL;
- }
-
- BCRYPT_KEY_HANDLE key = NULL;
-
- native_timing_start();
- status = BCryptGenerateKeyPair(handle, &key, keysize, 0);
- native_timing_pause();
-
- if (NT_FAILURE(status)) {
- throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptGenerateKeyPair\n", status);
- BCryptCloseAlgorithmProvider(handle, 0);
- return NULL;
- }
-
- native_timing_restart();
- status = BCryptFinalizeKeyPair(key, 0);
- native_timing_stop();
-
- if (NT_FAILURE(status)) {
- throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptFinalizeKeyPair\n", status);
- BCryptCloseAlgorithmProvider(handle, 0);
- return NULL;
- }
-
- jobject privkey = key_to_privkey(env, key, KEYFLAG_NIST, NULL);
- jobject pubkey = key_to_pubkey(env, key, KEYFLAG_NIST, NULL);
-
- jmethodID keypair_init = (*env)->GetMethodID(env, keypair_class, "<init>", "(Ljava/security/PublicKey;Ljava/security/PrivateKey;)V");
-
- BCryptDestroyKey(key);
- BCryptCloseAlgorithmProvider(handle, 0);
- return (*env)->NewObject(env, keypair_class, keypair_init, pubkey, privkey);
-}
-
-JNIEXPORT jobject JNICALL
-Java_cz_crcs_ectester_standalone_libs_jni_NativeKeyPairGeneratorSpi_00024Mscng_generate__Ljava_security_spec_AlgorithmParameterSpec_2Ljava_security_SecureRandom_2(
- JNIEnv *env, jobject self, jobject params, jobject random) {
- NTSTATUS status;
- BCRYPT_ALG_HANDLE handle = NULL;
- BCRYPT_KEY_HANDLE key = NULL;
-
- jclass mscng_kpg_class = (*env)->FindClass(env, "cz/crcs/ectester/standalone/libs/jni/NativeKeyPairGeneratorSpi$Mscng");
- jfieldID type_id = (*env)->GetFieldID(env, mscng_kpg_class, "type", "Ljava/lang/String;");
- jstring type = (jstring)(*env)->GetObjectField(env, self, type_id);
- const char *type_data = (*env)->GetStringUTFChars(env, type, NULL);
- LPCWSTR algo;
- if (strcmp(type_data, "ECDH") == 0) {
- algo = BCRYPT_ECDH_ALGORITHM;
- } else if (strcmp(type_data, "ECDSA") == 0) {
- algo = BCRYPT_ECDSA_ALGORITHM;
- } else {
- // unreachable
- return NULL;
- }
- (*env)->ReleaseStringUTFChars(env, type, type_data);
-
- jint keyflag;
- NWPSTR curveName;
- ULONG bits = init_algo(env, &handle, &keyflag, &curveName, algo, params);
- if (bits == 0) {
- throw_new(env, "java/security/GeneralSecurityException", "Couldn't initialize algo.");
- return NULL;
- }
-
- native_timing_start();
- status = BCryptGenerateKeyPair(handle, &key, bits, 0);
- native_timing_pause();
-
- if (NT_FAILURE(status)) {
- throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptGenerateKeyPair\n", status);
- BCryptCloseAlgorithmProvider(handle, 0);
- return NULL;
- }
-
- native_timing_restart();
- status = BCryptFinalizeKeyPair(key, 0);
- native_timing_stop();
-
- if (NT_FAILURE(status)) {
- throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptFinalizeKeyPair\n", status);
- BCryptCloseAlgorithmProvider(handle, 0);
- return NULL;
- }
-
- jobject privkey = key_to_privkey(env, key, keyflag, curveName);
- jobject pubkey = key_to_pubkey(env, key, keyflag, curveName);
-
- if (curveName) {
- free(curveName);
- }
-
- jmethodID keypair_init = (*env)->GetMethodID(env, keypair_class, "<init>", "(Ljava/security/PublicKey;Ljava/security/PrivateKey;)V");
-
- BCryptDestroyKey(key);
- BCryptCloseAlgorithmProvider(handle, 0);
- return (*env)->NewObject(env, keypair_class, keypair_init, pubkey, privkey);
-}
-
-static NTSTATUS init_use_algo(JNIEnv *env, BCRYPT_ALG_HANDLE *handle, LPCWSTR type, jint keyflag, jbyteArray meta, jobject params) {
- LPCWSTR ecdh_algos[] = {BCRYPT_ECDH_ALGORITHM, BCRYPT_ECDH_P256_ALGORITHM, BCRYPT_ECDH_P384_ALGORITHM, BCRYPT_ECDH_P521_ALGORITHM};
- LPCWSTR ecdsa_algos[] = {BCRYPT_ECDSA_ALGORITHM, BCRYPT_ECDSA_P256_ALGORITHM, BCRYPT_ECDSA_P384_ALGORITHM, BCRYPT_ECDSA_P521_ALGORITHM};
-
- LPCWSTR *algos;
- LPCWSTR algo;
- if (lstrcmpW(type, BCRYPT_ECDH_ALGORITHM) == 0) {
- algos = ecdh_algos;
- } else if (lstrcmpW(type, BCRYPT_ECDSA_ALGORITHM) == 0) {
- algos = ecdsa_algos;
- } else {
- // unreachable
- return STATUS_INVALID_PARAMETER;
- }
-
- switch (keyflag) {
- case KEYFLAG_IMPLICIT:
- case KEYFLAG_EXPLICIT:
- case KEYFLAG_OTHER:
- algo = algos[0];
- break;
- case KEYFLAG_NIST: {
- jmethodID get_curve = (*env)->GetMethodID(env, ec_parameter_spec_class, "getCurve", "()Ljava/security/spec/EllipticCurve;");
- jobject elliptic_curve = (*env)->CallObjectMethod(env, params, get_curve);
-
- jmethodID get_field = (*env)->GetMethodID(env, elliptic_curve_class, "getField", "()Ljava/security/spec/ECField;");
- jobject field = (*env)->CallObjectMethod(env, elliptic_curve, get_field);
-
- jmethodID get_bits = (*env)->GetMethodID(env, fp_field_class, "getFieldSize", "()I");
- jint bits = (*env)->CallIntMethod(env, field, get_bits);
- switch (bits) {
- case 256:
- algo = algos[1];
- break;
- case 384:
- algo = algos[2];
- break;
- case 521:
- algo = algos[3];
- break;
- default:
- return STATUS_INVALID_PARAMETER;
- }
- break;
- }
- }
- NTSTATUS status;
-
- if (NT_FAILURE(status = BCryptOpenAlgorithmProvider(handle, algo, MS_PRIMITIVE_PROVIDER, 0))) {
- throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptOpenAlgorithmProvider\n", status);
- return status;
- }
-
- switch (keyflag) {
- case KEYFLAG_IMPLICIT: {
- jint meta_len = (*env)->GetArrayLength(env, meta);
- jbyte *meta_data = (*env)->GetByteArrayElements(env, meta, NULL);
- // if (NT_FAILURE(status = BCryptSetProperty(*handle, BCRYPT_ECC_CURVE_NAME, meta_data, meta_len, 0))) {
- // throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptSetProperty(curve name)\n",
- //status);
- // (*env)->ReleaseByteArrayElements(env, meta, meta_data, JNI_ABORT);
- // return status;
- //}
- (*env)->ReleaseByteArrayElements(env, meta, meta_data, JNI_ABORT);
- break;
- }
- case KEYFLAG_EXPLICIT:
- case KEYFLAG_OTHER: {
- PBYTE curve;
- ULONG curve_len = create_curve(env, params, &curve);
- if (NT_FAILURE(status = BCryptSetProperty(*handle, BCRYPT_ECC_PARAMETERS, curve, curve_len, 0))) {
- throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptSetProperty(parameters)\n",
- status);
- free(curve);
- return status;
- }
- free(curve);
- break;
- }
- }
- return STATUS_SUCCESS;
-}
-
-static jint get_keyflag(JNIEnv *env, jobject key) {
- if ((*env)->IsInstanceOf(env, key, pubkey_class) || (*env)->IsInstanceOf(env, key, privkey_class)) {
- jclass key_class = (*env)->GetObjectClass(env, key);
- jmethodID get_flag = (*env)->GetMethodID(env, key_class, "getFlag", "()I");
- return (*env)->CallIntMethod(env, key, get_flag);
- } else {
- return KEYFLAG_OTHER;
- }
-}
-
-static jbyteArray get_meta(JNIEnv *env, jobject key) {
- if ((*env)->IsInstanceOf(env, key, pubkey_class) || (*env)->IsInstanceOf(env, key, privkey_class)) {
- jclass key_class = (*env)->GetObjectClass(env, key);
- jmethodID get_meta = (*env)->GetMethodID(env, key_class, "getMeta", "()[B");
- return (jbyteArray)(*env)->CallObjectMethod(env, key, get_meta);
- } else {
- return NULL;
- }
-}
-
-JNIEXPORT jbyteArray JNICALL
-Java_cz_crcs_ectester_standalone_libs_jni_NativeKeyAgreementSpi_00024Mscng_generateSecret__Ljava_security_interfaces_ECPublicKey_2Ljava_security_interfaces_ECPrivateKey_2Ljava_security_spec_AlgorithmParameterSpec_2(
- JNIEnv *env, jobject self, jobject pubkey, jobject privkey, jobject params) {
- NTSTATUS status;
-
- jclass mscng_ka_class = (*env)->FindClass(env, "cz/crcs/ectester/standalone/libs/jni/NativeKeyAgreementSpi$Mscng");
- jfieldID type_id = (*env)->GetFieldID(env, mscng_ka_class, "type", "Ljava/lang/String;");
- jstring type = (jstring)(*env)->GetObjectField(env, self, type_id);
- const char *type_data = (*env)->GetStringUTFChars(env, type, NULL);
- LPCWSTR kdf_algo;
- if (strcmp(type_data, "ECDHwithSHA1KDF(CNG)") == 0) {
- kdf_algo = BCRYPT_SHA1_ALGORITHM;
- } else if (strcmp(type_data, "ECDHwithSHA256KDF(CNG)") == 0) {
- kdf_algo = BCRYPT_SHA256_ALGORITHM;
- } else if (strcmp(type_data, "ECDHwithSHA384KDF(CNG)") == 0) {
- kdf_algo = BCRYPT_SHA384_ALGORITHM;
- } else if (strcmp(type_data, "ECDHwithSHA512KDF(CNG)") == 0) {
- kdf_algo = BCRYPT_SHA512_ALGORITHM;
- } else {
- // unreachable
- return NULL;
- }
- (*env)->ReleaseStringUTFChars(env, type, type_data);
-
- BCRYPT_ALG_HANDLE kaHandle = NULL;
-
- jint pub_flag = get_keyflag(env, pubkey);
- if (pub_flag == KEYFLAG_OTHER) {
- throw_new(env, "java/security/InvalidAlgorithmParameterException", "Cannot import non-native public key.");
- return NULL;
- }
- jbyteArray meta = get_meta(env, pubkey);
-
- if (NT_FAILURE(status = init_use_algo(env, &kaHandle, BCRYPT_ECDH_ALGORITHM, pub_flag, meta, params))) {
- return NULL;
- }
-
- BCRYPT_KEY_HANDLE pkey = NULL;
- BCRYPT_KEY_HANDLE skey = NULL;
-
- jmethodID get_data_priv = (*env)->GetMethodID(env, pubkey_class, "getData", "()[B");
- jbyteArray pubkey_barray = (jbyteArray)(*env)->CallObjectMethod(env, pubkey, get_data_priv);
-
- jint pub_length = (*env)->GetArrayLength(env, pubkey_barray);
- jbyte *pub_data = (*env)->GetByteArrayElements(env, pubkey_barray, NULL);
- if (NT_FAILURE(status = BCryptImportKeyPair(kaHandle, NULL, BCRYPT_ECCFULLPUBLIC_BLOB, &pkey, pub_data, pub_length, 0))) {
- throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptImportKeyPair(pub)\n", status);
- BCryptCloseAlgorithmProvider(kaHandle, 0);
- (*env)->ReleaseByteArrayElements(env, pubkey_barray, pub_data, JNI_ABORT);
- return NULL;
- }
- (*env)->ReleaseByteArrayElements(env, pubkey_barray, pub_data, JNI_ABORT);
-
- jint priv_flag = get_keyflag(env, privkey);
- if (priv_flag == KEYFLAG_OTHER) {
- throw_new(env, "java/security/InvalidAlgorithmParameterException", "Cannot import non-native private key.");
- return NULL;
- }
-
- jmethodID get_data_pub = (*env)->GetMethodID(env, privkey_class, "getData", "()[B");
- jbyteArray privkey_barray = (jbyteArray)(*env)->CallObjectMethod(env, privkey, get_data_pub);
-
- jint priv_length = (*env)->GetArrayLength(env, privkey_barray);
- jbyte *priv_data = (*env)->GetByteArrayElements(env, privkey_barray, NULL);
- if (NT_FAILURE(status = BCryptImportKeyPair(kaHandle, NULL, BCRYPT_ECCFULLPRIVATE_BLOB, &skey, priv_data, priv_length, 0))) {
- throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptImportKeyPair(priv)\n", status);
- BCryptCloseAlgorithmProvider(kaHandle, 0);
- BCryptDestroyKey(pkey);
- (*env)->ReleaseByteArrayElements(env, privkey_barray, priv_data, JNI_ABORT);
- return NULL;
- }
- (*env)->ReleaseByteArrayElements(env, privkey_barray, priv_data, JNI_ABORT);
-
- BCRYPT_SECRET_HANDLE ka = NULL;
-
- native_timing_start();
- status = BCryptSecretAgreement(skey, pkey, &ka, 0);
- native_timing_stop();
-
- if (NT_FAILURE(status)) {
- throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptSecretAgreement\n", status);
- BCryptCloseAlgorithmProvider(kaHandle, 0);
- BCryptDestroyKey(pkey);
- BCryptDestroyKey(skey);
- return NULL;
- }
-
- BCryptBufferDesc paramList = {0};
- BCryptBuffer kdfParams[1] = {0};
- kdfParams[0].BufferType = KDF_HASH_ALGORITHM;
- kdfParams[0].cbBuffer = (DWORD)((wcslen(kdf_algo) + 1) * sizeof(WCHAR));
- kdfParams[0].pvBuffer = (PVOID)kdf_algo;
- paramList.cBuffers = 1;
- paramList.pBuffers = kdfParams;
- paramList.ulVersion = BCRYPTBUFFER_VERSION;
-
- ULONG bufSize = 0;
- if (NT_FAILURE(status = BCryptDeriveKey(ka, BCRYPT_KDF_HASH, &paramList, NULL, 0, &bufSize, 0))) {
- throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptDeriveKey(length only)\n", status);
- return NULL;
- }
-
- PBYTE derived = calloc(bufSize, 1);
- if (NT_FAILURE(status = BCryptDeriveKey(ka, BCRYPT_KDF_HASH, &paramList, derived, bufSize, &bufSize, 0))) {
- throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptDeriveKey(whole)\n", status);
- return NULL;
- }
-
- jbyteArray result = (*env)->NewByteArray(env, bufSize);
- jbyte *result_data = (*env)->GetByteArrayElements(env, result, NULL);
- memcpy(result_data, derived, bufSize);
- (*env)->ReleaseByteArrayElements(env, result, result_data, 0);
-
- free(derived);
- BCryptDestroyKey(pkey);
- BCryptDestroyKey(skey);
- BCryptDestroySecret(ka);
- BCryptCloseAlgorithmProvider(kaHandle, 0);
- return result;
-}
-
-JNIEXPORT jobject JNICALL
-Java_cz_crcs_ectester_standalone_libs_jni_NativeKeyAgreementSpi_00024Mscng_generateSecret__Ljava_security_interfaces_ECPublicKey_2Ljava_security_interfaces_ECPrivateKey_2Ljava_security_spec_AlgorithmParameterSpec_2Ljava_lang_String_2(
- JNIEnv *env, jobject self, jobject pubkey, jobject privkey, jobject params, jstring algorithm) {
- throw_new(env, "java/lang/UnsupportedOperationException", "Not supported.");
- return NULL;
-}
-
-static LPCWSTR get_sighash_algo(JNIEnv *env, jobject self) {
- jclass mscng_sig_class = (*env)->FindClass(env, "cz/crcs/ectester/standalone/libs/jni/NativeSignatureSpi$Mscng");
- jfieldID type_id = (*env)->GetFieldID(env, mscng_sig_class, "type", "Ljava/lang/String;");
- jstring type = (jstring)(*env)->GetObjectField(env, self, type_id);
- const char *type_data = (*env)->GetStringUTFChars(env, type, NULL);
- LPCWSTR hash_algo;
- if (strcmp(type_data, "SHA1withECDSA") == 0) {
- hash_algo = BCRYPT_SHA1_ALGORITHM;
- } else if (strcmp(type_data, "SHA256withECDSA") == 0) {
- hash_algo = BCRYPT_SHA256_ALGORITHM;
- } else if (strcmp(type_data, "SHA384withECDSA") == 0) {
- hash_algo = BCRYPT_SHA384_ALGORITHM;
- } else if (strcmp(type_data, "SHA512withECDSA") == 0) {
- hash_algo = BCRYPT_SHA512_ALGORITHM;
- } else {
- // unreachable
- return NULL;
- }
- (*env)->ReleaseStringUTFChars(env, type, type_data);
- return hash_algo;
-}
-
-JNIEXPORT jbyteArray JNICALL Java_cz_crcs_ectester_standalone_libs_jni_NativeSignatureSpi_00024Mscng_sign(JNIEnv *env, jobject self,
- jbyteArray data, jobject privkey,
- jobject params) {
- NTSTATUS status;
- LPCWSTR hash_algo = get_sighash_algo(env, self);
-
- BCRYPT_ALG_HANDLE sigHandle = NULL;
-
- jint keyflag = get_keyflag(env, privkey);
- if (keyflag == KEYFLAG_OTHER) {
- throw_new(env, "java/security/InvalidAlgorithmParameterException", "Cannot import non-native private key.");
- return NULL;
- }
- jbyteArray meta = get_meta(env, privkey);
-
- if (NT_FAILURE(status = init_use_algo(env, &sigHandle, BCRYPT_ECDSA_ALGORITHM, keyflag, meta, params))) {
- return NULL;
- }
-
- if (NT_FAILURE(status = BCryptOpenAlgorithmProvider(&sigHandle, BCRYPT_ECDSA_ALGORITHM, MS_PRIMITIVE_PROVIDER, 0))) {
- throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptOpenAlgorithmProvider\n", status);
- return NULL;
- }
-
- BCRYPT_ALG_HANDLE hashHandle = NULL;
-
- if (NT_FAILURE(status = BCryptOpenAlgorithmProvider(&hashHandle, hash_algo, NULL, 0))) {
- throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptOpenAlgorithmProvider\n", status);
- BCryptCloseAlgorithmProvider(sigHandle, 0);
- return NULL;
- }
-
- DWORD dummy = 0;
- DWORD hash_len = 0;
- if (NT_FAILURE(status = BCryptGetProperty(hashHandle, BCRYPT_HASH_LENGTH, (PBYTE)&hash_len, sizeof(DWORD), &dummy, 0))) {
- throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptGetProperty(hash len)\n", status);
- BCryptCloseAlgorithmProvider(sigHandle, 0);
- BCryptCloseAlgorithmProvider(hashHandle, 0);
- return NULL;
- }
-
- PBYTE hash = calloc(hash_len, 1);
-
- jint data_len = (*env)->GetArrayLength(env, data);
- jbyte *data_bytes = (*env)->GetByteArrayElements(env, data, NULL);
- native_timing_start();
- status = BCryptHash(hashHandle, NULL, 0, data_bytes, data_len, hash, hash_len);
- native_timing_pause();
-
- if (NT_FAILURE(status)) {
- throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptHash\n", status);
- BCryptCloseAlgorithmProvider(sigHandle, 0);
- BCryptCloseAlgorithmProvider(hashHandle, 0);
- free(hash);
- (*env)->ReleaseByteArrayElements(env, data, data_bytes, JNI_ABORT);
- return NULL;
- }
- (*env)->ReleaseByteArrayElements(env, data, data_bytes, JNI_ABORT);
-
- BCRYPT_KEY_HANDLE skey = NULL;
-
- jmethodID get_data = (*env)->GetMethodID(env, privkey_class, "getData", "()[B");
- jbyteArray privkey_barray = (jbyteArray)(*env)->CallObjectMethod(env, privkey, get_data);
-
- jint priv_length = (*env)->GetArrayLength(env, privkey_barray);
- jbyte *priv_data = (*env)->GetByteArrayElements(env, privkey_barray, NULL);
- if (NT_FAILURE(status = BCryptImportKeyPair(sigHandle, NULL, BCRYPT_ECCFULLPRIVATE_BLOB, &skey, priv_data, priv_length, 0))) {
- throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptImportKeyPair\n", status);
- BCryptCloseAlgorithmProvider(sigHandle, 0);
- BCryptCloseAlgorithmProvider(hashHandle, 0);
- free(hash);
- (*env)->ReleaseByteArrayElements(env, privkey_barray, priv_data, JNI_ABORT);
- return NULL;
- }
- (*env)->ReleaseByteArrayElements(env, privkey_barray, priv_data, JNI_ABORT);
-
- DWORD sig_len = 0;
- native_timing_restart();
- status = BCryptSignHash(skey, NULL, hash, hash_len, NULL, 0, &sig_len, 0);
- native_timing_pause();
-
- if (NT_FAILURE(status)) {
- throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptSignHash(len only)\n", status);
- BCryptCloseAlgorithmProvider(sigHandle, 0);
- BCryptCloseAlgorithmProvider(hashHandle, 0);
- free(hash);
- return NULL;
- }
-
- PBYTE sig_buf = calloc(sig_len, 1);
-
- native_timing_restart();
- status = BCryptSignHash(skey, NULL, hash, hash_len, sig_buf, sig_len, &sig_len, 0);
- native_timing_stop();
-
- if (NT_FAILURE(status)) {
- throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptSignHash(do)\n", status);
- BCryptCloseAlgorithmProvider(sigHandle, 0);
- BCryptCloseAlgorithmProvider(hashHandle, 0);
- free(hash);
- free(sig_buf);
- return NULL;
- }
-
- DWORD half_len = sig_len / 2;
- jobject sig = asn1_der_encode(env, sig_buf, half_len, sig_buf + half_len, half_len);
-
- free(hash);
- free(sig_buf);
- BCryptDestroyKey(skey);
- BCryptCloseAlgorithmProvider(hashHandle, 0);
- BCryptCloseAlgorithmProvider(sigHandle, 0);
-
- return sig;
-}
-
-JNIEXPORT jboolean JNICALL Java_cz_crcs_ectester_standalone_libs_jni_NativeSignatureSpi_00024Mscng_verify(JNIEnv *env, jobject self,
- jbyteArray sig, jbyteArray data,
- jobject pubkey, jobject params) {
- NTSTATUS status;
- LPCWSTR hash_algo = get_sighash_algo(env, self);
-
- BCRYPT_ALG_HANDLE sigHandle = NULL;
-
- jint keyflag = get_keyflag(env, pubkey);
- if (keyflag == KEYFLAG_OTHER) { // TODO: This is not necessary
- throw_new(env, "java/security/InvalidAlgorithmParameterException", "Cannot import non-native public key.");
- return JNI_FALSE;
- }
- jbyteArray meta = get_meta(env, pubkey);
-
- if (NT_FAILURE(status = init_use_algo(env, &sigHandle, BCRYPT_ECDSA_ALGORITHM, keyflag, meta, params))) {
- return JNI_FALSE;
- }
-
- BCRYPT_ALG_HANDLE hashHandle = NULL;
-
- if (NT_FAILURE(status = BCryptOpenAlgorithmProvider(&hashHandle, hash_algo, NULL, 0))) {
- throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptOpenAlgorithmProvider\n", status);
- BCryptCloseAlgorithmProvider(sigHandle, 0);
- return JNI_FALSE;
- }
-
- DWORD dummy = 0;
- DWORD hash_len = 0;
- if (NT_FAILURE(status = BCryptGetProperty(hashHandle, BCRYPT_HASH_LENGTH, (PBYTE)&hash_len, sizeof(DWORD), &dummy, 0))) {
- throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptGetProperty(hash len)\n", status);
- BCryptCloseAlgorithmProvider(sigHandle, 0);
- BCryptCloseAlgorithmProvider(hashHandle, 0);
- return JNI_FALSE;
- }
-
- PBYTE hash = calloc(hash_len, 1);
-
- jint data_len = (*env)->GetArrayLength(env, data);
- jbyte *data_bytes = (*env)->GetByteArrayElements(env, data, NULL);
- native_timing_start();
- status = BCryptHash(hashHandle, NULL, 0, data_bytes, data_len, hash, hash_len);
- native_timing_pause();
-
- if (NT_FAILURE(status)) {
- throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptHash\n", status);
- BCryptCloseAlgorithmProvider(sigHandle, 0);
- BCryptCloseAlgorithmProvider(hashHandle, 0);
- free(hash);
- (*env)->ReleaseByteArrayElements(env, data, data_bytes, JNI_ABORT);
- return JNI_FALSE;
- }
- (*env)->ReleaseByteArrayElements(env, data, data_bytes, JNI_ABORT);
-
- BCRYPT_KEY_HANDLE pkey = NULL;
-
- jmethodID get_data = (*env)->GetMethodID(env, pubkey_class, "getData", "()[B");
- jbyteArray pubkey_barray = (jbyteArray)(*env)->CallObjectMethod(env, pubkey, get_data);
-
- jint pub_length = (*env)->GetArrayLength(env, pubkey_barray);
- jbyte *pub_data = (*env)->GetByteArrayElements(env, pubkey_barray, NULL);
- if (NT_FAILURE(status = BCryptImportKeyPair(sigHandle, NULL, BCRYPT_ECCFULLPUBLIC_BLOB, &pkey, pub_data, pub_length, 0))) {
- throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptImportKeyPair\n", status);
- BCryptCloseAlgorithmProvider(sigHandle, 0);
- BCryptCloseAlgorithmProvider(hashHandle, 0);
- free(hash);
- (*env)->ReleaseByteArrayElements(env, pubkey_barray, pub_data, JNI_ABORT);
- return JNI_FALSE;
- }
- (*env)->ReleaseByteArrayElements(env, pubkey_barray, pub_data, JNI_ABORT);
-
- jmethodID get_n = (*env)->GetMethodID(env, ec_parameter_spec_class, "getOrder", "()Ljava/math/BigInteger;");
- jobject n = (*env)->CallObjectMethod(env, params, get_n);
- jmethodID get_bitlength = (*env)->GetMethodID(env, biginteger_class, "bitLength", "()I");
- jint ord_bits = (*env)->CallIntMethod(env, n, get_bitlength);
- jint ord_bytes = (ord_bits + 7) / 8;
-
- jint sig_len = (*env)->GetArrayLength(env, sig);
- jbyte *sig_data = (*env)->GetByteArrayElements(env, sig, NULL);
- jbyte *r;
- size_t rlen;
- jbyte *s;
- size_t slen;
- bool decode = asn1_der_decode(env, sig, &r, &rlen, &s, &slen);
- (*env)->ReleaseByteArrayElements(env, sig, sig_data, JNI_ABORT);
-
- if (!decode) {
- throw_new(env, "java/security/GeneralSecurityException", "Error decoding sig.");
- BCryptDestroyKey(pkey);
- BCryptCloseAlgorithmProvider(sigHandle, 0);
- BCryptCloseAlgorithmProvider(hashHandle, 0);
- free(hash);
- return JNI_FALSE;
- }
-
- jbyte *r_cpy = r;
- jbyte *s_cpy = s;
- if (rlen > ord_bytes) {
- r_cpy += ord_bytes - rlen;
- }
- if (slen > ord_bytes) {
- s_cpy += ord_bytes - slen;
- }
- if (rlen < ord_bytes) {
- r_cpy = _alloca(ord_bytes);
- memset(r_cpy, 0, ord_bytes);
- memcpy(r_cpy, r + (ord_bytes - rlen), ord_bytes);
- }
- if (slen < ord_bytes) {
- s_cpy = _alloca(ord_bytes);
- memset(s_cpy, 0, ord_bytes);
- memcpy(s_cpy, s + (ord_bytes - slen), ord_bytes);
- }
- rlen = ord_bytes;
- slen = ord_bytes;
-
- UCHAR *sig_full = calloc(rlen + slen, 1);
- memcpy(sig_full, r_cpy, rlen);
- memcpy(sig_full + rlen, s_cpy, slen);
- free(r);
- free(s);
-
- native_timing_restart();
- NTSTATUS result = BCryptVerifySignature(pkey, NULL, hash, hash_len, sig_full, rlen + slen, 0);
- native_timing_stop();
-
- free(hash);
- free(sig_full);
- BCryptDestroyKey(pkey);
- BCryptCloseAlgorithmProvider(hashHandle, 0);
- BCryptCloseAlgorithmProvider(sigHandle, 0);
-
- if (result == STATUS_SUCCESS) {
- return JNI_TRUE;
- } else if (result == STATUS_INVALID_SIGNATURE) {
- return JNI_FALSE;
- } else {
- throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptVerifySignature\n", status);
- return JNI_FALSE;
- }
+#include <windows.h>
+#include <bcrypt.h>
+#include "native.h"
+
+#include "c_timing.h"
+#include "c_utils.h"
+
+// BCRYPT and NT things.
+#define NT_SUCCESS(status) (((NTSTATUS)(status)) >= 0)
+#define NT_FAILURE(status) !NT_SUCCESS(status)
+
+#define STATUS_SUCCESS 0x00000000
+#define STATUS_INVALID_SIGNATURE 0xC000A000
+
+typedef struct {
+ ULONG dwVersion; // Version of the structure
+ ECC_CURVE_TYPE_ENUM dwCurveType; // Supported curve types.
+ ECC_CURVE_ALG_ID_ENUM dwCurveGenerationAlgId; // For X.592 verification purposes, if we include Seed we will need to include the algorithm ID.
+ ULONG cbFieldLength; // Byte length of the fields P, A, B, X, Y.
+ ULONG cbSubgroupOrder; // Byte length of the subgroup.
+ ULONG cbCofactor; // Byte length of cofactor of G in E.
+ ULONG cbSeed; // Byte length of the seed used to generate the curve.
+} BCRYPT_ECC_PARAMETER_HEADER;
+
+// Provider things
+static jclass provider_class;
+
+#define KEYFLAG_IMPLICIT 0 // Mscng native key, over named curve
+#define KEYFLAG_EXPLICIT 1 // Mscng native key, over explicit ecc parameters
+#define KEYFLAG_NIST 2 // Mscng native key, over NIST parameters, custom ECDH/ECDSA_P* algo
+#define KEYFLAG_OTHER 3 // Other key, explicit ecc parameters
+
+JNIEXPORT jobject JNICALL Java_cz_crcs_ectester_standalone_libs_MscngLib_createProvider(JNIEnv *env, jobject self) {
+ jclass local_provider_class = (*env)->FindClass(env, "cz/crcs/ectester/standalone/libs/jni/NativeProvider$Mscng");
+ provider_class = (*env)->NewGlobalRef(env, local_provider_class);
+
+ jmethodID init = (*env)->GetMethodID(env, local_provider_class, "<init>", "(Ljava/lang/String;DLjava/lang/String;)V");
+
+ jstring name = (*env)->NewStringUTF(env, "Microsoft CNG");
+ double version = 1.0;
+
+ return (*env)->NewObject(env, provider_class, init, name, version, name);
+}
+
+JNIEXPORT void JNICALL Java_cz_crcs_ectester_standalone_libs_jni_NativeProvider_00024Mscng_setup(JNIEnv *env, jobject self) {
+ INIT_PROVIDER(env, provider_class);
+
+ ADD_KPG(env, self, "ECDH", "MscngECDH");
+ ADD_KPG(env, self, "ECDSA", "MscngECDSA");
+
+ ADD_KA(env, self, "ECDHwithSHA1KDF(CNG)", "MscngECDHwithSHA1KDF");
+ ADD_KA(env, self, "ECDHwithSHA256KDF(CNG)", "MscngECDHwithSHA256KDF");
+ ADD_KA(env, self, "ECDHwithSHA384KDF(CNG)", "MscngECDHwithSHA384KDF");
+ ADD_KA(env, self, "ECDHwithSHA512KDF(CNG)", "MscngECDHwithSHA512KDF");
+
+ ADD_SIG(env, self, "SHA1withECDSA", "MscngECDSAwithSHA1");
+ ADD_SIG(env, self, "SHA256withECDSA", "MscngECDSAwithSHA256");
+ ADD_SIG(env, self, "SHA384withECDSA", "MscngECDSAwithSHA384");
+ ADD_SIG(env, self, "SHA512withECDSA", "MscngECDSAwithSHA112");
+
+ init_classes(env, "Mscng");
+}
+
+typedef struct {
+ LPCSTR name;
+ ULONG bits;
+} named_curve_t;
+
+static named_curve_t named_curves[] = {
+ {"curve25519", 256}, {"brainpoolP160r1", 160}, {"brainpoolP160t1", 160}, {"brainpoolP192r1", 192}, {"brainpoolP192t1", 192},
+ {"brainpoolP224r1", 224}, {"brainpoolP224t1", 224}, {"brainpoolP256r1", 256}, {"brainpoolP256t1", 256}, {"brainpoolP320r1", 320},
+ {"brainpoolP320t1", 320}, {"brainpoolP384r1", 384}, {"brainpoolP384t1", 384}, {"brainpoolP512r1", 512}, {"brainpoolP512t1", 512},
+ {"ec192wapi", 192}, {"nistP192", 192}, {"nistP224", 224}, {"nistP256", 256}, {"nistP384", 384},
+ {"nistP521", 521}, {"numsP256t1", 256}, {"numsP384t1", 384}, {"numsP512t1", 512}, {"secP160k1", 160},
+ {"secP160r1", 160}, {"secP160r2", 160}, {"secP192k1", 192}, {"secP192r1", 192}, {"secP224k1", 224},
+ {"secP224r1", 224}, {"secP256k1", 256}, {"secP256r1", 256}, {"secP384r1", 384}, {"secP521r1", 521},
+ {"wtls12", 224}, {"wtls7", 160}, {"wtls9", 160}, {"x962P192v1", 192}, {"x962P192v2", 192},
+ {"x962P192v3", 192}, {"x962P239v1", 239}, {"x962P239v2", 239}, {"x962P239v3", 239}, {"x962P256v1", 256}};
+
+static const named_curve_t *lookup_curve(const char *name) {
+ for (size_t i = 0; i < sizeof(named_curves) / sizeof(named_curve_t); ++i) {
+ if (strcmp(name, named_curves[i].name) == 0) {
+ return &named_curves[i];
+ }
+ }
+ return NULL;
+}
+
+static ULONG utf_16to8(NPSTR *out_buf, LPCWSTR in_str) {
+ INT result = WideCharToMultiByte(CP_UTF8, 0, in_str, -1, NULL, 0, NULL, NULL);
+ *out_buf = calloc(result, 1);
+ return WideCharToMultiByte(CP_UTF8, 0, in_str, -1, *out_buf, result, NULL, NULL);
+}
+
+static ULONG utf_8to16(NWPSTR *out_buf, LPCSTR in_str) {
+ INT result = MultiByteToWideChar(CP_UTF8, 0, in_str, -1, NULL, 0);
+ *out_buf = calloc(result * sizeof(WCHAR), 1);
+ return MultiByteToWideChar(CP_UTF8, 0, in_str, -1, *out_buf, result);
+}
+
+/**
+ * Convert Java String to UTF-16 NWPSTR null-terminated.
+ * Returns: Length of NWPSTR in bytes!
+ */
+static ULONG utf_strto16(NWPSTR *out_buf, JNIEnv *env, jobject str) {
+ jsize len = (*env)->GetStringLength(env, str);
+ *out_buf = calloc(len * sizeof(jchar) + 1, 1);
+ const jchar *chars = (*env)->GetStringChars(env, str, NULL);
+ memcpy(*out_buf, chars, len * sizeof(jchar));
+ (*env)->ReleaseStringChars(env, str, chars);
+ return len * sizeof(jchar);
+}
+
+JNIEXPORT jobject JNICALL Java_cz_crcs_ectester_standalone_libs_MscngLib_getCurves(JNIEnv *env, jobject self) {
+ jclass hash_set_class = (*env)->FindClass(env, "java/util/TreeSet");
+
+ jmethodID hash_set_ctr = (*env)->GetMethodID(env, hash_set_class, "<init>", "()V");
+ jmethodID hash_set_add = (*env)->GetMethodID(env, hash_set_class, "add", "(Ljava/lang/Object;)Z");
+
+ jobject result = (*env)->NewObject(env, hash_set_class, hash_set_ctr);
+
+ NTSTATUS status;
+ BCRYPT_ALG_HANDLE handle;
+
+ if (NT_FAILURE(status = BCryptOpenAlgorithmProvider(&handle, BCRYPT_ECDH_ALGORITHM, MS_PRIMITIVE_PROVIDER, 0))) {
+ wprintf(L"**** Error 0x%x returned by BCryptOpenAlgorithmProvider\n", status);
+ return result;
+ }
+
+ ULONG bufSize;
+ if (NT_FAILURE(status = BCryptGetProperty(handle, BCRYPT_ECC_CURVE_NAME_LIST, NULL, 0, &bufSize, 0))) {
+ wprintf(L"**** Error 0x%x returned by BCryptGetProperty(length only)\n", status);
+ BCryptCloseAlgorithmProvider(handle, 0);
+ return result;
+ }
+
+ BCRYPT_ECC_CURVE_NAMES *curves = (BCRYPT_ECC_CURVE_NAMES *)calloc(bufSize, 1);
+ if (NT_FAILURE(status = BCryptGetProperty(handle, BCRYPT_ECC_CURVE_NAME_LIST, (PBYTE)curves, bufSize, &bufSize, 0))) {
+ wprintf(L"**** Error 0x%x returned by BCryptGetProperty(whole)\n", status);
+ BCryptCloseAlgorithmProvider(handle, 0);
+ free(curves);
+ return result;
+ }
+
+ for (size_t i = 0; i < curves->dwEccCurveNames; ++i) {
+ NPSTR curve_name;
+ ULONG len = utf_16to8(&curve_name, curves->pEccCurveNames[i]);
+ jstring c_name = (*env)->NewStringUTF(env, curve_name);
+ (*env)->CallBooleanMethod(env, result, hash_set_add, c_name);
+ free(curve_name);
+ }
+
+ free(curves);
+
+ BCryptCloseAlgorithmProvider(handle, 0);
+ return result;
+}
+
+JNIEXPORT jboolean JNICALL Java_cz_crcs_ectester_standalone_libs_jni_NativeKeyPairGeneratorSpi_00024Mscng_keysizeSupported(JNIEnv *env,
+ jobject self,
+ jint keysize) {
+ switch (keysize) {
+ case 256:
+ case 384:
+ case 521:
+ return JNI_TRUE;
+ default:
+ return JNI_FALSE;
+ }
+}
+
+JNIEXPORT jboolean JNICALL Java_cz_crcs_ectester_standalone_libs_jni_NativeKeyPairGeneratorSpi_00024Mscng_paramsSupported(JNIEnv *env,
+ jobject self,
+ jobject params) {
+ if (params == NULL) {
+ return JNI_FALSE;
+ }
+
+ if ((*env)->IsInstanceOf(env, params, ecgen_parameter_spec_class)) {
+ jmethodID get_name = (*env)->GetMethodID(env, ecgen_parameter_spec_class, "getName", "()Ljava/lang/String;");
+ jstring name = (*env)->CallObjectMethod(env, params, get_name);
+ const char *utf_name = (*env)->GetStringUTFChars(env, name, NULL);
+ const named_curve_t *curve = lookup_curve(utf_name);
+ (*env)->ReleaseStringUTFChars(env, name, utf_name);
+ return curve == NULL ? JNI_FALSE : JNI_TRUE;
+ } else if ((*env)->IsInstanceOf(env, params, ec_parameter_spec_class)) {
+ jmethodID get_curve = (*env)->GetMethodID(env, ec_parameter_spec_class, "getCurve", "()Ljava/security/spec/EllipticCurve;");
+ jobject curve = (*env)->CallObjectMethod(env, params, get_curve);
+
+ jmethodID get_field = (*env)->GetMethodID(env, elliptic_curve_class, "getField", "()Ljava/security/spec/ECField;");
+ jobject field = (*env)->CallObjectMethod(env, curve, get_field);
+
+ if ((*env)->IsInstanceOf(env, field, fp_field_class)) {
+ return JNI_TRUE;
+ } else {
+ return JNI_FALSE;
+ }
+ } else {
+ return JNI_FALSE;
+ }
+}
+
+static jobject bytes_to_biginteger(JNIEnv *env, PBYTE bytes, int len) {
+ jmethodID biginteger_init = (*env)->GetMethodID(env, biginteger_class, "<init>", "(I[B)V");
+ jbyteArray byte_array = (*env)->NewByteArray(env, len);
+ jbyte *data = (*env)->GetByteArrayElements(env, byte_array, NULL);
+ memcpy(data, bytes, len);
+ (*env)->ReleaseByteArrayElements(env, byte_array, data, 0);
+ jobject result = (*env)->NewObject(env, biginteger_class, biginteger_init, 1, byte_array);
+ return result;
+}
+
+static void biginteger_to_bytes(JNIEnv *env, jobject bigint, PBYTE bytes, ULONG len) {
+ jmethodID to_byte_array = (*env)->GetMethodID(env, biginteger_class, "toByteArray", "()[B");
+
+ jbyteArray byte_array = (jbyteArray)(*env)->CallObjectMethod(env, bigint, to_byte_array);
+ jsize byte_length = (*env)->GetArrayLength(env, byte_array);
+ jbyte *byte_data = (*env)->GetByteArrayElements(env, byte_array, NULL);
+ memcpy(bytes, &byte_data[byte_length - len], len);
+ (*env)->ReleaseByteArrayElements(env, byte_array, byte_data, JNI_ABORT);
+}
+
+static jobject create_ec_param_spec(JNIEnv *env, PBYTE eccParams, PULONG paramLength) {
+ //
+ // BCRYPT_ECCFULLKEY_BLOB header
+ // P[cbFieldLength] Prime specifying the base field.
+ // A[cbFieldLength] Coefficient A of the equation y^2 = x^3 + A*x + B mod p
+ // B[cbFieldLength] Coefficient B of the equation y^2 = x^3 + A*x + B mod p
+ // Gx[cbFieldLength] X-coordinate of the base point.
+ // Gy[cbFieldLength] Y-coordinate of the base point.
+ // n[cbSubgroupOrder] Order of the group generated by G = (x,y)
+ // h[cbCofactor] Cofactor of G in E.
+ // S[cbSeed] Seed of the curve.
+
+ BCRYPT_ECCFULLKEY_BLOB *header = (BCRYPT_ECCFULLKEY_BLOB *)eccParams;
+ PBYTE paramsStart = &eccParams[sizeof(BCRYPT_ECCFULLKEY_BLOB)];
+
+ // cbFieldLength
+ PBYTE P = paramsStart;
+ PBYTE A = P + header->cbFieldLength;
+ PBYTE B = A + header->cbFieldLength;
+ PBYTE GX = B + header->cbFieldLength;
+ PBYTE GY = GX + header->cbFieldLength;
+
+ // cbSubgroupOrder
+ PBYTE N = GY + header->cbFieldLength;
+
+ // cbCofactor
+ PBYTE H = N + header->cbSubgroupOrder;
+
+ // cbSeed
+ PBYTE S = H + header->cbCofactor;
+
+ *paramLength =
+ sizeof(BCRYPT_ECCFULLKEY_BLOB) + 5 * header->cbFieldLength + header->cbSubgroupOrder + header->cbCofactor + header->cbSeed;
+
+ jobject p_int = bytes_to_biginteger(env, P, header->cbFieldLength);
+
+ jmethodID fp_field_init = (*env)->GetMethodID(env, fp_field_class, "<init>", "(Ljava/math/BigInteger;)V");
+ jobject field = (*env)->NewObject(env, fp_field_class, fp_field_init, p_int);
+
+ jobject a_int = bytes_to_biginteger(env, A, header->cbFieldLength);
+ jobject b_int = bytes_to_biginteger(env, B, header->cbFieldLength);
+
+ jmethodID elliptic_curve_init = (*env)->GetMethodID(env, elliptic_curve_class, "<init>",
+ "(Ljava/security/spec/ECField;Ljava/math/BigInteger;Ljava/math/BigInteger;)V");
+ jobject elliptic_curve = (*env)->NewObject(env, elliptic_curve_class, elliptic_curve_init, field, a_int, b_int);
+
+ jobject gx_int = bytes_to_biginteger(env, GX, header->cbFieldLength);
+ jobject gy_int = bytes_to_biginteger(env, GY, header->cbFieldLength);
+
+ jmethodID point_init = (*env)->GetMethodID(env, point_class, "<init>", "(Ljava/math/BigInteger;Ljava/math/BigInteger;)V");
+ jobject g = (*env)->NewObject(env, point_class, point_init, gx_int, gy_int);
+
+ jobject n_int = bytes_to_biginteger(env, N, header->cbSubgroupOrder);
+
+ jobject h_int = bytes_to_biginteger(env, H, header->cbCofactor);
+ jmethodID bigint_to_int = (*env)->GetMethodID(env, biginteger_class, "intValue", "()I");
+ jint cof = (*env)->CallIntMethod(env, h_int, bigint_to_int);
+
+ jmethodID ec_parameter_spec_init = (*env)->GetMethodID(
+ env, ec_parameter_spec_class, "<init>", "(Ljava/security/spec/EllipticCurve;Ljava/security/spec/ECPoint;Ljava/math/BigInteger;I)V");
+ return (*env)->NewObject(env, ec_parameter_spec_class, ec_parameter_spec_init, elliptic_curve, g, n_int, cof);
+}
+
+static ULONG create_curve(JNIEnv *env, jobject params, PBYTE *curve) {
+ jmethodID get_curve = (*env)->GetMethodID(env, ec_parameter_spec_class, "getCurve", "()Ljava/security/spec/EllipticCurve;");
+ jobject elliptic_curve = (*env)->CallObjectMethod(env, params, get_curve);
+
+ jmethodID get_field = (*env)->GetMethodID(env, elliptic_curve_class, "getField", "()Ljava/security/spec/ECField;");
+ jobject field = (*env)->CallObjectMethod(env, elliptic_curve, get_field);
+
+ jmethodID get_bits = (*env)->GetMethodID(env, fp_field_class, "getFieldSize", "()I");
+ jint bits = (*env)->CallIntMethod(env, field, get_bits);
+ jint bytes = (bits + 7) / 8;
+
+ jmethodID get_a = (*env)->GetMethodID(env, elliptic_curve_class, "getA", "()Ljava/math/BigInteger;");
+ jobject a = (*env)->CallObjectMethod(env, elliptic_curve, get_a);
+
+ jmethodID get_b = (*env)->GetMethodID(env, elliptic_curve_class, "getB", "()Ljava/math/BigInteger;");
+ jobject b = (*env)->CallObjectMethod(env, elliptic_curve, get_b);
+
+ jmethodID get_p = (*env)->GetMethodID(env, fp_field_class, "getP", "()Ljava/math/BigInteger;");
+ jobject p = (*env)->CallObjectMethod(env, field, get_p);
+
+ jmethodID get_g = (*env)->GetMethodID(env, ec_parameter_spec_class, "getGenerator", "()Ljava/security/spec/ECPoint;");
+ jobject g = (*env)->CallObjectMethod(env, params, get_g);
+
+ jmethodID get_x = (*env)->GetMethodID(env, point_class, "getAffineX", "()Ljava/math/BigInteger;");
+ jobject gx = (*env)->CallObjectMethod(env, g, get_x);
+
+ jmethodID get_y = (*env)->GetMethodID(env, point_class, "getAffineY", "()Ljava/math/BigInteger;");
+ jobject gy = (*env)->CallObjectMethod(env, g, get_y);
+
+ jmethodID get_n = (*env)->GetMethodID(env, ec_parameter_spec_class, "getOrder", "()Ljava/math/BigInteger;");
+ jobject n = (*env)->CallObjectMethod(env, params, get_n);
+
+ jmethodID get_h = (*env)->GetMethodID(env, ec_parameter_spec_class, "getCofactor", "()I");
+ jint h = (*env)->CallIntMethod(env, params, get_h);
+
+ jmethodID get_bitlength = (*env)->GetMethodID(env, biginteger_class, "bitLength", "()I");
+ jint order_bits = (*env)->CallIntMethod(env, n, get_bitlength);
+ jint order_bytes = (order_bits + 7) / 8;
+
+ // header_size + 5*bytes + order_bytes + cof_size + 0
+ ULONG bufSize = sizeof(BCRYPT_ECC_PARAMETER_HEADER) + 5 * bytes + order_bytes + 1 + 0;
+ *curve = calloc(bufSize, 1);
+ BCRYPT_ECC_PARAMETER_HEADER *header = (BCRYPT_ECC_PARAMETER_HEADER *)*curve;
+ header->dwVersion = 1;
+ header->dwCurveType = 1; // 1 -> Prime short Weierstrass, 2 -> Prime Twisted Edwards, 3 -> Montgomery
+ header->dwCurveGenerationAlgId = 0;
+ header->cbFieldLength = bytes;
+ header->cbSubgroupOrder = order_bytes;
+ header->cbCofactor = 1;
+ header->cbSeed = 0;
+
+ PBYTE paramsStart = &(*curve)[sizeof(BCRYPT_ECC_PARAMETER_HEADER)];
+
+ biginteger_to_bytes(env, p, paramsStart, bytes);
+ biginteger_to_bytes(env, a, paramsStart + bytes, bytes);
+ biginteger_to_bytes(env, b, paramsStart + 2 * bytes, bytes);
+ biginteger_to_bytes(env, gx, paramsStart + 3 * bytes, bytes);
+ biginteger_to_bytes(env, gy, paramsStart + 4 * bytes, bytes);
+ biginteger_to_bytes(env, n, paramsStart + 5 * bytes, order_bytes);
+ PBYTE cof_ptr = (PBYTE)(paramsStart + 5 * bytes + order_bytes);
+ *cof_ptr = (BYTE)h;
+ return bufSize;
+}
+
+static ULONG init_algo(JNIEnv *env, BCRYPT_ALG_HANDLE *handle, jint *keyflag, NWPSTR *curve_name, LPCWSTR algo, jobject params) {
+ NTSTATUS status;
+ if (NT_FAILURE(status = BCryptOpenAlgorithmProvider(handle, algo, MS_PRIMITIVE_PROVIDER, 0))) {
+ wprintf(L"**** Error 0x%x returned by BCryptOpenAlgorithmProvider\n", status);
+ return 0;
+ }
+ ULONG result = 0;
+ if ((*env)->IsInstanceOf(env, params, ecgen_parameter_spec_class)) {
+ jmethodID get_name = (*env)->GetMethodID(env, ecgen_parameter_spec_class, "getName", "()Ljava/lang/String;");
+ jstring name = (*env)->CallObjectMethod(env, params, get_name);
+ jint utf_length = (*env)->GetStringUTFLength(env, name);
+ PUCHAR chars = calloc(utf_length + 1, 1);
+ (*env)->GetStringUTFRegion(env, name, 0, utf_length, chars);
+ const named_curve_t *curve = lookup_curve(chars);
+ ULONG ret = utf_8to16(curve_name, chars);
+ if (NT_FAILURE(status = BCryptSetProperty(*handle, BCRYPT_ECC_CURVE_NAME, (PUCHAR)*curve_name, ret * sizeof(WCHAR), 0))) {
+ wprintf(L"**** Error 0x%x returned by BCryptSetProperty\n", status);
+ return 0;
+ }
+ free(chars);
+ result = curve->bits;
+ *keyflag = KEYFLAG_IMPLICIT;
+ } else if ((*env)->IsInstanceOf(env, params, ec_parameter_spec_class)) {
+ PBYTE curve;
+ ULONG curveLen = create_curve(env, params, &curve);
+ if (NT_FAILURE(status = BCryptSetProperty(*handle, BCRYPT_ECC_PARAMETERS, curve, curveLen, 0))) {
+ wprintf(L"**** Error 0x%x returned by BCryptSetProperty\n", status);
+ return 0;
+ }
+ free(curve);
+
+ jmethodID get_curve = (*env)->GetMethodID(env, ec_parameter_spec_class, "getCurve", "()Ljava/security/spec/EllipticCurve;");
+ jobject elliptic_curve = (*env)->CallObjectMethod(env, params, get_curve);
+
+ jmethodID get_field = (*env)->GetMethodID(env, elliptic_curve_class, "getField", "()Ljava/security/spec/ECField;");
+ jobject field = (*env)->CallObjectMethod(env, elliptic_curve, get_field);
+
+ jmethodID get_bits = (*env)->GetMethodID(env, fp_field_class, "getFieldSize", "()I");
+ jint bits = (*env)->CallIntMethod(env, field, get_bits);
+ result = bits;
+ *keyflag = KEYFLAG_EXPLICIT;
+ *curve_name = NULL;
+ }
+ return result;
+}
+
+static jobject key_to_privkey(JNIEnv *env, BCRYPT_KEY_HANDLE key, jint flag, LPCWSTR curve) {
+ NTSTATUS status;
+ ULONG bufSize = 0;
+ if (NT_FAILURE(status = BCryptExportKey(key, NULL, BCRYPT_ECCFULLPRIVATE_BLOB, NULL, 0, &bufSize, 0))) {
+ wprintf(L"**** Error 0x%x returned by BCryptExportKey(full, length only)\n", status);
+ return NULL;
+ }
+ if (bufSize == 0) {
+ printf("buf 0\n");
+ return NULL;
+ }
+
+ PBYTE fullBuf = calloc(bufSize, 1);
+ if (NT_FAILURE(status = BCryptExportKey(key, NULL, BCRYPT_ECCFULLPRIVATE_BLOB, fullBuf, bufSize, &bufSize, 0))) {
+ wprintf(L"**** Error 0x%x returned by BCryptExportKey(full, whole)\n", status);
+ free(fullBuf);
+ return NULL;
+ }
+
+ ULONG paramLength;
+ jobject ec_priv_param_spec = create_ec_param_spec(env, fullBuf, &paramLength);
+
+ // fullBuf looks like:
+ // BCRYPT_ECCFULLKEY_BLOB header
+ // P[cbFieldLength] Prime specifying the base field.
+ // A[cbFieldLength] Coefficient A of the equation y^2 = x^3 + A*x + B mod p
+ // B[cbFieldLength] Coefficient B of the equation y^2 = x^3 + A*x + B mod p
+ // Gx[cbFieldLength] X-coordinate of the base point.
+ // Gy[cbFieldLength] Y-coordinate of the base point.
+ // n[cbSubgroupOrder] Order of the group generated by G = (x,y)
+ // h[cbCofactor] Cofactor of G in E.
+ // S[cbSeed] Seed of the curve.
+ // Qx[cbFieldLength] X-coordinate of the public point.
+ // Qy[cbFieldLength] Y-coordinate of the public point.
+ // d[cbSubgroupOrder] Private key.
+ BCRYPT_ECCFULLKEY_BLOB *privHeader = (BCRYPT_ECCFULLKEY_BLOB *)fullBuf;
+ PBYTE priv_x = &fullBuf[paramLength];
+ PBYTE priv_y = priv_x + privHeader->cbFieldLength;
+ PBYTE priv = priv_y + privHeader->cbFieldLength;
+
+ jbyteArray meta_bytes = NULL;
+ jbyteArray header_bytes = NULL;
+ switch (flag) {
+ case 0: {
+ // meta = curve
+ jint meta_len = (wcslen(curve) + 1) * sizeof(WCHAR);
+ meta_bytes = (*env)->NewByteArray(env, meta_len);
+ jbyte *meta_data = (*env)->GetByteArrayElements(env, meta_bytes, NULL);
+ memcpy(meta_data, curve, meta_len);
+ (*env)->ReleaseByteArrayElements(env, meta_bytes, meta_data, 0);
+ }
+ case 1:
+ case 2: {
+ // meta = null
+ // header = full
+ header_bytes = (*env)->NewByteArray(env, paramLength);
+ jbyte *header_data = (*env)->GetByteArrayElements(env, header_bytes, NULL);
+ memcpy(header_data, fullBuf, paramLength);
+ (*env)->ReleaseByteArrayElements(env, header_bytes, header_data, 0);
+ break;
+ }
+ default:
+ // header = small
+ if (NT_FAILURE(status = BCryptExportKey(key, NULL, BCRYPT_ECCPRIVATE_BLOB, NULL, 0, &bufSize, 0))) {
+ wprintf(L"**** Error 0x%x returned by BCryptExportKey(small, length only)\n", status);
+ free(fullBuf);
+ return NULL;
+ }
+ if (bufSize == 0) {
+ printf("buf 0\n");
+ free(fullBuf);
+ return NULL;
+ }
+ PBYTE smallBuf = calloc(bufSize, 1);
+ if (NT_FAILURE(status = BCryptExportKey(key, NULL, BCRYPT_ECCPRIVATE_BLOB, smallBuf, bufSize, &bufSize, 0))) {
+ wprintf(L"**** Error 0x%x returned by BCryptExportKey(small, whole)\n", status);
+ free(fullBuf);
+ free(smallBuf);
+ return NULL;
+ }
+ // smallBuf looks like:
+ // BCRYPT_ECCKEY_BLOB header
+ // Qx[cbFieldLength] X-coordinate of the public point.
+ // Qy[cbFieldLength] Y-coordinate of the public point.
+ // d[cbSubgroupOrder] Private key.
+ header_bytes = (*env)->NewByteArray(env, sizeof(BCRYPT_ECCKEY_BLOB));
+ jbyte *header_data = (*env)->GetByteArrayElements(env, header_bytes, NULL);
+ memcpy(header_data, smallBuf, sizeof(BCRYPT_ECCKEY_BLOB));
+ (*env)->ReleaseByteArrayElements(env, header_bytes, header_data, 0);
+ free(smallBuf);
+ break;
+ }
+
+ jbyteArray x_bytes = (*env)->NewByteArray(env, privHeader->cbFieldLength);
+ jbyte *x_data = (*env)->GetByteArrayElements(env, x_bytes, NULL);
+ memcpy(x_data, priv_x, privHeader->cbFieldLength);
+ (*env)->ReleaseByteArrayElements(env, x_bytes, x_data, 0);
+
+ jbyteArray y_bytes = (*env)->NewByteArray(env, privHeader->cbFieldLength);
+ jbyte *y_data = (*env)->GetByteArrayElements(env, y_bytes, NULL);
+ memcpy(y_data, priv_y, privHeader->cbFieldLength);
+ (*env)->ReleaseByteArrayElements(env, y_bytes, y_data, 0);
+
+ jbyteArray priv_bytes = (*env)->NewByteArray(env, privHeader->cbSubgroupOrder);
+ jbyte *key_priv = (*env)->GetByteArrayElements(env, priv_bytes, NULL);
+ memcpy(key_priv, priv, privHeader->cbSubgroupOrder);
+ (*env)->ReleaseByteArrayElements(env, priv_bytes, key_priv, 0);
+
+ free(fullBuf);
+
+ jmethodID ec_priv_init = (*env)->GetMethodID(env, privkey_class, "<init>", "(I[B[B[B[B[BLjava/security/spec/ECParameterSpec;)V");
+ return (*env)->NewObject(env, privkey_class, ec_priv_init, flag, meta_bytes, header_bytes, x_bytes, y_bytes, priv_bytes,
+ ec_priv_param_spec);
+}
+
+static jobject key_to_pubkey(JNIEnv *env, BCRYPT_KEY_HANDLE key, jint flag, LPCWSTR curve) {
+ NTSTATUS status;
+ ULONG bufSize = 0;
+ if (NT_FAILURE(status = BCryptExportKey(key, NULL, BCRYPT_ECCFULLPUBLIC_BLOB, NULL, 0, &bufSize, 0))) {
+ wprintf(L"**** Error 0x%x returned by BCryptExportKey(full, length only)\n", status);
+ return NULL;
+ }
+ if (bufSize == 0) {
+ printf("err0\n");
+ return NULL;
+ }
+
+ PBYTE fullBuf = calloc(bufSize, 1);
+ if (NT_FAILURE(status = BCryptExportKey(key, NULL, BCRYPT_ECCFULLPUBLIC_BLOB, fullBuf, bufSize, &bufSize, 0))) {
+ wprintf(L"**** Error 0x%x returned by BCryptExportKey(full, whole)\n", status);
+ return NULL;
+ }
+
+ ULONG paramLength;
+ jobject ec_pub_param_spec = create_ec_param_spec(env, fullBuf, &paramLength);
+
+ // fullBuf looks like:
+ // BCRYPT_ECCFULLKEY_BLOB header
+ // P[cbFieldLength] Prime specifying the base field.
+ // A[cbFieldLength] Coefficient A of the equation y^2 = x^3 + A*x + B mod p
+ // B[cbFieldLength] Coefficient B of the equation y^2 = x^3 + A*x + B mod p
+ // Gx[cbFieldLength] X-coordinate of the base point.
+ // Gy[cbFieldLength] Y-coordinate of the base point.
+ // n[cbSubgroupOrder] Order of the group generated by G = (x,y)
+ // h[cbCofactor] Cofactor of G in E.
+ // S[cbSeed] Seed of the curve.
+ // Qx[cbFieldLength] X-coordinate of the public point.
+ // Qy[cbFieldLength] Y-coordinate of the public point.
+ BCRYPT_ECCFULLKEY_BLOB *pubHeader = (BCRYPT_ECCFULLKEY_BLOB *)fullBuf;
+ PBYTE pub_x = &fullBuf[paramLength];
+ PBYTE pub_y = pub_x + pubHeader->cbFieldLength;
+
+ jbyteArray meta_bytes = NULL;
+ jbyteArray header_bytes = NULL;
+ switch (flag) {
+ case 0: {
+ // meta = curve
+ jint meta_len = (wcslen(curve) + 1) * sizeof(WCHAR);
+ meta_bytes = (*env)->NewByteArray(env, meta_len);
+ jbyte *meta_data = (*env)->GetByteArrayElements(env, meta_bytes, NULL);
+ memcpy(meta_data, curve, meta_len);
+ (*env)->ReleaseByteArrayElements(env, meta_bytes, meta_data, 0);
+ }
+ case 1:
+ case 2: {
+ header_bytes = (*env)->NewByteArray(env, paramLength);
+ jbyte *header_data = (*env)->GetByteArrayElements(env, header_bytes, NULL);
+ memcpy(header_data, pubHeader, paramLength);
+ (*env)->ReleaseByteArrayElements(env, header_bytes, header_data, 0);
+ break;
+ }
+ default:
+ // header = small
+ if (NT_FAILURE(status = BCryptExportKey(key, NULL, BCRYPT_ECCPUBLIC_BLOB, NULL, 0, &bufSize, 0))) {
+ wprintf(L"**** Error 0x%x returned by BCryptExportKey(small, length only)\n", status);
+ free(fullBuf);
+ return NULL;
+ }
+ if (bufSize == 0) {
+ printf("buf 0\n");
+ free(fullBuf);
+ return NULL;
+ }
+ PBYTE smallBuf = calloc(bufSize, 1);
+ if (NT_FAILURE(status = BCryptExportKey(key, NULL, BCRYPT_ECCPUBLIC_BLOB, smallBuf, bufSize, &bufSize, 0))) {
+ wprintf(L"**** Error 0x%x returned by BCryptExportKey(small, whole)\n", status);
+ free(fullBuf);
+ free(smallBuf);
+ return NULL;
+ }
+ // smallBuf looks like:
+ // BCRYPT_ECCKEY_BLOB header
+ // Qx[cbFieldLength] X-coordinate of the public point.
+ // Qy[cbFieldLength] Y-coordinate of the public point.
+ header_bytes = (*env)->NewByteArray(env, sizeof(BCRYPT_ECCKEY_BLOB));
+ jbyte *header_data = (*env)->GetByteArrayElements(env, header_bytes, NULL);
+ memcpy(header_data, smallBuf, sizeof(BCRYPT_ECCKEY_BLOB));
+ (*env)->ReleaseByteArrayElements(env, header_bytes, header_data, 0);
+ free(smallBuf);
+ break;
+ }
+
+ jbyteArray x_bytes = (*env)->NewByteArray(env, pubHeader->cbFieldLength);
+ jbyte *x_data = (*env)->GetByteArrayElements(env, x_bytes, NULL);
+ memcpy(x_data, pub_x, pubHeader->cbFieldLength);
+ (*env)->ReleaseByteArrayElements(env, x_bytes, x_data, 0);
+
+ jbyteArray y_bytes = (*env)->NewByteArray(env, pubHeader->cbFieldLength);
+ jbyte *y_data = (*env)->GetByteArrayElements(env, y_bytes, NULL);
+ memcpy(y_data, pub_y, pubHeader->cbFieldLength);
+ (*env)->ReleaseByteArrayElements(env, y_bytes, y_data, 0);
+
+ free(fullBuf);
+
+ jmethodID ec_pub_init = (*env)->GetMethodID(env, pubkey_class, "<init>", "(I[B[B[B[BLjava/security/spec/ECParameterSpec;)V");
+ return (*env)->NewObject(env, pubkey_class, ec_pub_init, flag, meta_bytes, header_bytes, x_bytes, y_bytes, ec_pub_param_spec);
+}
+
+JNIEXPORT jobject JNICALL
+Java_cz_crcs_ectester_standalone_libs_jni_NativeKeyPairGeneratorSpi_00024Mscng_generate__ILjava_security_SecureRandom_2(JNIEnv *env,
+ jobject self,
+ jint keysize,
+ jobject random) {
+ NTSTATUS status;
+ BCRYPT_ALG_HANDLE handle = NULL;
+
+ jclass mscng_kpg_class = (*env)->FindClass(env, "cz/crcs/ectester/standalone/libs/jni/NativeKeyPairGeneratorSpi$Mscng");
+ jfieldID type_id = (*env)->GetFieldID(env, mscng_kpg_class, "type", "Ljava/lang/String;");
+ jstring type = (jstring)(*env)->GetObjectField(env, self, type_id);
+ const char *type_data = (*env)->GetStringUTFChars(env, type, NULL);
+ LPCWSTR algo;
+ if (strcmp(type_data, "ECDH") == 0) {
+ switch (keysize) {
+ case 256:
+ algo = BCRYPT_ECDH_P256_ALGORITHM;
+ break;
+ case 384:
+ algo = BCRYPT_ECDH_P384_ALGORITHM;
+ break;
+ case 521:
+ algo = BCRYPT_ECDH_P521_ALGORITHM;
+ break;
+ default:
+ // unreachable
+ return NULL;
+ }
+ } else if (strcmp(type_data, "ECDSA") == 0) {
+ switch (keysize) {
+ case 256:
+ algo = BCRYPT_ECDSA_P256_ALGORITHM;
+ break;
+ case 384:
+ algo = BCRYPT_ECDSA_P384_ALGORITHM;
+ break;
+ case 521:
+ algo = BCRYPT_ECDSA_P521_ALGORITHM;
+ break;
+ default:
+ // unreachable
+ return NULL;
+ }
+ } else {
+ // unreachable
+ return NULL;
+ }
+ (*env)->ReleaseStringUTFChars(env, type, type_data);
+
+ if (NT_FAILURE(status = BCryptOpenAlgorithmProvider(&handle, algo, MS_PRIMITIVE_PROVIDER, 0))) {
+ throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptOpenAlgorithmProvider", status);
+ return NULL;
+ }
+
+ BCRYPT_KEY_HANDLE key = NULL;
+
+ native_timing_start();
+ status = BCryptGenerateKeyPair(handle, &key, keysize, 0);
+ native_timing_pause();
+
+ if (NT_FAILURE(status)) {
+ throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptGenerateKeyPair\n", status);
+ BCryptCloseAlgorithmProvider(handle, 0);
+ return NULL;
+ }
+
+ native_timing_restart();
+ status = BCryptFinalizeKeyPair(key, 0);
+ native_timing_stop();
+
+ if (NT_FAILURE(status)) {
+ throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptFinalizeKeyPair\n", status);
+ BCryptCloseAlgorithmProvider(handle, 0);
+ return NULL;
+ }
+
+ jobject privkey = key_to_privkey(env, key, KEYFLAG_NIST, NULL);
+ jobject pubkey = key_to_pubkey(env, key, KEYFLAG_NIST, NULL);
+
+ jmethodID keypair_init = (*env)->GetMethodID(env, keypair_class, "<init>", "(Ljava/security/PublicKey;Ljava/security/PrivateKey;)V");
+
+ BCryptDestroyKey(key);
+ BCryptCloseAlgorithmProvider(handle, 0);
+ return (*env)->NewObject(env, keypair_class, keypair_init, pubkey, privkey);
+}
+
+JNIEXPORT jobject JNICALL
+Java_cz_crcs_ectester_standalone_libs_jni_NativeKeyPairGeneratorSpi_00024Mscng_generate__Ljava_security_spec_AlgorithmParameterSpec_2Ljava_security_SecureRandom_2(
+ JNIEnv *env, jobject self, jobject params, jobject random) {
+ NTSTATUS status;
+ BCRYPT_ALG_HANDLE handle = NULL;
+ BCRYPT_KEY_HANDLE key = NULL;
+
+ jclass mscng_kpg_class = (*env)->FindClass(env, "cz/crcs/ectester/standalone/libs/jni/NativeKeyPairGeneratorSpi$Mscng");
+ jfieldID type_id = (*env)->GetFieldID(env, mscng_kpg_class, "type", "Ljava/lang/String;");
+ jstring type = (jstring)(*env)->GetObjectField(env, self, type_id);
+ const char *type_data = (*env)->GetStringUTFChars(env, type, NULL);
+ LPCWSTR algo;
+ if (strcmp(type_data, "ECDH") == 0) {
+ algo = BCRYPT_ECDH_ALGORITHM;
+ } else if (strcmp(type_data, "ECDSA") == 0) {
+ algo = BCRYPT_ECDSA_ALGORITHM;
+ } else {
+ // unreachable
+ return NULL;
+ }
+ (*env)->ReleaseStringUTFChars(env, type, type_data);
+
+ jint keyflag;
+ NWPSTR curveName;
+ ULONG bits = init_algo(env, &handle, &keyflag, &curveName, algo, params);
+ if (bits == 0) {
+ throw_new(env, "java/security/GeneralSecurityException", "Couldn't initialize algo.");
+ return NULL;
+ }
+
+ native_timing_start();
+ status = BCryptGenerateKeyPair(handle, &key, bits, 0);
+ native_timing_pause();
+
+ if (NT_FAILURE(status)) {
+ throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptGenerateKeyPair\n", status);
+ BCryptCloseAlgorithmProvider(handle, 0);
+ return NULL;
+ }
+
+ native_timing_restart();
+ status = BCryptFinalizeKeyPair(key, 0);
+ native_timing_stop();
+
+ if (NT_FAILURE(status)) {
+ throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptFinalizeKeyPair\n", status);
+ BCryptCloseAlgorithmProvider(handle, 0);
+ return NULL;
+ }
+
+ jobject privkey = key_to_privkey(env, key, keyflag, curveName);
+ jobject pubkey = key_to_pubkey(env, key, keyflag, curveName);
+
+ if (curveName) {
+ free(curveName);
+ }
+
+ jmethodID keypair_init = (*env)->GetMethodID(env, keypair_class, "<init>", "(Ljava/security/PublicKey;Ljava/security/PrivateKey;)V");
+
+ BCryptDestroyKey(key);
+ BCryptCloseAlgorithmProvider(handle, 0);
+ return (*env)->NewObject(env, keypair_class, keypair_init, pubkey, privkey);
+}
+
+static NTSTATUS init_use_algo(JNIEnv *env, BCRYPT_ALG_HANDLE *handle, LPCWSTR type, jint keyflag, jbyteArray meta, jobject params) {
+ LPCWSTR ecdh_algos[] = {BCRYPT_ECDH_ALGORITHM, BCRYPT_ECDH_P256_ALGORITHM, BCRYPT_ECDH_P384_ALGORITHM, BCRYPT_ECDH_P521_ALGORITHM};
+ LPCWSTR ecdsa_algos[] = {BCRYPT_ECDSA_ALGORITHM, BCRYPT_ECDSA_P256_ALGORITHM, BCRYPT_ECDSA_P384_ALGORITHM, BCRYPT_ECDSA_P521_ALGORITHM};
+
+ LPCWSTR *algos;
+ LPCWSTR algo;
+ if (lstrcmpW(type, BCRYPT_ECDH_ALGORITHM) == 0) {
+ algos = ecdh_algos;
+ } else if (lstrcmpW(type, BCRYPT_ECDSA_ALGORITHM) == 0) {
+ algos = ecdsa_algos;
+ } else {
+ // unreachable
+ return STATUS_INVALID_PARAMETER;
+ }
+
+ switch (keyflag) {
+ case KEYFLAG_IMPLICIT:
+ case KEYFLAG_EXPLICIT:
+ case KEYFLAG_OTHER:
+ algo = algos[0];
+ break;
+ case KEYFLAG_NIST: {
+ jmethodID get_curve = (*env)->GetMethodID(env, ec_parameter_spec_class, "getCurve", "()Ljava/security/spec/EllipticCurve;");
+ jobject elliptic_curve = (*env)->CallObjectMethod(env, params, get_curve);
+
+ jmethodID get_field = (*env)->GetMethodID(env, elliptic_curve_class, "getField", "()Ljava/security/spec/ECField;");
+ jobject field = (*env)->CallObjectMethod(env, elliptic_curve, get_field);
+
+ jmethodID get_bits = (*env)->GetMethodID(env, fp_field_class, "getFieldSize", "()I");
+ jint bits = (*env)->CallIntMethod(env, field, get_bits);
+ switch (bits) {
+ case 256:
+ algo = algos[1];
+ break;
+ case 384:
+ algo = algos[2];
+ break;
+ case 521:
+ algo = algos[3];
+ break;
+ default:
+ return STATUS_INVALID_PARAMETER;
+ }
+ break;
+ }
+ }
+ NTSTATUS status;
+
+ if (NT_FAILURE(status = BCryptOpenAlgorithmProvider(handle, algo, MS_PRIMITIVE_PROVIDER, 0))) {
+ throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptOpenAlgorithmProvider\n", status);
+ return status;
+ }
+
+ switch (keyflag) {
+ case KEYFLAG_IMPLICIT: {
+ jint meta_len = (*env)->GetArrayLength(env, meta);
+ jbyte *meta_data = (*env)->GetByteArrayElements(env, meta, NULL);
+ // if (NT_FAILURE(status = BCryptSetProperty(*handle, BCRYPT_ECC_CURVE_NAME, meta_data, meta_len, 0))) {
+ // throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptSetProperty(curve name)\n",
+ //status);
+ // (*env)->ReleaseByteArrayElements(env, meta, meta_data, JNI_ABORT);
+ // return status;
+ //}
+ (*env)->ReleaseByteArrayElements(env, meta, meta_data, JNI_ABORT);
+ break;
+ }
+ case KEYFLAG_EXPLICIT:
+ case KEYFLAG_OTHER: {
+ PBYTE curve;
+ ULONG curve_len = create_curve(env, params, &curve);
+ if (NT_FAILURE(status = BCryptSetProperty(*handle, BCRYPT_ECC_PARAMETERS, curve, curve_len, 0))) {
+ throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptSetProperty(parameters)\n",
+ status);
+ free(curve);
+ return status;
+ }
+ free(curve);
+ break;
+ }
+ }
+ return STATUS_SUCCESS;
+}
+
+static jint get_keyflag(JNIEnv *env, jobject key) {
+ if ((*env)->IsInstanceOf(env, key, pubkey_class) || (*env)->IsInstanceOf(env, key, privkey_class)) {
+ jclass key_class = (*env)->GetObjectClass(env, key);
+ jmethodID get_flag = (*env)->GetMethodID(env, key_class, "getFlag", "()I");
+ return (*env)->CallIntMethod(env, key, get_flag);
+ } else {
+ return KEYFLAG_OTHER;
+ }
+}
+
+static jbyteArray get_meta(JNIEnv *env, jobject key) {
+ if ((*env)->IsInstanceOf(env, key, pubkey_class) || (*env)->IsInstanceOf(env, key, privkey_class)) {
+ jclass key_class = (*env)->GetObjectClass(env, key);
+ jmethodID get_meta = (*env)->GetMethodID(env, key_class, "getMeta", "()[B");
+ return (jbyteArray)(*env)->CallObjectMethod(env, key, get_meta);
+ } else {
+ return NULL;
+ }
+}
+
+JNIEXPORT jbyteArray JNICALL
+Java_cz_crcs_ectester_standalone_libs_jni_NativeKeyAgreementSpi_00024Mscng_generateSecret__Ljava_security_interfaces_ECPublicKey_2Ljava_security_interfaces_ECPrivateKey_2Ljava_security_spec_AlgorithmParameterSpec_2(
+ JNIEnv *env, jobject self, jobject pubkey, jobject privkey, jobject params) {
+ NTSTATUS status;
+
+ jclass mscng_ka_class = (*env)->FindClass(env, "cz/crcs/ectester/standalone/libs/jni/NativeKeyAgreementSpi$Mscng");
+ jfieldID type_id = (*env)->GetFieldID(env, mscng_ka_class, "type", "Ljava/lang/String;");
+ jstring type = (jstring)(*env)->GetObjectField(env, self, type_id);
+ const char *type_data = (*env)->GetStringUTFChars(env, type, NULL);
+ LPCWSTR kdf_algo;
+ if (strcmp(type_data, "ECDHwithSHA1KDF(CNG)") == 0) {
+ kdf_algo = BCRYPT_SHA1_ALGORITHM;
+ } else if (strcmp(type_data, "ECDHwithSHA256KDF(CNG)") == 0) {
+ kdf_algo = BCRYPT_SHA256_ALGORITHM;
+ } else if (strcmp(type_data, "ECDHwithSHA384KDF(CNG)") == 0) {
+ kdf_algo = BCRYPT_SHA384_ALGORITHM;
+ } else if (strcmp(type_data, "ECDHwithSHA512KDF(CNG)") == 0) {
+ kdf_algo = BCRYPT_SHA512_ALGORITHM;
+ } else {
+ // unreachable
+ return NULL;
+ }
+ (*env)->ReleaseStringUTFChars(env, type, type_data);
+
+ BCRYPT_ALG_HANDLE kaHandle = NULL;
+
+ jint pub_flag = get_keyflag(env, pubkey);
+ if (pub_flag == KEYFLAG_OTHER) {
+ throw_new(env, "java/security/InvalidAlgorithmParameterException", "Cannot import non-native public key.");
+ return NULL;
+ }
+ jbyteArray meta = get_meta(env, pubkey);
+
+ if (NT_FAILURE(status = init_use_algo(env, &kaHandle, BCRYPT_ECDH_ALGORITHM, pub_flag, meta, params))) {
+ return NULL;
+ }
+
+ BCRYPT_KEY_HANDLE pkey = NULL;
+ BCRYPT_KEY_HANDLE skey = NULL;
+
+ jmethodID get_data_priv = (*env)->GetMethodID(env, pubkey_class, "getData", "()[B");
+ jbyteArray pubkey_barray = (jbyteArray)(*env)->CallObjectMethod(env, pubkey, get_data_priv);
+
+ jint pub_length = (*env)->GetArrayLength(env, pubkey_barray);
+ jbyte *pub_data = (*env)->GetByteArrayElements(env, pubkey_barray, NULL);
+ if (NT_FAILURE(status = BCryptImportKeyPair(kaHandle, NULL, BCRYPT_ECCFULLPUBLIC_BLOB, &pkey, pub_data, pub_length, 0))) {
+ throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptImportKeyPair(pub)\n", status);
+ BCryptCloseAlgorithmProvider(kaHandle, 0);
+ (*env)->ReleaseByteArrayElements(env, pubkey_barray, pub_data, JNI_ABORT);
+ return NULL;
+ }
+ (*env)->ReleaseByteArrayElements(env, pubkey_barray, pub_data, JNI_ABORT);
+
+ jint priv_flag = get_keyflag(env, privkey);
+ if (priv_flag == KEYFLAG_OTHER) {
+ throw_new(env, "java/security/InvalidAlgorithmParameterException", "Cannot import non-native private key.");
+ return NULL;
+ }
+
+ jmethodID get_data_pub = (*env)->GetMethodID(env, privkey_class, "getData", "()[B");
+ jbyteArray privkey_barray = (jbyteArray)(*env)->CallObjectMethod(env, privkey, get_data_pub);
+
+ jint priv_length = (*env)->GetArrayLength(env, privkey_barray);
+ jbyte *priv_data = (*env)->GetByteArrayElements(env, privkey_barray, NULL);
+ if (NT_FAILURE(status = BCryptImportKeyPair(kaHandle, NULL, BCRYPT_ECCFULLPRIVATE_BLOB, &skey, priv_data, priv_length, 0))) {
+ throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptImportKeyPair(priv)\n", status);
+ BCryptCloseAlgorithmProvider(kaHandle, 0);
+ BCryptDestroyKey(pkey);
+ (*env)->ReleaseByteArrayElements(env, privkey_barray, priv_data, JNI_ABORT);
+ return NULL;
+ }
+ (*env)->ReleaseByteArrayElements(env, privkey_barray, priv_data, JNI_ABORT);
+
+ BCRYPT_SECRET_HANDLE ka = NULL;
+
+ native_timing_start();
+ status = BCryptSecretAgreement(skey, pkey, &ka, 0);
+ native_timing_stop();
+
+ if (NT_FAILURE(status)) {
+ throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptSecretAgreement\n", status);
+ BCryptCloseAlgorithmProvider(kaHandle, 0);
+ BCryptDestroyKey(pkey);
+ BCryptDestroyKey(skey);
+ return NULL;
+ }
+
+ BCryptBufferDesc paramList = {0};
+ BCryptBuffer kdfParams[1] = {0};
+ kdfParams[0].BufferType = KDF_HASH_ALGORITHM;
+ kdfParams[0].cbBuffer = (DWORD)((wcslen(kdf_algo) + 1) * sizeof(WCHAR));
+ kdfParams[0].pvBuffer = (PVOID)kdf_algo;
+ paramList.cBuffers = 1;
+ paramList.pBuffers = kdfParams;
+ paramList.ulVersion = BCRYPTBUFFER_VERSION;
+
+ ULONG bufSize = 0;
+ if (NT_FAILURE(status = BCryptDeriveKey(ka, BCRYPT_KDF_HASH, &paramList, NULL, 0, &bufSize, 0))) {
+ throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptDeriveKey(length only)\n", status);
+ return NULL;
+ }
+
+ PBYTE derived = calloc(bufSize, 1);
+ if (NT_FAILURE(status = BCryptDeriveKey(ka, BCRYPT_KDF_HASH, &paramList, derived, bufSize, &bufSize, 0))) {
+ throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptDeriveKey(whole)\n", status);
+ return NULL;
+ }
+
+ jbyteArray result = (*env)->NewByteArray(env, bufSize);
+ jbyte *result_data = (*env)->GetByteArrayElements(env, result, NULL);
+ memcpy(result_data, derived, bufSize);
+ (*env)->ReleaseByteArrayElements(env, result, result_data, 0);
+
+ free(derived);
+ BCryptDestroyKey(pkey);
+ BCryptDestroyKey(skey);
+ BCryptDestroySecret(ka);
+ BCryptCloseAlgorithmProvider(kaHandle, 0);
+ return result;
+}
+
+JNIEXPORT jobject JNICALL
+Java_cz_crcs_ectester_standalone_libs_jni_NativeKeyAgreementSpi_00024Mscng_generateSecret__Ljava_security_interfaces_ECPublicKey_2Ljava_security_interfaces_ECPrivateKey_2Ljava_security_spec_AlgorithmParameterSpec_2Ljava_lang_String_2(
+ JNIEnv *env, jobject self, jobject pubkey, jobject privkey, jobject params, jstring algorithm) {
+ throw_new(env, "java/lang/UnsupportedOperationException", "Not supported.");
+ return NULL;
+}
+
+static LPCWSTR get_sighash_algo(JNIEnv *env, jobject self) {
+ jclass mscng_sig_class = (*env)->FindClass(env, "cz/crcs/ectester/standalone/libs/jni/NativeSignatureSpi$Mscng");
+ jfieldID type_id = (*env)->GetFieldID(env, mscng_sig_class, "type", "Ljava/lang/String;");
+ jstring type = (jstring)(*env)->GetObjectField(env, self, type_id);
+ const char *type_data = (*env)->GetStringUTFChars(env, type, NULL);
+ LPCWSTR hash_algo;
+ if (strcmp(type_data, "SHA1withECDSA") == 0) {
+ hash_algo = BCRYPT_SHA1_ALGORITHM;
+ } else if (strcmp(type_data, "SHA256withECDSA") == 0) {
+ hash_algo = BCRYPT_SHA256_ALGORITHM;
+ } else if (strcmp(type_data, "SHA384withECDSA") == 0) {
+ hash_algo = BCRYPT_SHA384_ALGORITHM;
+ } else if (strcmp(type_data, "SHA512withECDSA") == 0) {
+ hash_algo = BCRYPT_SHA512_ALGORITHM;
+ } else {
+ // unreachable
+ return NULL;
+ }
+ (*env)->ReleaseStringUTFChars(env, type, type_data);
+ return hash_algo;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_cz_crcs_ectester_standalone_libs_jni_NativeSignatureSpi_00024Mscng_sign(JNIEnv *env, jobject self,
+ jbyteArray data, jobject privkey,
+ jobject params) {
+ NTSTATUS status;
+ LPCWSTR hash_algo = get_sighash_algo(env, self);
+
+ BCRYPT_ALG_HANDLE sigHandle = NULL;
+
+ jint keyflag = get_keyflag(env, privkey);
+ if (keyflag == KEYFLAG_OTHER) {
+ throw_new(env, "java/security/InvalidAlgorithmParameterException", "Cannot import non-native private key.");
+ return NULL;
+ }
+ jbyteArray meta = get_meta(env, privkey);
+
+ if (NT_FAILURE(status = init_use_algo(env, &sigHandle, BCRYPT_ECDSA_ALGORITHM, keyflag, meta, params))) {
+ return NULL;
+ }
+
+ if (NT_FAILURE(status = BCryptOpenAlgorithmProvider(&sigHandle, BCRYPT_ECDSA_ALGORITHM, MS_PRIMITIVE_PROVIDER, 0))) {
+ throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptOpenAlgorithmProvider\n", status);
+ return NULL;
+ }
+
+ BCRYPT_ALG_HANDLE hashHandle = NULL;
+
+ if (NT_FAILURE(status = BCryptOpenAlgorithmProvider(&hashHandle, hash_algo, NULL, 0))) {
+ throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptOpenAlgorithmProvider\n", status);
+ BCryptCloseAlgorithmProvider(sigHandle, 0);
+ return NULL;
+ }
+
+ DWORD dummy = 0;
+ DWORD hash_len = 0;
+ if (NT_FAILURE(status = BCryptGetProperty(hashHandle, BCRYPT_HASH_LENGTH, (PBYTE)&hash_len, sizeof(DWORD), &dummy, 0))) {
+ throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptGetProperty(hash len)\n", status);
+ BCryptCloseAlgorithmProvider(sigHandle, 0);
+ BCryptCloseAlgorithmProvider(hashHandle, 0);
+ return NULL;
+ }
+
+ PBYTE hash = calloc(hash_len, 1);
+
+ jint data_len = (*env)->GetArrayLength(env, data);
+ jbyte *data_bytes = (*env)->GetByteArrayElements(env, data, NULL);
+ native_timing_start();
+ status = BCryptHash(hashHandle, NULL, 0, data_bytes, data_len, hash, hash_len);
+ native_timing_pause();
+
+ if (NT_FAILURE(status)) {
+ throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptHash\n", status);
+ BCryptCloseAlgorithmProvider(sigHandle, 0);
+ BCryptCloseAlgorithmProvider(hashHandle, 0);
+ free(hash);
+ (*env)->ReleaseByteArrayElements(env, data, data_bytes, JNI_ABORT);
+ return NULL;
+ }
+ (*env)->ReleaseByteArrayElements(env, data, data_bytes, JNI_ABORT);
+
+ BCRYPT_KEY_HANDLE skey = NULL;
+
+ jmethodID get_data = (*env)->GetMethodID(env, privkey_class, "getData", "()[B");
+ jbyteArray privkey_barray = (jbyteArray)(*env)->CallObjectMethod(env, privkey, get_data);
+
+ jint priv_length = (*env)->GetArrayLength(env, privkey_barray);
+ jbyte *priv_data = (*env)->GetByteArrayElements(env, privkey_barray, NULL);
+ if (NT_FAILURE(status = BCryptImportKeyPair(sigHandle, NULL, BCRYPT_ECCFULLPRIVATE_BLOB, &skey, priv_data, priv_length, 0))) {
+ throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptImportKeyPair\n", status);
+ BCryptCloseAlgorithmProvider(sigHandle, 0);
+ BCryptCloseAlgorithmProvider(hashHandle, 0);
+ free(hash);
+ (*env)->ReleaseByteArrayElements(env, privkey_barray, priv_data, JNI_ABORT);
+ return NULL;
+ }
+ (*env)->ReleaseByteArrayElements(env, privkey_barray, priv_data, JNI_ABORT);
+
+ DWORD sig_len = 0;
+ native_timing_restart();
+ status = BCryptSignHash(skey, NULL, hash, hash_len, NULL, 0, &sig_len, 0);
+ native_timing_pause();
+
+ if (NT_FAILURE(status)) {
+ throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptSignHash(len only)\n", status);
+ BCryptCloseAlgorithmProvider(sigHandle, 0);
+ BCryptCloseAlgorithmProvider(hashHandle, 0);
+ free(hash);
+ return NULL;
+ }
+
+ PBYTE sig_buf = calloc(sig_len, 1);
+
+ native_timing_restart();
+ status = BCryptSignHash(skey, NULL, hash, hash_len, sig_buf, sig_len, &sig_len, 0);
+ native_timing_stop();
+
+ if (NT_FAILURE(status)) {
+ throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptSignHash(do)\n", status);
+ BCryptCloseAlgorithmProvider(sigHandle, 0);
+ BCryptCloseAlgorithmProvider(hashHandle, 0);
+ free(hash);
+ free(sig_buf);
+ return NULL;
+ }
+
+ DWORD half_len = sig_len / 2;
+ jobject sig = asn1_der_encode(env, sig_buf, half_len, sig_buf + half_len, half_len);
+
+ free(hash);
+ free(sig_buf);
+ BCryptDestroyKey(skey);
+ BCryptCloseAlgorithmProvider(hashHandle, 0);
+ BCryptCloseAlgorithmProvider(sigHandle, 0);
+
+ return sig;
+}
+
+JNIEXPORT jboolean JNICALL Java_cz_crcs_ectester_standalone_libs_jni_NativeSignatureSpi_00024Mscng_verify(JNIEnv *env, jobject self,
+ jbyteArray sig, jbyteArray data,
+ jobject pubkey, jobject params) {
+ NTSTATUS status;
+ LPCWSTR hash_algo = get_sighash_algo(env, self);
+
+ BCRYPT_ALG_HANDLE sigHandle = NULL;
+
+ jint keyflag = get_keyflag(env, pubkey);
+ if (keyflag == KEYFLAG_OTHER) { // TODO: This is not necessary
+ throw_new(env, "java/security/InvalidAlgorithmParameterException", "Cannot import non-native public key.");
+ return JNI_FALSE;
+ }
+ jbyteArray meta = get_meta(env, pubkey);
+
+ if (NT_FAILURE(status = init_use_algo(env, &sigHandle, BCRYPT_ECDSA_ALGORITHM, keyflag, meta, params))) {
+ return JNI_FALSE;
+ }
+
+ BCRYPT_ALG_HANDLE hashHandle = NULL;
+
+ if (NT_FAILURE(status = BCryptOpenAlgorithmProvider(&hashHandle, hash_algo, NULL, 0))) {
+ throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptOpenAlgorithmProvider\n", status);
+ BCryptCloseAlgorithmProvider(sigHandle, 0);
+ return JNI_FALSE;
+ }
+
+ DWORD dummy = 0;
+ DWORD hash_len = 0;
+ if (NT_FAILURE(status = BCryptGetProperty(hashHandle, BCRYPT_HASH_LENGTH, (PBYTE)&hash_len, sizeof(DWORD), &dummy, 0))) {
+ throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptGetProperty(hash len)\n", status);
+ BCryptCloseAlgorithmProvider(sigHandle, 0);
+ BCryptCloseAlgorithmProvider(hashHandle, 0);
+ return JNI_FALSE;
+ }
+
+ PBYTE hash = calloc(hash_len, 1);
+
+ jint data_len = (*env)->GetArrayLength(env, data);
+ jbyte *data_bytes = (*env)->GetByteArrayElements(env, data, NULL);
+ native_timing_start();
+ status = BCryptHash(hashHandle, NULL, 0, data_bytes, data_len, hash, hash_len);
+ native_timing_pause();
+
+ if (NT_FAILURE(status)) {
+ throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptHash\n", status);
+ BCryptCloseAlgorithmProvider(sigHandle, 0);
+ BCryptCloseAlgorithmProvider(hashHandle, 0);
+ free(hash);
+ (*env)->ReleaseByteArrayElements(env, data, data_bytes, JNI_ABORT);
+ return JNI_FALSE;
+ }
+ (*env)->ReleaseByteArrayElements(env, data, data_bytes, JNI_ABORT);
+
+ BCRYPT_KEY_HANDLE pkey = NULL;
+
+ jmethodID get_data = (*env)->GetMethodID(env, pubkey_class, "getData", "()[B");
+ jbyteArray pubkey_barray = (jbyteArray)(*env)->CallObjectMethod(env, pubkey, get_data);
+
+ jint pub_length = (*env)->GetArrayLength(env, pubkey_barray);
+ jbyte *pub_data = (*env)->GetByteArrayElements(env, pubkey_barray, NULL);
+ if (NT_FAILURE(status = BCryptImportKeyPair(sigHandle, NULL, BCRYPT_ECCFULLPUBLIC_BLOB, &pkey, pub_data, pub_length, 0))) {
+ throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptImportKeyPair\n", status);
+ BCryptCloseAlgorithmProvider(sigHandle, 0);
+ BCryptCloseAlgorithmProvider(hashHandle, 0);
+ free(hash);
+ (*env)->ReleaseByteArrayElements(env, pubkey_barray, pub_data, JNI_ABORT);
+ return JNI_FALSE;
+ }
+ (*env)->ReleaseByteArrayElements(env, pubkey_barray, pub_data, JNI_ABORT);
+
+ jmethodID get_n = (*env)->GetMethodID(env, ec_parameter_spec_class, "getOrder", "()Ljava/math/BigInteger;");
+ jobject n = (*env)->CallObjectMethod(env, params, get_n);
+ jmethodID get_bitlength = (*env)->GetMethodID(env, biginteger_class, "bitLength", "()I");
+ jint ord_bits = (*env)->CallIntMethod(env, n, get_bitlength);
+ jint ord_bytes = (ord_bits + 7) / 8;
+
+ jint sig_len = (*env)->GetArrayLength(env, sig);
+ jbyte *sig_data = (*env)->GetByteArrayElements(env, sig, NULL);
+ jbyte *r;
+ size_t rlen;
+ jbyte *s;
+ size_t slen;
+ bool decode = asn1_der_decode(env, sig, &r, &rlen, &s, &slen);
+ (*env)->ReleaseByteArrayElements(env, sig, sig_data, JNI_ABORT);
+
+ if (!decode) {
+ throw_new(env, "java/security/GeneralSecurityException", "Error decoding sig.");
+ BCryptDestroyKey(pkey);
+ BCryptCloseAlgorithmProvider(sigHandle, 0);
+ BCryptCloseAlgorithmProvider(hashHandle, 0);
+ free(hash);
+ return JNI_FALSE;
+ }
+
+ jbyte *r_cpy = r;
+ jbyte *s_cpy = s;
+ if (rlen > ord_bytes) {
+ r_cpy += ord_bytes - rlen;
+ }
+ if (slen > ord_bytes) {
+ s_cpy += ord_bytes - slen;
+ }
+ if (rlen < ord_bytes) {
+ r_cpy = _alloca(ord_bytes);
+ memset(r_cpy, 0, ord_bytes);
+ memcpy(r_cpy, r + (ord_bytes - rlen), ord_bytes);
+ }
+ if (slen < ord_bytes) {
+ s_cpy = _alloca(ord_bytes);
+ memset(s_cpy, 0, ord_bytes);
+ memcpy(s_cpy, s + (ord_bytes - slen), ord_bytes);
+ }
+ rlen = ord_bytes;
+ slen = ord_bytes;
+
+ UCHAR *sig_full = calloc(rlen + slen, 1);
+ memcpy(sig_full, r_cpy, rlen);
+ memcpy(sig_full + rlen, s_cpy, slen);
+ free(r);
+ free(s);
+
+ native_timing_restart();
+ NTSTATUS result = BCryptVerifySignature(pkey, NULL, hash, hash_len, sig_full, rlen + slen, 0);
+ native_timing_stop();
+
+ free(hash);
+ free(sig_full);
+ BCryptDestroyKey(pkey);
+ BCryptCloseAlgorithmProvider(hashHandle, 0);
+ BCryptCloseAlgorithmProvider(sigHandle, 0);
+
+ if (result == STATUS_SUCCESS) {
+ return JNI_TRUE;
+ } else if (result == STATUS_INVALID_SIGNATURE) {
+ return JNI_FALSE;
+ } else {
+ throw_new_var(env, "java/security/GeneralSecurityException", "Error 0x%x returned by BCryptVerifySignature\n", status);
+ return JNI_FALSE;
+ }
} \ No newline at end of file
diff --git a/src/cz/crcs/ectester/standalone/libs/jni/native.h b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/native.h
index 8f5b521..8f5b521 100644
--- a/src/cz/crcs/ectester/standalone/libs/jni/native.h
+++ b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/native.h
diff --git a/src/cz/crcs/ectester/standalone/libs/jni/nettle.c b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/nettle.c
index e8d874a..e8d874a 100644
--- a/src/cz/crcs/ectester/standalone/libs/jni/nettle.c
+++ b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/nettle.c
diff --git a/src/cz/crcs/ectester/standalone/libs/jni/openssl.c b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/openssl.c
index 1739420..1739420 100644
--- a/src/cz/crcs/ectester/standalone/libs/jni/openssl.c
+++ b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/openssl.c
diff --git a/src/cz/crcs/ectester/standalone/libs/jni/tomcrypt.c b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/tomcrypt.c
index 82592f1..82592f1 100644
--- a/src/cz/crcs/ectester/standalone/libs/jni/tomcrypt.c
+++ b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/tomcrypt.c
diff --git a/standalone/src/test/java/cz/crcs/ectester/reader/IdentTests.java b/standalone/src/test/java/cz/crcs/ectester/reader/IdentTests.java
new file mode 100644
index 0000000..2940f1e
--- /dev/null
+++ b/standalone/src/test/java/cz/crcs/ectester/reader/IdentTests.java
@@ -0,0 +1,14 @@
+package cz.crcs.ectester.reader;
+
+import cz.crcs.ectester.standalone.consts.KeyAgreementIdent;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+public class IdentTests {
+ @Test
+ void kaIdents() {
+ for (KeyAgreementIdent keyAgreementIdent : KeyAgreementIdent.list()) {
+ assertNotNull(keyAgreementIdent.getBaseAlgo());
+ }
+ }
+}