Improve ff test
diff --git a/test/test_ff_consistency_WWW.c.in b/test/test_ff_consistency_WWW.c.in
index ee6ab6e..c407d60 100644
--- a/test/test_ff_consistency_WWW.c.in
+++ b/test/test_ff_consistency_WWW.c.in
@@ -47,7 +47,6 @@
int main()
{
-
int i;
char seed[256];
csprng RNG;
@@ -74,8 +73,8 @@
}
/* Testing isunity */
- FF_WWW_one(A, HFLEN_WWW);
- if(!FF_WWW_isunity(A, HFLEN_WWW))
+ FF_WWW_one(E, FFLEN_WWW);
+ if(!FF_WWW_isunity(E, FFLEN_WWW))
{
printf("ERROR comparing or setting to unity\n");
exit(EXIT_FAILURE);
@@ -310,6 +309,7 @@
FF_WWW_random(G, &RNG, HFLEN_WWW);
FF_WWW_random(H, &RNG, HFLEN_WWW);
+ // Test double exponent
FF_WWW_nt_pow(L, A, E, P, HFLEN_WWW, HFLEN_WWW);
FF_WWW_nt_pow(N, B, F, P, HFLEN_WWW, HFLEN_WWW);
FF_WWW_mul(Q, L, N, HFLEN_WWW);
@@ -319,7 +319,16 @@
if(FF_WWW_comp(N, L, HFLEN_WWW))
{
- printf("ERROR testing bpow2");
+ printf("ERROR testing nt_pow_2");
+ exit(EXIT_FAILURE);
+ }
+
+ FF_WWW_zero(N, HFLEN_WWW);
+ FF_WWW_ct_pow_2(N, A, E, B, F, P, HFLEN_WWW, HFLEN_WWW);
+
+ if(FF_WWW_comp(N, L, HFLEN_WWW))
+ {
+ printf("ERROR testing ct_pow_2");
exit(EXIT_FAILURE);
}
@@ -332,17 +341,16 @@
if(FF_WWW_comp(N, L, HFLEN_WWW))
{
- printf("ERROR testing pow3");
+ printf("ERROR testing nt_pow_3");
exit(EXIT_FAILURE);
}
- // Test triple exponent for secret key
FF_WWW_zero(N, HFLEN_WWW);
FF_WWW_ct_pow_3(N, A, E, B, F, C, G, P, HFLEN_WWW, HFLEN_WWW);
if(FF_WWW_comp(N, L, HFLEN_WWW))
{
- printf("ERROR testing pow3");
+ printf("ERROR testing ct_pow_3");
exit(EXIT_FAILURE);
}
@@ -355,7 +363,7 @@
if(FF_WWW_comp(N, L, HFLEN_WWW))
{
- printf("ERROR testing pow4");
+ printf("ERROR testing nt_pow_4");
exit(EXIT_FAILURE);
}