aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <herumi@nifty.com>2019-07-26 10:43:05 +0800
committerMITSUNARI Shigeo <herumi@nifty.com>2019-07-26 10:43:05 +0800
commit4c376d551ea3c66de37265fb3699b79247248961 (patch)
treedf8a1b0fef95061e2bd1ae7c0fbb1fed74e700b5
parent96e6d628ec81d8b2d7c253f7ee2d5f90577a97ab (diff)
downloadtangerine-mcl-4c376d551ea3c66de37265fb3699b79247248961.tar.gz
tangerine-mcl-4c376d551ea3c66de37265fb3699b79247248961.tar.zst
tangerine-mcl-4c376d551ea3c66de37265fb3699b79247248961.zip
test of GT::powv0.96
-rw-r--r--test/glv_test.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/glv_test.cpp b/test/glv_test.cpp
index 61f2062..e1d4941 100644
--- a/test/glv_test.cpp
+++ b/test/glv_test.cpp
@@ -191,6 +191,25 @@ void testGLV2()
CYBOZU_BENCH_C("G2::glv", 1000, Q1 = Q0; s.setRand(rg); glv2.mul, Q2, Q1, s.getMpz());
}
+void testGT()
+{
+ G1 P;
+ G2 Q;
+ GT x, y, z;
+ hashAndMapToG1(P, "abc", 3);
+ hashAndMapToG2(Q, "abc", 3);
+ pairing(x, P, Q);
+ int n = 200;
+ y = x;
+ for (int i = 0; i < n; i++) {
+ y *= y;
+ }
+ mpz_class t = 1;
+ t <<= n;
+ GT::pow(z, x, t);
+ CYBOZU_TEST_EQUAL(y, z);
+}
+
CYBOZU_TEST_AUTO(glv)
{
const mcl::CurveParam tbl[] = {
@@ -204,5 +223,6 @@ CYBOZU_TEST_AUTO(glv)
initPairing(cp);
testGLV1();
testGLV2();
+ testGT();
}
}