aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <herumi@nifty.com>2017-03-11 14:05:43 +0800
committerMITSUNARI Shigeo <herumi@nifty.com>2017-03-11 14:05:43 +0800
commit702e3e685a7823b197e6612c01cf4f75b34c5ea7 (patch)
tree65835276b7b1416e62f32f6907aa191238209a71
parentee2f24c79f9b818bfdfd00ef1b7d898d477f7ca3 (diff)
downloadtangerine-mcl-702e3e685a7823b197e6612c01cf4f75b34c5ea7.tar.gz
tangerine-mcl-702e3e685a7823b197e6612c01cf4f75b34c5ea7.tar.zst
tangerine-mcl-702e3e685a7823b197e6612c01cf4f75b34c5ea7.zip
benchmark of 382-bit pairing
-rw-r--r--readme.md20
-rw-r--r--test/bn384_test.cpp13
2 files changed, 27 insertions, 6 deletions
diff --git a/readme.md b/readme.md
index a0216d9..8c58a53 100644
--- a/readme.md
+++ b/readme.md
@@ -135,7 +135,7 @@ If you check it out of the library, then you can stop the verification by callin
# Benchmark
-A benchmark of a BN curve CurveFp254BNb.
+A benchmark of a BN curve CurveFp254BNb(2016/12/25).
* x64, x86 ; Inte Core i7-6700 3.4GHz(Skylake) upto 4GHz on Ubuntu 16.04.
* `sudo cpufreq-set -g performance`
@@ -155,6 +155,24 @@ mcl | 0.31 | 1.6 |22.6| 4.
```
cmake -DARITH=x64-asm-254 -DFP_PRIME=254 -DFPX_METHD="INTEG;INTEG;LAZYR" -DPP_METHD="LAZYR;OATEP"
```
+# 384-bit curve (experimental)
+see `test/bn384_test.cpp`
+Benchmark on Skylake(3.4GHz)
+
+```
+# mcl::bn::CurveFp382_1 ; -(2^94 + 2^76 + 2^72 + 1)
+pairing 3.534Mclk ; 1.039msec
+finalExp 1.478Mclk
+
+# mcl::bn::CurveFp382_2 ; -(2^94 + 2^78 + 2^67 + 2^64 + 2^48 + 1)
+pairing 3.635Mclk ; 1.069msec
+finalExp 1.536Mclk
+```
+```
+# 2017/3/11
+replic with cmake -DFP_PRIME=382 -DFPX_METHD="INTEG;INTEG;LAZYR" -DPP_METHD="LAZYR;OATEP"
+BENCH: pp_map_oatep_k12 = 2654673 nanosec
+```
# How to make asm files (optional)
The asm files generated by this way are already put in `src/asm`, then it is not necessary to do this.
diff --git a/test/bn384_test.cpp b/test/bn384_test.cpp
index 9d0532c..480355d 100644
--- a/test/bn384_test.cpp
+++ b/test/bn384_test.cpp
@@ -12,18 +12,15 @@ typedef BN::G1 G1;
typedef BN::G2 G2;
typedef BN::Fp12 GT;
-CYBOZU_TEST_AUTO(pairing)
+void testCurve(const mcl::bn::CurveParam& cp)
{
- BN::init(mcl::bn::CurveFp382_1);
+ BN::init(cp);
G1 P;
G2 Q;
BN::mapToG1(P, 1);
BN::mapToG2(Q, 1);
- std::cout << P << std::endl;
- std::cout << Q << std::endl;
GT e1, e2;
BN::pairing(e1, P, Q);
- std::cout << e1 << std::endl;
mpz_class a("293842098420840298420842342342449");
mpz_class b("2035739487659287420847209482048");
G1 aP;
@@ -37,3 +34,9 @@ CYBOZU_TEST_AUTO(pairing)
CYBOZU_BENCH("pairing", BN::pairing, e1, P, Q);
CYBOZU_BENCH("finalExp", BN::finalExp, e1, e1);
}
+
+CYBOZU_TEST_AUTO(pairing)
+{
+ testCurve(mcl::bn::CurveFp382_1);
+ testCurve(mcl::bn::CurveFp382_2);
+}