forked from I2P_Developers/i2p.i2p
Tests: Copy the new EdDSA test vectors
to where the classloader can find them. Throw a better error message if not found.
This commit is contained in:
@ -125,6 +125,13 @@
|
|||||||
</classpath>
|
</classpath>
|
||||||
<compilerarg line="${javac.compilerargs}" />
|
<compilerarg line="${javac.compilerargs}" />
|
||||||
</javac>
|
</javac>
|
||||||
|
<!-- EdDSA test vectors -->
|
||||||
|
<copy todir="./build/obj">
|
||||||
|
<fileset dir="./test/junit/">
|
||||||
|
<include name="net/i2p/crypto/eddsa/math/baseDblPrecmp"/>
|
||||||
|
<include name="net/i2p/crypto/eddsa/math/basePrecmp"/>
|
||||||
|
</fileset>
|
||||||
|
</copy>
|
||||||
</target>
|
</target>
|
||||||
<!-- jars with tests -->
|
<!-- jars with tests -->
|
||||||
<target name="jarScalaTest" depends="scalatest.compileTest">
|
<target name="jarScalaTest" depends="scalatest.compileTest">
|
||||||
@ -144,7 +151,10 @@
|
|||||||
<jar destfile="./build/i2pscalatest.jar" basedir="./build/obj_scala_jar" includes="**/*.class" />
|
<jar destfile="./build/i2pscalatest.jar" basedir="./build/obj_scala_jar" includes="**/*.class" />
|
||||||
</target>
|
</target>
|
||||||
<target name="jarTest" depends="junit.compileTest">
|
<target name="jarTest" depends="junit.compileTest">
|
||||||
<jar destfile="./build/i2ptest.jar" basedir="./build/obj" includes="**/*.class" />
|
<!-- warning - The junit.test target below doesn't actually include i2ptest.jar in the classpath,
|
||||||
|
only the build/obj directory.
|
||||||
|
-->
|
||||||
|
<jar destfile="./build/i2ptest.jar" basedir="./build/obj" includes="**/*.class **/baseDblPrecmp **/basePrecmp" />
|
||||||
</target>
|
</target>
|
||||||
<!-- preparation of code coverage tool of choice -->
|
<!-- preparation of code coverage tool of choice -->
|
||||||
<target name="prepareClover" depends="compile" if="with.clover">
|
<target name="prepareClover" depends="compile" if="with.clover">
|
||||||
|
@ -2,6 +2,7 @@ package net.i2p.crypto.eddsa.math;
|
|||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
|
|
||||||
import net.i2p.crypto.eddsa.Utils;
|
import net.i2p.crypto.eddsa.Utils;
|
||||||
@ -22,8 +23,10 @@ public class PrecomputationTestVectors {
|
|||||||
BufferedReader file = null;
|
BufferedReader file = null;
|
||||||
int row = 0, col = 0;
|
int row = 0, col = 0;
|
||||||
try {
|
try {
|
||||||
file = new BufferedReader(new InputStreamReader(
|
InputStream is = PrecomputationTestVectors.class.getResourceAsStream(fileName);
|
||||||
PrecomputationTestVectors.class.getResourceAsStream(fileName)));
|
if (is == null)
|
||||||
|
throw new IOException("Resource not found: " + fileName);
|
||||||
|
file = new BufferedReader(new InputStreamReader(is));
|
||||||
String line;
|
String line;
|
||||||
while ((line = file.readLine()) != null) {
|
while ((line = file.readLine()) != null) {
|
||||||
if (line.equals(" },"))
|
if (line.equals(" },"))
|
||||||
|
Reference in New Issue
Block a user