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:
zzz
2014-11-14 16:44:04 +00:00
parent 2f2aa7f5a8
commit 9104bd7304
2 changed files with 16 additions and 3 deletions

View File

@ -2,6 +2,7 @@ package net.i2p.crypto.eddsa.math;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import net.i2p.crypto.eddsa.Utils;
@ -22,8 +23,10 @@ public class PrecomputationTestVectors {
BufferedReader file = null;
int row = 0, col = 0;
try {
file = new BufferedReader(new InputStreamReader(
PrecomputationTestVectors.class.getResourceAsStream(fileName)));
InputStream is = PrecomputationTestVectors.class.getResourceAsStream(fileName);
if (is == null)
throw new IOException("Resource not found: " + fileName);
file = new BufferedReader(new InputStreamReader(is));
String line;
while ((line = file.readLine()) != null) {
if (line.equals(" },"))