Skip to content

Commit

Permalink
Merge branch 'tmyroadctfig-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
horrorho committed Aug 30, 2017
2 parents b1f0e3f + 7ba7319 commit 22bbd3b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
</build>
<dependencies>
<dependency>
<groupId>org.whispersystems</groupId>
<groupId>org.zeromq</groupId>
<artifactId>curve25519-java</artifactId>
<version>0.3.0</version>
<version>0.1.0</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,10 @@ public final class Curve25519 {
private Curve25519() {
}

private static final org.whispersystems.curve25519.Curve25519 curve25519
= org.whispersystems.curve25519.Curve25519.getInstance(org.whispersystems.curve25519.Curve25519.JAVA);

public static byte[] agreement(byte[] publicKey, byte[] privateKey) {
// org.whispersystems.curve25519.BaseJavaCurve25591Provider#calculateAgreement appears to be thread safe.
return curve25519.calculateAgreement(publicKey, clampPrivateKey(privateKey));
byte[] sharedSecret = new byte[32];
djb.Curve25519.curve(sharedSecret, clampPrivateKey(privateKey), publicKey);
return sharedSecret;
}

static byte[] clampPrivateKey(byte[] privateKey) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,14 @@ boolean write(Path path,
try (OutputStream out = Files.newOutputStream(path);
InputStream in = chunkStream(chunks)) {
status &= FileStreamWriter.copy(in, out, keyCipher, signature, decompress);
// status &= FileStreamWriter.copy(in, out, keyCipher, signature);

if (keyCipher.isPresent()) {
XFileKey kc = keyCipher.get();
logger.info("-- write() - written: {} status: {} mode: {} flags: 0x{}",
logger.debug("-- write() - written: {} status: {} mode: {} flags: 0x{}",
path, status, kc.ciphers(), Hex.toHexString(kc.flags()));
System.out.println(">> " + info + " " + kc.ciphers() + " " + Hex.toHexString(kc.flags()));
} else {
logger.info("-- write() - written: {} status: {}", path, status);
logger.debug("-- write() - written: {} status: {}", path, status);
System.out.println(">> " + info);
}
return status;
Expand Down

0 comments on commit 22bbd3b

Please sign in to comment.