From f4a2d2e3be8f46b274a1353815994233bab58c1e Mon Sep 17 00:00:00 2001 From: MITSUNARI Shigeo Date: Sun, 8 Sep 2019 15:04:44 +0900 Subject: [PATCH] add test for Ec::add, dbl --- test/ec_test.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/test/ec_test.cpp b/test/ec_test.cpp index 3f1e8d4..0b12c30 100644 --- a/test/ec_test.cpp +++ b/test/ec_test.cpp @@ -215,7 +215,7 @@ struct Test { R += P; } } - void add() const + void aliasAddDbl() const { Fp x(para.gx); Fp y(para.gy); @@ -231,15 +231,20 @@ struct Test { for (int j = 0; j < 2; j++) { Ec R1, R2, R3, R4; R1 = Ptbl[i]; - R2 = Qtbl[i]; + R2 = Qtbl[j]; Ec::add(R3, R1, R2); Ec::add(R1, R1, R2); CYBOZU_TEST_EQUAL(R1, R3); R1 = Ptbl[i]; - R2 = Qtbl[i]; + R2 = Qtbl[j]; Ec::add(R2, R1, R2); CYBOZU_TEST_EQUAL(R2, R3); } + Ec R1, R2; + R1 = Ptbl[i]; + Ec::dbl(R2, R1); + Ec::dbl(R1, R1); + CYBOZU_TEST_EQUAL(R1, R2); } } @@ -513,7 +518,7 @@ mul 499.00usec cstr(); ope(); mul(); - add(); + aliasAddDbl(); neg_mul(); mul_fp(); squareRoot();