-
-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EIP-2537 - BLS12-381 precompiles for the EVM #368
Conversation
For @asanso on gas pricing gas costs in ratio of G1 scalarmul original: https://gist.github.com/mratsim/6785a29e72865cfa94e1174fae1e1168 Reproduction git clone https://github.com/mratsim/constantine
cd constantine
git checkout eip2537
CC=clang nimble bench_eip2537_subgroup_checks_impact |
All EIP-2537 precompiles are implemented with benchmarks.
|
x86 worst case. Macbook Pro 13" from 2015 with i5-5257U (dual-core mobile Broadwell without ADCX/ADOX instructions and compiled without assemby.
|
ARM 64-bit worst case, Raspberry Pi 4, without assembly. And also without any add-with-carry intrinsics, meaning cost is 3 times bigger (main addition, comparison, carry addition) than possible. See also compiler woes #357, https://gcc.godbolt.org/z/jdecvffaP.
|
This PR helps providing pricing feedback for EIP-2537 and also implements it.
Detailed benchmark and metering, constant-time and variable-time (for worst-case scenario) is available in: https://github.com/mratsim/constantine/blob/eip2537/metering/eip2537.md
Low-level benchmark
The addition and scalar mul are constant-time when not mentioned vartime hence worst-case scenario.
vs Gnark (variable-time)