-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
feat(bench): PoC of integration with zkalc #425
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PR is finalized. I won't add the mul_GT exp_GT and multiexp_GT yet as:
UsageRequires nim v2.0.8 and Clang. Building
Running examples, if curve is unspecified it runs BN254 and file output is
Curves currently supported are
OutputFr and G1 G2 and pairings Whole text
json {"add_ff":{"range":[1],"results":[1.0],"stddev":[0.0]},"mul_ff":{"range":[1],"results":[14.0],"stddev":[0.0]},"invert":{"range":[1],"results":[761.3640000000001],"stddev":[2.221119254223629]},"ip_ff":{"range":[2],"results":[17.978],"stddev":[0.1468302361112071]},"fft":{"range":[],"results":[],"stddev":[]},"add_G1":{"range":[1],"results":[94.53199999999991],"stddev":[0.5527993979272262]},"mul_G1":{"range":[1],"results":[26850.41000000001],"stddev":[86.65168740341818]},"msm_G1":{"range":[2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536,131072,262144,524288,1048576,2097152],"results":[44910.58600000001,43585.76199999998,51472.56200000001,62400.23153692614,86233.85458167328,128594.6719681908,211492.5436507938,368969.6706114396,579930.2450199202,940740.7601476017,1525638.799628944,2559386.734597154,4421043.353901998,8458720.5060449,15965900.63398693,28482414.58479532,50760725.78947367,95680066.83333333,185600865.576923,360588126.8461539,713092947.0],"stddev":[887.0271794246637,276.9817668264606,549.3243601564757,449.5514678915364,499.6471976551839,596.3731098940373,2390.240447673251,5847.154740662249,4405.894348676709,12383.13910067745,27909.37999982535,48203.61076122781,75430.42635452512,232201.5774550728,817882.6957315446,1598699.54483082,1345263.885652233,1353439.608259127,1716016.148141342,1188959.211887081,581084.7686257195]},"is_in_sub_G1":{"range":[1],"results":[0.0],"stddev":[0.0]},"hash_G1":{"range":[1],"results":[17012.10800000001],"stddev":[57.10332666168426]},"add_G2":{"range":[1],"results":[232.8740000000001],"stddev":[2.968458774345699]},"mul_G2":{"range":[1],"results":[50753.23952095804],"stddev":[202.8829182434307]},"msm_G2":{"range":[2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536,131072,262144,524288,1048576,2097152],"results":[58741.80677290835,66554.52399999993,93729.45219123513,113913.102,178820.117063492,297415.8849902534,550699.9980732185,998534.7221206586,1611399.599236641,2717067.295302014,4418497.376599634,8657366.819819819,11804418.52415459,22256225.56018518,40017277.94262295,71552628.61428569,133370804.2941176,251890430.2105263,498880965.7777778,974725249.6,1929669910.0],"stddev":[696.1802888080764,771.7982135174744,603.7003466026882,1716.632938308528,1363.800684245473,5604.649784897922,25820.10754155615,26624.50358125539,47964.9816976701,100746.5209993159,158918.1137742022,424028.0461159708,320727.7412293794,944649.8402733286,2855466.92962508,3994160.162350956,3280845.204295911,2918838.609642661,954034.4469252342,2288634.168998681,3284550.59659126]},"is_in_sub_G2":{"range":[1],"results":[64978.06786427147],"stddev":[1123.100064724973]},"hash_G2":{"range":[1],"results":[61111.70600000001],"stddev":[1453.380319210541]},"mul_Gt":{"range":[],"results":[],"stddev":[]},"multiexp_Gt":{"range":[],"results":[],"stddev":[]},"pairing":{"range":[1],"results":[301013.0199600802],"stddev":[5116.641067302012]},"multipairing":{"range":[2,4,8,16,32,64,128,256,512,1024],"results":[393943.6764132551,578233.2568627453,950773.092555332,1694425.947935367,3174140.85915493,6141135.969656986,12109777.24739584,23893775.60101011,47556249.37373736,94763650.36734694],"stddev":[5764.176315676999,7396.070709490642,16358.28938354904,30757.00252728,40519.90862940051,130609.6644831436,196746.4353761875,299893.8500157776,423738.3472848108,671637.7269323865]}} |
mratsim
added a commit
that referenced
this pull request
Jul 15, 2024
mratsim
added a commit
that referenced
this pull request
Jul 15, 2024
* feat(𝔾ₜ constant-time exponentiation): generalize ec_endomorphism_accel to elliptic curve and 𝔾ₜ * feat(𝔾ₜ constant-time exponentiation): implement constant-time 𝔾ₜ exponentiation * feat(gt-exp): public API + zkalc bench #425
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR provides integration with zkalc from @mmaker:
The strategy adopted is to compile a binary that then can be called with curve parameter and vartime or not. It will then output the benchmarks in console and directly in zkalc json format to avoid implementing a parser in zkalc repo.
Current bench Output
with the initial commit POC
Statistics
We target a sampling time of 5s per benchmark.
Subroutines that take less than 10ms are collated into batches of about ~10ms
to amortize getClock/syscall/vDSO noise, see https://gms.tf/on-the-costs-of-syscalls.html
TODO
cyclotomic_exp
)