Warchant/ed25519-sha3-java


Pure Java implementation of EdDSA-SHA3 (ref10 https://github.com/hyperledger/iroha-ed25519)

Download


Step 1. Add the JitPack repository to your build file

Add it in your root settings.gradle at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url 'https://jitpack.io' }
		}
	}

Add it in your settings.gradle.kts at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url = uri("https://jitpack.io") }
		}
	}

Add to pom.xml

	<repositories>
		<repository>
		    <id>jitpack.io</id>
		    <url>https://jitpack.io</url>
		</repository>
	</repositories>

Add it in your build.sbt at the end of resolvers:

 
    resolvers += "jitpack" at "https://jitpack.io"
        
    

Add it in your project.clj at the end of repositories:

 
    :repositories [["jitpack" "https://jitpack.io"]]
        
    

Step 2. Add the dependency

	dependencies {
		implementation 'com.github.warchant:ed25519-sha3-java:2.0.1'
	}
	dependencies {
		implementation("com.github.warchant:ed25519-sha3-java:2.0.1")
	}
	<dependency>
	    <groupId>com.github.warchant</groupId>
	    <artifactId>ed25519-sha3-java</artifactId>
	    <version>2.0.1</version>
	</dependency>

                            
    libraryDependencies += "com.github.warchant" % "ed25519-sha3-java" % "2.0.1"
        
        

                            
    :dependencies [[com.github.warchant/ed25519-sha3-java "2.0.1"]]
        
        

Readme


EdDSA-Java

Build Status Codacy Badge FOSSA Status

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.

To use

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.

Usage Example

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");

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:

License

FOSSA Status