Giter Site home page Giter Site logo

multischnorrapplet's Introduction

MultiSchnorrApplet

A JavaCard applet implementing the first party of the MultiSchnorr multi-signature scheme. Use with the MultiSchnorrReader.

Before using the applet with the reader app, it is recommended to run the correctness tests first. Otherwise the app may time out during the applet's initialization on older cards.

Cards

Before attempting to run the applet on a physical card, make sure to set the correct card in MainApplet's constructor:

public MainApplet(byte[] buffer, short offset, byte length) {
    // ...
    support.setCard(OperationSupport.SIMULATOR);
    // ...
}

The applet was tested on the following cards: JCOP21, JCOP3_P60, JCOP4_P71, GD60, and GD70. Depending on the JavaCard version supported by the given card, it may be necessary to change JC_SELECTED in build.gradle. In particular, set JC_SELECTED = JC303 for JCOP21 and GD60.

Build

./gradlew buildJavaCard

The built CAP file is located in ./applet/build/javacard.

Install

./gradlew installJavaCard

Alternatively, install the CAP file using GlobalPlatformPro.

Test

By default, the tests run the applet in a simulator. If a physical card should be used instead, specify it in the test's constructor as follows:

public Test() throws Exception {
  setCardType(CardType.PHYSICAL);
}

Correctness tests (AppletTest.java):

./gradlew test --tests AppletTest --rerun-tasks

Performance tests (PerformanceTest.java):

./gradlew test --tests PerformanceTest.full --rerun-tasks

If OperationSupport.EC_HW_XY is set to true, it is sufficient to use PerformanceTest.noProb. The full test runs slower and provides no new information in this case. However, if you want to test the probabilistic signing optimization, make sure to set support.EC_HW_XY = false in MainApplet's constructor and run the full test.

The results are saved to applet/measurements.csv.

Performance

Performance Overview

Probabilistic Signing Performance

The measured data and their analysis can be found in perf.

To replicate the results, intall the applet on your card and run PerformanceTest as described. To analyze them, copy applet/measurements.csv to perf/dava/, the target file should end with -x.csv if PerformanceTest.full was used and with -xy.csv otherwise (see the structure of the existing files).

Troubleshooting

See the javacard-gradle-template this project is based on for more information.

multischnorrapplet's People

Contributors

jjanku avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.