This package should only be used if newer versions of bls12-381 conflict with this version. This package should be considered as legacy and should never be used.
Published: 17 Dec 2021
OCaml implementation of BLS12-381
See below how to use in your project.
dune runtest dune build @test/js/browser/serve # Check _build/default/test/js/browser and run `npm run serve`
To get the coverage (only ok for bls12-381-unix and bls12-381-gen)
dune runtest --instrument-with bisect_ppx --force bisect-ppx-report html
How to use in my project
If you are developing a library using
bls12-381, you only need to add
bls12-381 in the dependency list. However, if you are writing a binary, three packages are relevant:
bls12-381-unix: to be used for UNIX
test/js/browser/for an example. You need to use the appropriate package depending on the platform you target (Node or a bundler for the browser). For instance, if you target Node (resp. a bundler like webpack for a browser usage), you must use
bls12-381-js-gen: if the module is loaded somewhere else than in the global namespace like the previous package supposes, you can use this third library that provides functors. The functors are expecting a module of the signature:
sig val rust_module : unit -> Jsoo_lib.ESModule.t val get_wasm_memory_buffer : unit -> Jsoo_lib.Memory.Buffer.t end
For more examples, see the test directories.
Run the benchmarks
opam install core_bench dune exec benchmark/bench_ec.exe dune exec benchmark/bench_ff.exe dune exec benchmark/bench_pairing.exe
opam install odoc dune build @doc