add doc for WASM

dev
MITSUNARI Shigeo 7 years ago
parent 2146aa1de7
commit 8c3a117c54
  1. 12
      readme.md

@ -92,6 +92,16 @@ cd build
cmake .. -A x64
msbuild mcl.sln /p:Configuration=Release /m
```
## Build for WASM(WebAssembly) (experimental)
mcl supports emcc (Emscripten) and `test/bn_test.cpp` runs on browers such as Firefox and Chrome.
Type
```
emcc -O3 -I ./include/ -I ../cybozulib/include/ src/fp.cpp test/bn_test.cpp -DNDEBUG -s WASM=1 -o t.html
emrun --no_browser --port 8080 --no_emrun_detect .
```
and open `http://<address>:8080/t.html`.
The timing of a pairing on `CurveFp254BNb` is 2.8msec on 64-bit Firefox with Skylake 3.4GHz.
### SELinux
mcl uses Xbyak JIT engine if it is available on x64 architecture,
otherwise mcl uses a little slower functions generated by LLVM.
@ -234,7 +244,7 @@ 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)
# 384-bit curve
see `test/bn384_test.cpp`
Benchmark on Skylake(3.4GHz)

Loading…
Cancel
Save