Compare commits
10
Commits
6e603c1f55
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a41d9d39ca | ||
|
|
b249b85e4a | ||
|
|
ee603b1ee0 | ||
|
|
88d187cc64 | ||
|
|
db9390d11c | ||
|
|
5eea98d115 | ||
|
|
581161cf7f | ||
|
|
f4ec8cff40 | ||
|
|
39e3a75953 | ||
|
|
d03421a5d4 |
@@ -0,0 +1,19 @@
|
||||
[](https://travis-ci.org/zmarko/sss)
|
||||
|
||||
sss
|
||||
===
|
||||
|
||||
This library contains Java implementation of the [Shamir's Secret Sharing](http://en.wikipedia.org/wiki/Shamir%27s_Secret_Sharing) algorithm.
|
||||
|
||||
You can use it to split arbitrary data into a number of shares.
|
||||
In order to join shares back into the secret data, certain, minimum number of shares must be present.
|
||||
The library contains utlity functions for serializing and de-serializing shares into binary messages, for compact and easy storing and sharing.
|
||||
|
||||
Artifacts are available in Maven Central repository at the following coordinates:
|
||||
|
||||
<dependency>
|
||||
<groupId>rs.in.zivanovic</groupId>
|
||||
<artifactId>sss</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>rs.in.zivanovic</groupId>
|
||||
<artifactId>sss</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<version>1.0.1-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${project.groupId}:${project.artifactId}</name>
|
||||
@@ -41,6 +41,7 @@
|
||||
<connection>scm:git:git@github.com:zmarko/sss.git</connection>
|
||||
<developerConnection>scm:git:git@github.com:zmarko/sss.git</developerConnection>
|
||||
<url>git@github.com:zmarko/sss.git</url>
|
||||
<tag>HEAD</tag>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
@@ -52,6 +53,36 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.sonatype.plugins</groupId>
|
||||
<artifactId>nexus-staging-maven-plugin</artifactId>
|
||||
<version>1.6.5</version>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<serverId>ossrh</serverId>
|
||||
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
|
||||
<autoReleaseAfterClose>true</autoReleaseAfterClose>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-release-plugin</artifactId>
|
||||
<version>2.5.1</version>
|
||||
<configuration>
|
||||
<autoVersionSubmodules>true</autoVersionSubmodules>
|
||||
<useReleaseProfile>false</useReleaseProfile>
|
||||
<releaseProfiles>release</releaseProfiles>
|
||||
<goals>deploy</goals>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>release</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
@@ -94,18 +125,9 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-release-plugin</artifactId>
|
||||
<version>2.5.1</version>
|
||||
<configuration>
|
||||
<autoVersionSubmodules>true</autoVersionSubmodules>
|
||||
<useReleaseProfile>false</useReleaseProfile>
|
||||
<releaseProfiles>release</releaseProfiles>
|
||||
<goals>deploy</goals>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
</project>
|
||||
@@ -49,7 +49,7 @@ public final class SasUtils {
|
||||
public static BigInteger encodeStringToInteger(String str) {
|
||||
byte[] bytes = str.getBytes(StandardCharsets.UTF_8);
|
||||
byte[] res;
|
||||
if ((bytes[0] & 0b10000000) >> 7 == 1) {
|
||||
if ((bytes[0] & 0b1000_0000) >> 7 == 1) {
|
||||
res = new byte[bytes.length + 1];
|
||||
res[0] = 0;
|
||||
System.arraycopy(bytes, 0, res, 1, bytes.length);
|
||||
|
||||
@@ -84,10 +84,7 @@ public final class SecretShare {
|
||||
if (!Objects.equals(this.share, other.share)) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(this.prime, other.prime)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return Objects.equals(this.prime, other.prime);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user