forked from I2P_Developers/i2p.i2p
EdDSA: Reduce diff between vendored code and upstream
Includes missing license information.
This commit is contained in:
@@ -1,3 +1,14 @@
|
||||
/**
|
||||
* EdDSA-Java by str4d
|
||||
*
|
||||
* To the extent possible under law, the person who associated CC0 with
|
||||
* EdDSA-Java has waived all copyright and related or neighboring rights
|
||||
* to EdDSA-Java.
|
||||
*
|
||||
* You should have received a copy of the CC0 legalcode along with this
|
||||
* work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
|
||||
*
|
||||
*/
|
||||
package net.i2p.crypto.eddsa;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
|
||||
@@ -1,3 +1,14 @@
|
||||
/**
|
||||
* EdDSA-Java by str4d
|
||||
*
|
||||
* To the extent possible under law, the person who associated CC0 with
|
||||
* EdDSA-Java has waived all copyright and related or neighboring rights
|
||||
* to EdDSA-Java.
|
||||
*
|
||||
* You should have received a copy of the CC0 legalcode along with this
|
||||
* work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
|
||||
*
|
||||
*/
|
||||
package net.i2p.crypto.eddsa;
|
||||
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
|
||||
@@ -1,3 +1,14 @@
|
||||
/**
|
||||
* EdDSA-Java by str4d
|
||||
*
|
||||
* To the extent possible under law, the person who associated CC0 with
|
||||
* EdDSA-Java has waived all copyright and related or neighboring rights
|
||||
* to EdDSA-Java.
|
||||
*
|
||||
* You should have received a copy of the CC0 legalcode along with this
|
||||
* work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
|
||||
*
|
||||
*/
|
||||
package net.i2p.crypto.eddsa;
|
||||
|
||||
import org.hamcrest.core.IsEqual;
|
||||
@@ -105,6 +116,11 @@ public class UtilsTest {
|
||||
assertThat(Utils.bit(new byte[] {1, 2, 3}, 16), is(1));
|
||||
}
|
||||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
public void hexToBytesThrowsOnInvalidLengthHexString() {
|
||||
Utils.hexToBytes("bad");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void hexToBytesReturnsCorrectByteArray() {
|
||||
Assert.assertThat(Utils.hexToBytes(hex1), IsEqual.equalTo(bytes1));
|
||||
|
||||
@@ -1,6 +1,16 @@
|
||||
/**
|
||||
* EdDSA-Java by str4d
|
||||
*
|
||||
* To the extent possible under law, the person who associated CC0 with
|
||||
* EdDSA-Java has waived all copyright and related or neighboring rights
|
||||
* to EdDSA-Java.
|
||||
*
|
||||
* You should have received a copy of the CC0 legalcode along with this
|
||||
* work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
|
||||
*
|
||||
*/
|
||||
package net.i2p.crypto.eddsa.math;
|
||||
|
||||
import net.i2p.crypto.eddsa.math.*;
|
||||
import org.hamcrest.core.*;
|
||||
import org.junit.*;
|
||||
|
||||
|
||||
@@ -1,3 +1,14 @@
|
||||
/**
|
||||
* EdDSA-Java by str4d
|
||||
*
|
||||
* To the extent possible under law, the person who associated CC0 with
|
||||
* EdDSA-Java has waived all copyright and related or neighboring rights
|
||||
* to EdDSA-Java.
|
||||
*
|
||||
* You should have received a copy of the CC0 legalcode along with this
|
||||
* work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
|
||||
*
|
||||
*/
|
||||
package net.i2p.crypto.eddsa.math;
|
||||
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
|
||||
@@ -1,3 +1,14 @@
|
||||
/**
|
||||
* EdDSA-Java by str4d
|
||||
*
|
||||
* To the extent possible under law, the person who associated CC0 with
|
||||
* EdDSA-Java has waived all copyright and related or neighboring rights
|
||||
* to EdDSA-Java.
|
||||
*
|
||||
* You should have received a copy of the CC0 legalcode along with this
|
||||
* work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
|
||||
*
|
||||
*/
|
||||
package net.i2p.crypto.eddsa.math;
|
||||
|
||||
import net.i2p.crypto.eddsa.*;
|
||||
|
||||
@@ -1,3 +1,14 @@
|
||||
/**
|
||||
* EdDSA-Java by str4d
|
||||
*
|
||||
* To the extent possible under law, the person who associated CC0 with
|
||||
* EdDSA-Java has waived all copyright and related or neighboring rights
|
||||
* to EdDSA-Java.
|
||||
*
|
||||
* You should have received a copy of the CC0 legalcode along with this
|
||||
* work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
|
||||
*
|
||||
*/
|
||||
package net.i2p.crypto.eddsa.math;
|
||||
|
||||
import net.i2p.crypto.eddsa.Utils;
|
||||
|
||||
@@ -1,3 +1,14 @@
|
||||
/**
|
||||
* EdDSA-Java by str4d
|
||||
*
|
||||
* To the extent possible under law, the person who associated CC0 with
|
||||
* EdDSA-Java has waived all copyright and related or neighboring rights
|
||||
* to EdDSA-Java.
|
||||
*
|
||||
* You should have received a copy of the CC0 legalcode along with this
|
||||
* work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
|
||||
*
|
||||
*/
|
||||
package net.i2p.crypto.eddsa.math;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
|
||||
@@ -1,3 +1,14 @@
|
||||
/**
|
||||
* EdDSA-Java by str4d
|
||||
*
|
||||
* To the extent possible under law, the person who associated CC0 with
|
||||
* EdDSA-Java has waived all copyright and related or neighboring rights
|
||||
* to EdDSA-Java.
|
||||
*
|
||||
* You should have received a copy of the CC0 legalcode along with this
|
||||
* work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
|
||||
*
|
||||
*/
|
||||
package net.i2p.crypto.eddsa.math.bigint;
|
||||
|
||||
import static org.hamcrest.Matchers.*;
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
/**
|
||||
*
|
||||
* EdDSA-Java by str4d
|
||||
*
|
||||
* To the extent possible under law, the person who associated CC0 with
|
||||
* EdDSA-Java has waived all copyright and related or neighboring rights
|
||||
* to EdDSA-Java.
|
||||
*
|
||||
* You should have received a copy of the CC0 legalcode along with this
|
||||
* work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
|
||||
*
|
||||
*/
|
||||
package net.i2p.crypto.eddsa.math.bigint;
|
||||
|
||||
|
||||
@@ -1,3 +1,14 @@
|
||||
/**
|
||||
* EdDSA-Java by str4d
|
||||
*
|
||||
* To the extent possible under law, the person who associated CC0 with
|
||||
* EdDSA-Java has waived all copyright and related or neighboring rights
|
||||
* to EdDSA-Java.
|
||||
*
|
||||
* You should have received a copy of the CC0 legalcode along with this
|
||||
* work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
|
||||
*
|
||||
*/
|
||||
package net.i2p.crypto.eddsa.math.ed25519;
|
||||
|
||||
import net.i2p.crypto.eddsa.math.*;
|
||||
|
||||
@@ -1,3 +1,14 @@
|
||||
/**
|
||||
* EdDSA-Java by str4d
|
||||
*
|
||||
* To the extent possible under law, the person who associated CC0 with
|
||||
* EdDSA-Java has waived all copyright and related or neighboring rights
|
||||
* to EdDSA-Java.
|
||||
*
|
||||
* You should have received a copy of the CC0 legalcode along with this
|
||||
* work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
|
||||
*
|
||||
*/
|
||||
package net.i2p.crypto.eddsa.math.ed25519;
|
||||
|
||||
import net.i2p.crypto.eddsa.math.*;
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
/**
|
||||
*
|
||||
* EdDSA-Java by str4d
|
||||
*
|
||||
* To the extent possible under law, the person who associated CC0 with
|
||||
* EdDSA-Java has waived all copyright and related or neighboring rights
|
||||
* to EdDSA-Java.
|
||||
*
|
||||
* You should have received a copy of the CC0 legalcode along with this
|
||||
* work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
|
||||
*
|
||||
*/
|
||||
package net.i2p.crypto.eddsa.math.ed25519;
|
||||
|
||||
|
||||
@@ -1,3 +1,14 @@
|
||||
/**
|
||||
* EdDSA-Java by str4d
|
||||
*
|
||||
* To the extent possible under law, the person who associated CC0 with
|
||||
* EdDSA-Java has waived all copyright and related or neighboring rights
|
||||
* to EdDSA-Java.
|
||||
*
|
||||
* You should have received a copy of the CC0 legalcode along with this
|
||||
* work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
|
||||
*
|
||||
*/
|
||||
package net.i2p.crypto.eddsa.spec;
|
||||
|
||||
import static org.hamcrest.Matchers.*;
|
||||
@@ -38,7 +49,7 @@ public class EdDSAPrivateKeySpecTest {
|
||||
public void incorrectSeedLengthThrows() {
|
||||
exception.expect(IllegalArgumentException.class);
|
||||
exception.expectMessage("seed length is wrong");
|
||||
EdDSAPrivateKeySpec key = new EdDSAPrivateKeySpec(new byte[2], ed25519);
|
||||
new EdDSAPrivateKeySpec(new byte[2], ed25519);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -56,6 +67,6 @@ public class EdDSAPrivateKeySpecTest {
|
||||
public void incorrectHashLengthThrows() {
|
||||
exception.expect(IllegalArgumentException.class);
|
||||
exception.expectMessage("hash length is wrong");
|
||||
EdDSAPrivateKeySpec key = new EdDSAPrivateKeySpec(ed25519, new byte[2]);
|
||||
new EdDSAPrivateKeySpec(ed25519, new byte[2]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user