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

fix: fix scalar mul in stdlib/ec #5279

Closed
wants to merge 3 commits into from
Closed

fix: fix scalar mul in stdlib/ec #5279

wants to merge 3 commits into from

Conversation

guipublic
Copy link
Contributor

Description

Problem*

Resolves #5259

Summary*

refactor the square and multiply

Additional Context

Documentation*

Check one:

  • No documentation needed.
  • Documentation included in this PR.
  • [For Experimental Features] Documentation to be submitted in a separate PR.

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

@TomAFrench
Copy link
Member

We have this same code repeated in the other ec submodules so we should make those changes there as well.

@guipublic
Copy link
Contributor Author

I fixed the code also in tecurve.rs, I did not find another instance.

Copy link
Contributor

Changes to circuit sizes

Generated at commit: 18c1d3f31a324e87d526d0156050a83ed24fe091, compared to commit: e1000176a31140b2abd79c47653cbc4bb1a6808a

🧾 Summary (10% most significant diffs)

Program ACIR opcodes (+/-) % Circuit size (+/-) %
eddsa +2,980 ❌ +4.23% +2,980 ❌ +4.15%
bench_eddsa_poseidon +745 ❌ +4.16% +745 ❌ +3.59%

Full diff report 👇
Program ACIR opcodes (+/-) % Circuit size (+/-) %
eddsa 73,439 (+2,980) +4.23% 74,812 (+2,980) +4.15%
bench_eddsa_poseidon 18,667 (+745) +4.16% 21,509 (+745) +3.59%

@TomAFrench
Copy link
Member

I think we can leave this until Zac's improved implemention is ready. This also causes a performance degradation it seems.

@TomAFrench TomAFrench closed this Jul 11, 2024
@Savio-Sou
Copy link
Collaborator

Zac's improved implemention

Is that on a branch / PR?

@TomAFrench
Copy link
Member

That's in his separate repository that he's been posting in slack.

@Savio-Sou
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

scalar multiplication should account for zeros from MSB end
3 participants