KeyGen test tweaks

This commit is contained in:
zzz
2019-06-25 13:24:38 +00:00
parent d084f93506
commit 85a2c9026a

View File

@ -492,16 +492,18 @@ public final class KeyGenerator {
stime += mid - start;
vtime += end - mid;
if (!ok)
throw new GeneralSecurityException(type + " V(S(data)) fail");
throw new GeneralSecurityException(type + " V(S(data)) fail on run " + i);
if (!ok2)
throw new GeneralSecurityException(type + " V(S(H(data))) fail");
throw new GeneralSecurityException(type + " V(S(H(data))) fail on run" + i);
}
stime /= 1000*1000;
vtime /= 1000*1000;
// we do two of each per run above
int runs2 = runs * 2;
System.out.println(type + " sign/verify " + runs + " times: " + (vtime+stime) + " ms = " +
(((double) stime) / runs) + " each sign, " +
(((double) vtime) / runs) + " each verify, " +
(((double) (stime + vtime)) / runs) + " s+v");
(((double) stime) / runs2) + " each sign, " +
(((double) vtime) / runs2) + " each verify, " +
(((double) (stime + vtime)) / runs2) + " s+v");
}
/******