Skip to content
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

Refactor and huge optmization of the ecrecover #327

Merged
merged 4 commits into from
Feb 7, 2024

Conversation

hecmas
Copy link
Contributor

@hecmas hecmas commented Feb 5, 2024

This PR introduces a significant improvement (in the sense of number of steps) of the dblScalarMulSecp256k1 function. In particular, in order to avoid using memory variables that are used to reconstruct the scalars, we use small registers RCX and HASHPOS for this end, which are reset every 32-bit cycle.

  • Importantly, the file sm_main_exec.js of the proverjs needs to be corrected, since the fe2n() function is incorrectly throwing an error when the small registers are larger than 31 bits. Solved in PR 242 of zkevm-proverjs.

EcRecover Refactor: A complete refactor of the ecrecover folder has also been done, along with some major optimizations to the double scalar multiplication needed for the public key recovery. See the PR for more details.

@krlosMata krlosMata force-pushed the feature/ecrecover-ref-optz branch from 1128440 to 2ec5cfa Compare February 5, 2024 21:45
Copy link

sonarqubecloud bot commented Feb 7, 2024

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link
Contributor

@krlosMata krlosMata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😸

@krlosMata krlosMata merged commit c13a973 into develop-feijoa Feb 7, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants