update benchmark and parameter of readme.md

dev
MITSUNARI Shigeo 7 years ago
parent 857dff958b
commit ddd68bd459
  1. 1
      ffi/js/exported-mcl.txt
  2. 30
      readme.md

@ -1 +0,0 @@
'_mclBn_setErrFile' ,'_mclBn_init' ,'_mclBn_getOpUnitSize' ,'_mclBn_getCurveOrder' ,'_mclBn_getFieldOrder' ,'_mclBnFr_clear' ,'_mclBnFr_setInt' ,'_mclBnFr_setStr' ,'_mclBnFr_deserialize' ,'_mclBnFr_setLittleEndian' ,'_mclBnFr_isValid' ,'_mclBnFr_isEqual' ,'_mclBnFr_isZero' ,'_mclBnFr_isOne' ,'_mclBnFr_setByCSPRNG' ,'_mclBnFr_setHashOf' ,'_mclBnFr_getStr' ,'_mclBnFr_serialize' ,'_mclBnFr_neg' ,'_mclBnFr_inv' ,'_mclBnFr_add' ,'_mclBnFr_sub' ,'_mclBnFr_mul' ,'_mclBnFr_div' ,'_mclBnG1_clear' ,'_mclBnG1_setStr' ,'_mclBnG1_deserialize' ,'_mclBnG1_isValid' ,'_mclBnG1_isEqual' ,'_mclBnG1_isZero' ,'_mclBnG1_hashAndMapTo' ,'_mclBnG1_getStr' ,'_mclBnG1_serialize' ,'_mclBnG1_neg' ,'_mclBnG1_dbl' ,'_mclBnG1_add' ,'_mclBnG1_sub' ,'_mclBnG1_mul' ,'_mclBnG1_mulCT' ,'_mclBnG2_clear' ,'_mclBnG2_setStr' ,'_mclBnG2_deserialize' ,'_mclBnG2_isValid' ,'_mclBnG2_isEqual' ,'_mclBnG2_isZero' ,'_mclBnG2_hashAndMapTo' ,'_mclBnG2_getStr' ,'_mclBnG2_serialize' ,'_mclBnG2_neg' ,'_mclBnG2_dbl' ,'_mclBnG2_add' ,'_mclBnG2_sub' ,'_mclBnG2_mul' ,'_mclBnG2_mulCT' ,'_mclBnGT_clear' ,'_mclBnGT_setInt' ,'_mclBnGT_setStr' ,'_mclBnGT_deserialize' ,'_mclBnGT_isEqual' ,'_mclBnGT_isZero' ,'_mclBnGT_isOne' ,'_mclBnGT_getStr' ,'_mclBnGT_serialize' ,'_mclBnGT_neg' ,'_mclBnGT_inv' ,'_mclBnGT_add' ,'_mclBnGT_sub' ,'_mclBnGT_mul' ,'_mclBnGT_div' ,'_mclBnGT_powGeneric' ,'_mclBnGT_pow' ,'_mclBn_pairing' ,'_mclBn_finalExp' ,'_mclBn_millerLoop' ,'_mclBn_getUint64NumToPrecompute' ,'_mclBn_precomputeG2' ,'_mclBn_precomputedMillerLoop' ,'_mclBn_precomputedMillerLoop2' ,'_mclBn_FrLagrangeInterpolation' ,'_mclBn_G1LagrangeInterpolation' ,'_mclBn_G2LagrangeInterpolation' ,'_mclBn_FrEvaluatePolynomial' ,'_mclBn_G1EvaluatePolynomial' ,'_mclBn_G2EvaluatePolynomial'

@ -18,6 +18,15 @@ The current version supports the optimal Ate pairing over BN curves.
* (maybe any platform to be supported by LLVM)
* WebAssembly
# Support curves
p(z) = 36z^4 + 36z^3 + 24z^2 + 6z + 1.
* CurveFp254BNb ; a BN curve over the 254-bit prime p(z) where z = -(2^62 + 2^55 + 1).
* CurveSNARK1 ; a BN curve over a 254-bit prime p such that n := p + 1 - t has high 2-adicity.
* CurveFp381 ; a BN curve over the 381-bit prime p(z) where z = -(2^94 + 2^76 + 2^72 + 1).
* CurveFp462 ; a BN curve over the 462-bit prime p(z) where z = 2^114 + 2^101 - 2^14 - 1.
# Installation Requirements
* [GMP](https://gmplib.org/) and OpenSSL
@ -156,8 +165,10 @@ mcl::bn256::G2 Q(...);
mcl::bn256::Fp12 e;
mcl::bn256::BN::pairing(e, P, Q);
```
1. (CurveFp254BNb) a BN curve over the 254-bit prime p = 36z^4 + 36z^3 + 24z^2 + 6z + 1 where z = -(2^62 + 2^55 + 1).
1. (CurveFp254BNb) a BN curve over the 254-bit prime p = p(z) where z = -(2^62 + 2^55 + 1).
2. (CurveSNARK1) a BN curve over a 254-bit prime p such that n := p + 1 - t has high 2-adicity.
3. CurveFp381 with `mcl/bn384.hpp`.
4. CurveFp462 with `mcl/bn512.hpp`.
See [test/bn_test.cpp](https://github.com/herumi/mcl/blob/master/test/bn_test.cpp).
@ -256,17 +267,16 @@ mcl | 0.31 | 1.6 |22.6| 3.
```
cmake -DARITH=x64-asm-254 -DFP_PRIME=254 -DFPX_METHD="INTEG;INTEG;LAZYR" -DPP_METHD="LAZYR;OATEP"
```
# 384-bit curve
see `test/bn384_test.cpp`
Benchmark on Skylake(3.4GHz)
# Higher-bit BN curve benchmark by mcl
see `test/bn384_test.cpp` and `test/bn512_test.cpp`.
```
# mcl::bn::CurveFp382_1 ; -(2^94 + 2^76 + 2^72 + 1)
pairing 3.163Mclk ; 0.93msec
## Benchmark on Kaby Lake Core i7-7700(3.6GHz)
# mcl::bn::CurveFp382_2 ; -(2^94 + 2^78 + 2^67 + 2^64 + 2^48 + 1)
pairing 3.261Mclk ; 0.96msec
```
paramter | x64(msec)|
----------------|------------|
CurveFpBN254BNb | 0.34|
CurveFp382_1 | 0.95|
CurveFp461 | 2.16|
# 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.

Loading…
Cancel
Save