This is an implementation of EdDSA (SHA3) 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:
- A port of the radix-2^51 operations in ref10 - fast and constant-time, but only useful for Ed25519.
- A generic version using BigIntegers for calculation - a bit slower and not constant-time, but compatible with any EdDSA parameter specification.
Gradle users:
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
dependencies {
compile 'com.github.warchant:ed25519-sha3-java:1.0'
The code requires Java 6 (for e.g. the Arrays.copyOfRange()
calls in EdDSAEngine.engineVerify()
).
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.
Security.addProvider(new EdDSASecurityProvider());
KeyPairGenerator keyGen = KeyPairGenerator.getInstance("EdDSA/SHA3", "EdDSA");
KeyFactory keyFac = KeyFactory.getInstance("EdDSA/SHA3", "EdDSA");
Signature sgr = Signature.getInstance("EdDSA/SHA3", "EdDSA");
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:
- The unit test suite includes tests against the data from the original Python implementation modified for use of SHA3-512 (original).