A tentative specification for extension of modular arithmetic support to bitwidths beyond 256-bits in the EVM is outlined in https://notes.ethereum.org/@poemm/eip_draft_evm_modular_arithmetic_extensions .
A Go-ethereum implementation has been created for the purposes of measuring the performance of a portable (non-assembly) implementation of the arithmetic as well as the overhead of the client "boilerplate" code.
Benchmarks were measured on an i5-6600K processor (3.5 GHz). 10 ns / gas was chosen as a (conservative) target gas rate. Benchmarks are presented alongside pricing models proposed in the EIP draft.
For more context, client benchmarks of a Go-assembly implementation of the arithmetic for 384-bit values are also shown.
Note that benchmarks aim to show the worst-case performance (final subtraction performed for MULMONT
, slowest paths for ADDMONT
/SUBMONT
). Performance of MULMONT
at larger bitwidths is omitted because 1) the implementation is currently unnacceptably slow after 9 limbs (576 bits) and 2) the performance can vary considerably based on values that are chosen (widths above 576 bits implement generic montgomery multiplication using the Go standard library's big.Int
which does allocations under the hood)
Benchmarks for the Miller Loop and Final Exponentation are from test cases provided by EVMcurves.
For the raw benchmark data, traces and scripts to produce the graphs, see https://github.com/jwasinger/plots/tree/master/mont-arith-bench
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