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

Improve documentation for BN curve parameter ATE_LOOP_COUNT #275

Merged
merged 2 commits into from
May 12, 2021

Conversation

weikengchen
Copy link
Member

@weikengchen weikengchen commented May 12, 2021

Description

This PR is to clarify that ATE_LOOP_COUNT is 6 X + 2 instead of |6 X + 2|, a possible confusion.

This is related to #274 and arkworks-rs/curves#54.


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
  • Re-reviewed Files changed in the Github PR explorer

N/A:

  • Wrote unit tests
  • Added a relevant changelog entry to the Pending section in CHANGELOG.md

@weikengchen weikengchen merged commit 5ade4e1 into master May 12, 2021
@weikengchen weikengchen deleted the improve-bn-doc branch May 12, 2021 00:49
const ATE_LOOP_COUNT: &'static [i8];
// Whether or not `6X + 2` is negative. `6X + 2` is negative often when `X` is negative.
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't 6X + 2 negative exactly when X is negative? (Because X is an integer and 2 < 6.) That implies that this field should probably just be removed and X_IS_NEGATIVE used instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also I'm confused because this doc appears to contradict the following sentence in the PR description:

This PR is to clarify that ATE_LOOP_COUNT is 6 X + 2 instead of |6 X + 2|, a possible confusion.

Copy link
Member Author

Choose a reason for hiding this comment

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

You are right.

Let me clarify this PR's documentation as well as the documentation in the code (you are right, 2 < 6 so X must be negative).

I think there are two possible future plans:

  1. Not too breaking, which can be done now:
  • Use X_IS_NEGATIVE to decide whatever ATE_LOOP_COUNT_IS_NEGATIVE is deciding, since they should be equivalent for BN curves.
  1. Breaking:
  • Remove ATE_LOOP_COUNT_IS_NEGATIVE and update the BN254 implementation accordingly.

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.

3 participants