Home

Awesome

EdDSA-Java

Build Status

This is an implementation of EdDSA in Java. Structurally, it is based on the ref10 implementation in SUPERCOP (see https://ed25519.cr.yp.to/software.html).

There are two internal implementations:

To use

Download the latest .jar from the releases tab and place it in your classpath.

Gradle users:

compile 'net.i2p.crypto:eddsa:0.3.0'

Java 7 and above are supported.

The JUnit4 tests require the Hamcrest library hamcrest-all.jar.

This code is released to the public domain and can be used for any purpose. See LICENSE.txt for details.

Disclaimer

There are no guarantees that this is secure for all cases, and users should review the code themselves before depending on it. PRs that fix bugs or improve reviewability are very welcome. Additionally:

Code comparison

For ease of following, here are the main methods in ref10 and their equivalents in this codebase:

EdDSA Operationref10 functionJava function
Generate keypaircrypto_sign_keypairEdDSAPrivateKeySpec constructor
Sign messagecrypto_signEdDSAEngine.engineSign
Verify signaturecrypto_sign_openEdDSAEngine.engineVerify
EdDSA point arithmeticref10 functionJava function
R = b * Bge_scalarmult_baseGroupElement.scalarMultiply
R = a*A + b*Bge_double_scalarmult_vartimeGroupElement.doubleScalarMultiplyVariableTime
R = 2 * Pge_p2_dblGroupElement.dbl
R = P + Qge_madd, ge_addGroupElement.madd, GroupElement.add
R = P - Qge_msub, ge_subGroupElement.msub, GroupElement.sub

Important changes

0.3.0

0.2.0

Credits