aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <herumi@nifty.com>2018-10-23 08:43:37 +0800
committerMITSUNARI Shigeo <herumi@nifty.com>2018-10-23 08:43:37 +0800
commit151f876c92eaa7705f1203791a16cc517bd2d940 (patch)
tree516df091a08a17674cf6aff30e86287de8c8b66e
parentd06ac494def41d2d81fda591e815825a8798b979 (diff)
downloadtangerine-mcl-151f876c92eaa7705f1203791a16cc517bd2d940.tar.gz
tangerine-mcl-151f876c92eaa7705f1203791a16cc517bd2d940.tar.zst
tangerine-mcl-151f876c92eaa7705f1203791a16cc517bd2d940.zip
update doc for library
-rw-r--r--readme.md31
1 files changed, 28 insertions, 3 deletions
diff --git a/readme.md b/readme.md
index 96f0d55..f5d834a 100644
--- a/readme.md
+++ b/readme.md
@@ -191,12 +191,37 @@ finalExp 546.259Kclk
# Libraries
+* G1 and G2 is defined over Fp
+* The order of G1 and G2 is r.
+* Use `bn256.hpp` if only BN254 is used.
+
+## C++ library
+
* libmcl.a ; static C++ library of mcl
* libmcl\_dy.so ; shared C++ library of mcl
-* libbn256.a ; static C library for `mcl/bn256f.h`
-* libbn256\_dy.so ; shared C library
+* the default parameter of curveType is BN254
+
+header |support curveType |sizeof Fr|sizeof Fp|
+--------------|-------------------------|---------|---------|
+bn256.hpp |BN254 | 32 | 32 |
+bls12_381.hpp |BLS12_381, BN254 | 32 | 48 |
+bn384.hpp |BN381_1, BLS12_381, BN254| 48 | 48 |
+
+## C library
+
+* Define `MCLBN_FR_UNIT_SIZE` and `MCLBN_FP_UNIT_SIZE` and include bn.h
+* set `MCLBN_FR_UNIT_SIZE = MCLBN_FP_UNIT_SIZE` unless `MCLBN_FR_UNIT_SIZE` is defined
+
+library |MCLBN_FR_UNIT_SIZE|MCLBN_FP_UNIT_SIZE|
+------------------|------------------|------------------|
+libmclbn256.a | 4 | 4 |
+libmclbn384_256.a | 4 | 6 |
+libmclbn384.a | 6 | 6 |
+
+* libmclbn*.a ; static C library
+* libmclbn*\_dy.so ; shared C library
-If you want to remove '_dy` of so files, then `makeSHARE_BASENAME\_SUF=`.
+If you want to remove `_dy` of so files, then `makeSHARE_BASENAME\_SUF=`.
# How to initialize pairing library
Call `mcl::bn256::initPairing` before calling any operations.