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

Optimizations to ecrecover #348

Merged
merged 5 commits into from
Apr 3, 2024
Merged

Optimizations to ecrecover #348

merged 5 commits into from
Apr 3, 2024

Conversation

hecmas
Copy link
Contributor

@hecmas hecmas commented Feb 20, 2024

This PR introduces:

  • Changes the usage of ARITH to ARITH_MOD to avoid post alias checks in the former.
  • Since now functions over the base/scalar field of the curve are 3 lines large, most of them have been deleted and introduced directly in ecrecover to avoid unnecessary steps in CALL/RETURNs.
  • Some minor fixes/optimizations found along the way have been applied.

@hecmas hecmas self-assigned this Feb 20, 2024
@cla-bot cla-bot bot added the cla-signed label Feb 20, 2024
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues

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

See analysis details on SonarCloud

@hecmas hecmas changed the title Modular arithmetic to the ROM Modular arithmetic to ecrecover Feb 20, 2024
@hecmas hecmas marked this pull request as ready for review February 20, 2024 08:11
@krlosMata krlosMata changed the base branch from develop-feijoa to main March 22, 2024 15:55
@krlosMata krlosMata changed the base branch from main to develop-feijoa March 22, 2024 15:55
@hecmas hecmas force-pushed the feature/arith-mod branch from 614e858 to 48b115a Compare March 22, 2024 16:02
@hecmas hecmas added this to the fork-feijoa milestone Mar 22, 2024
@hecmas hecmas changed the base branch from develop-feijoa to develop March 23, 2024 11:04
@hecmas hecmas changed the base branch from develop to develop-feijoa March 23, 2024 11:04
@hecmas hecmas force-pushed the feature/arith-mod branch from 48b115a to 10c2a34 Compare March 23, 2024 11:09
Copy link
Contributor

@zkronos73 zkronos73 left a comment

Choose a reason for hiding this comment

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

some optimizations, not bugs.
changes of utils.zkasm no sense inside this PR, perhaps need to do a rebase?

main/ecrecover/FNSECP256K1/mulFnSecp256k1.zkasm Outdated Show resolved Hide resolved
main/ecrecover/FPSECP256K1/addFpSecp256k1.zkasm Outdated Show resolved Hide resolved
main/ecrecover/FPSECP256K1/mulFpSecp256k1.zkasm Outdated Show resolved Hide resolved
main/ecrecover/FPSECP256K1/checkSqrtFpSecp256k1.zkasm Outdated Show resolved Hide resolved
main/ecrecover/FPSECP256K1/squareFpSecp256k1.zkasm Outdated Show resolved Hide resolved
@hecmas hecmas force-pushed the feature/arith-mod branch from fe345b2 to dcd7ec6 Compare March 25, 2024 09:27
@hecmas hecmas requested a review from zkronos73 March 25, 2024 09:28
@hecmas hecmas force-pushed the feature/arith-mod branch from dcd7ec6 to 8903d97 Compare March 25, 2024 16:27
@hecmas hecmas changed the title Modular arithmetic to ecrecover Optimizations to ecrecover Mar 27, 2024
Copy link

sonarqubecloud bot commented Apr 2, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

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 dcbd682 into develop-feijoa Apr 3, 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.

3 participants