From cc4da1b4da5c9c95d49690189ec8e123c2b259c7 Mon Sep 17 00:00:00 2001 From: zzz Date: Fri, 30 Nov 2018 13:51:50 +0000 Subject: [PATCH] Crypto: Move Curve25519 from router to core, in prep for new crypto --- LICENSE.txt | 4 ++++ build.xml | 2 +- .../southernstorm/noise/crypto/x25519}/Curve25519.java | 4 +++- .../com/southernstorm/noise/crypto/x25519/package.html | 8 ++++++++ .../southernstorm/noise/protocol/Curve25519DHState.java | 2 +- .../net/i2p/router/transport/crypto/X25519KeyFactory.java | 2 +- .../net/i2p/router/transport/crypto/X25519PrivateKey.java | 2 +- 7 files changed, 19 insertions(+), 5 deletions(-) rename {router/java/src/com/southernstorm/noise/crypto => core/java/src/com/southernstorm/noise/crypto/x25519}/Curve25519.java (99%) create mode 100644 core/java/src/com/southernstorm/noise/crypto/x25519/package.html diff --git a/LICENSE.txt b/LICENSE.txt index 6e2f8e1ed..cd11843e0 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -90,6 +90,10 @@ Public domain except as listed below: (not included in most distribution packages) See licenses/LICENSE-Apache2.0.txt + Noise library: + Copyright (C) 2016 Southern Storm Software, Pty Ltd. + See licenses/LICENSE-Noise.txt + Router (router.jar): Public domain except as listed below: diff --git a/build.xml b/build.xml index cd90f3a52..12074c67b 100644 --- a/build.xml +++ b/build.xml @@ -825,7 +825,7 @@ additionalparam="-notimestamp" doctitle="I2P Javadocs for Release ${release.number} Build ${i2p.build.number}${build.extra}" windowtitle="I2P Anonymous Network - Java Documentation - Version ${release.number}"> - + diff --git a/router/java/src/com/southernstorm/noise/crypto/Curve25519.java b/core/java/src/com/southernstorm/noise/crypto/x25519/Curve25519.java similarity index 99% rename from router/java/src/com/southernstorm/noise/crypto/Curve25519.java rename to core/java/src/com/southernstorm/noise/crypto/x25519/Curve25519.java index f0529b3b3..2016083c8 100644 --- a/router/java/src/com/southernstorm/noise/crypto/Curve25519.java +++ b/core/java/src/com/southernstorm/noise/crypto/x25519/Curve25519.java @@ -20,7 +20,7 @@ * DEALINGS IN THE SOFTWARE. */ -package com.southernstorm.noise.crypto; +package com.southernstorm.noise.crypto.x25519; import java.util.Arrays; @@ -34,6 +34,8 @@ import java.util.Arrays; * representation instead of the 8/16/32-bit limbs in the original. * * References: http://cr.yp.to/ecdh.html, RFC 7748 + * + * @since 0.9.36 moved from router to core in 0.9.38 */ public final class Curve25519 { diff --git a/core/java/src/com/southernstorm/noise/crypto/x25519/package.html b/core/java/src/com/southernstorm/noise/crypto/x25519/package.html new file mode 100644 index 000000000..ff348bbb6 --- /dev/null +++ b/core/java/src/com/southernstorm/noise/crypto/x25519/package.html @@ -0,0 +1,8 @@ + +

+ Noise X25519 primitive, moved from com.southernstorm.noise.crypto (in router) + to com.southernstorm.noise.crypto.x25519 (in core) in 0.9.38. +

+ Since 0.9.38. +

+ diff --git a/router/java/src/com/southernstorm/noise/protocol/Curve25519DHState.java b/router/java/src/com/southernstorm/noise/protocol/Curve25519DHState.java index 2a39ed7b8..9abbbe66b 100644 --- a/router/java/src/com/southernstorm/noise/protocol/Curve25519DHState.java +++ b/router/java/src/com/southernstorm/noise/protocol/Curve25519DHState.java @@ -25,7 +25,7 @@ package com.southernstorm.noise.protocol; import java.security.KeyPair; import java.util.Arrays; -import com.southernstorm.noise.crypto.Curve25519; +import com.southernstorm.noise.crypto.x25519.Curve25519; import net.i2p.router.transport.crypto.X25519KeyFactory; diff --git a/router/java/src/net/i2p/router/transport/crypto/X25519KeyFactory.java b/router/java/src/net/i2p/router/transport/crypto/X25519KeyFactory.java index b0c16c499..eabe2f6ab 100644 --- a/router/java/src/net/i2p/router/transport/crypto/X25519KeyFactory.java +++ b/router/java/src/net/i2p/router/transport/crypto/X25519KeyFactory.java @@ -3,7 +3,7 @@ package net.i2p.router.transport.crypto; import java.security.KeyPair; import java.util.concurrent.LinkedBlockingQueue; -import com.southernstorm.noise.crypto.Curve25519; +import com.southernstorm.noise.crypto.x25519.Curve25519; import net.i2p.I2PAppContext; import net.i2p.util.I2PThread; diff --git a/router/java/src/net/i2p/router/transport/crypto/X25519PrivateKey.java b/router/java/src/net/i2p/router/transport/crypto/X25519PrivateKey.java index 929efd6ad..1dd95a836 100644 --- a/router/java/src/net/i2p/router/transport/crypto/X25519PrivateKey.java +++ b/router/java/src/net/i2p/router/transport/crypto/X25519PrivateKey.java @@ -2,7 +2,7 @@ package net.i2p.router.transport.crypto; import java.security.PrivateKey; -import com.southernstorm.noise.crypto.Curve25519; +import com.southernstorm.noise.crypto.x25519.Curve25519; /** * A PrivateKey we can stick in a KeyPair.