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

Remove ATE_LOOP_COUNT_IS_NEGATIVE from BN curve parameter trait #285

Merged
merged 7 commits into from
Jun 5, 2021

Conversation

weikengchen
Copy link
Member

@weikengchen weikengchen commented May 26, 2021

Description

In #275, Daira pointed out that the current BN parameter trait, which requires X_IS_NEGATIVE and ATE_LOOP_COUNT_IS_NEGATIVE, can be improved.

Because for BN curves, the ate loop count is 6x+2, so ATE_LOOP_COUNT_IS_NEGATIVE == X_IS_NEGATIVE always hold.

Therefore, we may want to keep only one of them. It seems easier to remove ATE_LOOP_COUNT_IS_NEGATIVE. This PR makes this change.

To avoid breaking, this PR does not delete ATE_LOOP_COUNT_IS_NEGATIVE but adds a default implementation:

const ATE_LOOP_COUNT_IS_NEGATIVE: bool = Self::X_IS_NEGATIVE;

This is to avoid breaking ark-curves. Any thoughts? Should we remove it directly and add a pending PR for ark-curves? I will wait for people's opinions on this and then decide what changelog entry to add ("improvement" or "breaking").


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (master)
  • Linked to Github issue with discussion and accepted design OR have an explanation in the PR that describes this work.
  • Updated relevant documentation in the code
  • Added a relevant changelog entry to the Pending section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

N/A:

  • Wrote unit tests

@Pratyush
Copy link
Member

Let's remove it; I doubt anybody except ark-curves (and maybe ark-r1cs-std) is relying on this.

@weikengchen weikengchen changed the title Simplify the BN parameters trait Remove ATE_LOOP_COUNT_IS_NEGATIVE from BN curve parameter trait May 26, 2021
@weikengchen
Copy link
Member Author

This PR is better merged right before the next release because merging this PR would cause all tests against curves to be "canceled" and may affect development.

Added the merge-in-next-release label.

Copy link
Contributor

@daira daira left a comment

Choose a reason for hiding this comment

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

Untested ACK

Copy link
Member

@ValarDragon ValarDragon left a comment

Choose a reason for hiding this comment

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

LGTM

@weikengchen weikengchen marked this pull request as draft May 28, 2021 18:35
@weikengchen
Copy link
Member Author

(Convert it into the draft to avoid accidental merging)

@weikengchen weikengchen marked this pull request as ready for review June 5, 2021 06:08
@weikengchen weikengchen merged commit aa0c96f into master Jun 5, 2021
@weikengchen weikengchen deleted the improve-bn-parameters branch June 5, 2021 23:03
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.

4 participants