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

feat: add_inplace should be implemented in the curve_g1 package ( PROOF-663 ) #21

Merged
merged 4 commits into from
Sep 25, 2023

Conversation

jacobtrombetta
Copy link
Contributor

@jacobtrombetta jacobtrombetta commented Sep 22, 2023

Rationale for this change

In order to perform MSM with elements on the G1 curve, the element concept in sxt/base/curve/element requires an add_inplace function be implemented. The add_inplace implementation is similar to the add function with different parameters and two less temporary variables.

What changes are included in this PR?

  • The add_inplace is added to the add component in the curve_g1/operations package.
  • The add function is refactored to use the add_inplace implementation internally.

Are these changes tested?

Yes

// add_inplace
//--------------------------------------------------------------------------------------------------
/*
p = p + q (q value is preserved but not const to satisfy concept requirements)
Copy link
Collaborator

Choose a reason for hiding this comment

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

(q value is preserved but not const to satisfy concept requirements)

Why can't it be const and satisfy the concept?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was just my knowledge gap. I wasn't sure how to verify if it could be const without updating the cbindings to do MSM with curve_g1 elements.

I've updated it to const.

@jacobtrombetta jacobtrombetta merged commit d1e8fad into main Sep 25, 2023
5 checks passed
@jacobtrombetta jacobtrombetta deleted the feat/addition-inplace-for-curve_g1-PROOF-663 branch September 25, 2023 17:56
@SxT-Release
Copy link

🎉 This PR is included in version 0.3.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

None yet

3 participants