or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Syncing
xxxxxxxxxx
Benchmarking pairing-friendly elliptic curves libraries
last benchmark update: 29/01/21
There are several pairing-friendly elliptic curves libraries used in zero-knowledge proofs (ZKP) projects. Typically, the most important elliptic curve operations in ZKP schemes are "multi scalar multiplication" (MSM) and "pairing product" (PP). This writeup is a try to benchmark and compare the building blocks of these operations in two different architechtures.
In fact, since MSM and PP are size-dependant, we focus on timings of mixed addition in G1/G2, doubling in G1/G2, Miller loop and Final exponentiation.
The libraries are written in different languages with different software and mathematical optimizations, and with more or less assembly code.
The target curves are:
BN254
,BLS12-381
,BLS12-377
andBW6-761
.The chosen libraries are:
BN254, BLS12-381, BLS12-377, BW6-761
BN254, BLS12-381, BLS12-377, BW6-761
BLS12-381
)BN254, BLS12-381
(fromerly zexe)
BN254, BLS12-381, BLS12-377, BW6-761
BLS12-377, BW6-761
)(based on arkworks)
BW6-761
BW6-761
)BLS12-381
BN254, BLS12-381
BN254
), DFINITY (BLS12-381
)BLS12-381
BLS12-381
(develop branch)
BN254, BLS12-381
(based on libff)
BLS12-377, BW6-761
BN254, BLS12-381, BLS12-377
* assembly is disabled by default in
arkworks-rs
. To enable asm in benchmarks, e.g.:RUSTFLAGS="-C target -feature=+bmi2,+adx" cargo +nightly bench bls12_381::full_pairing --features asm
.** assembly is disabled by default in
celo-org/zexe
. To enable asm in benchmark onBW6-761
curve:RUSTFLAGS="-C target-feature=+bmi2,+adx" cargo +nightly bench pairing --features "force_bw6_asm bw6_761"
BN254
benchmark on AWS z1d.3xlarge (3.4 GHz Intel Xeon)
Pairing
G1 mixed addition/doubling
G2 mixed addition/doubling
benchmark on AWS c5a.2xlarge (2.7 GHz AMD EPYC 7R32)
Pairing
G1 mixed addition/doubling
G2 mixed addition/doubling
BLS12-381
benchmark on AWS z1d.3xlarge (3.4 GHz Intel Xeon)
Pairing
G1 mixed addition/doubling
G2 mixed addition/doubling
benchmark on AWS c5a.2xlarge (2.7 GHz AMD EPYC 7R32)
Pairing
G1 mixed addition/doubling
G2 mixed addition/doubling
BLS12-377
benchmark on AWS z1d.3xlarge (3.4 GHz Intel Xeon)
Pairing
G1 mixed addition/doubling
G2 mixed addition/doubling
benchmark on AWS c5a.2xlarge (2.7 GHz AMD EPYC 7R32)
Pairing
G1 mixed addition/doubling
G2 mixed addition/doubling
BW6-761
benchmark on AWS z1d.3xlarge (3.4 GHz Intel Xeon)
Pairing
G1/G2 mixed addition/doubling
benchmark on AWS c5a.2xlarge (2.7 GHz AMD EPYC 7R32)
Pairing
G1/G2 mixed addition/doubling
Conclusion
The libraries are implemented in different languages and some use more assembly code than others. Besides the different algorithmic and software optimizations used across, it should be noted also that some libraries target constant-time implementation for some operations making it de facto slower. However, it can be clear that consensys/gnark-crypto is one of the fastest pairing-friendly elliptic curve libraries to be used in zkp projects with different curves.
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →I'm part of a research team at ConsenSys. If you are interested in our work (fast finite field arithmetic, elliptic curve pairings, and zero-knowledge proofs), give us a shout.