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

Explicitly taking into account a + (-a) for add_assign #780

Merged
merged 2 commits into from
Feb 16, 2024

Conversation

tcoratger
Copy link
Contributor

At the moment, in the add_assign function for Projective structure, in case of a + (-a) operation, all coefficients are calculated as in the case of a classic addition a + b with a and b different (Cost: 11M + 5S + 9add + 4*2).

However, this scenario can be simplified, by taking it into account explicitly in the logic to avoid doing all the unnecessary calculations.

Indeed, we know that if u1 == u2 && s1 != s2 then it is a + (-a) and therefore we can return the point at infinity directly (zero) without any further calculation necessary.

@tcoratger tcoratger requested review from a team as code owners February 15, 2024 13:30
@tcoratger tcoratger requested review from z-tech, mmagician and weikengchen and removed request for a team February 15, 2024 13:30
@Pratyush Pratyush added this pull request to the merge queue Feb 16, 2024
Merged via the queue into arkworks-rs:master with commit 3a61567 Feb 16, 2024
37 checks passed
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.

2 participants