Skip to content

Conversation

@mmagician
Copy link
Member

Description

While working on #559, I realized that the condiditon for mul and squaring are the same (potenitally a copy paste error?). Since we're using this optimisation (our method docs), we should probably change the condition to match gnark's.


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.
  • Wrote unit tests
  • 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

@mmagician mmagician requested review from a team as code owners December 25, 2022 18:02
@mmagician mmagician requested review from Pratyush and weikengchen and removed request for a team December 25, 2022 18:02
@weikengchen
Copy link
Member

Let me read the code a bit. The reason is that this no-carry implementation was originally for fields where the top two bits are zero (since, in arkworks-rs, previously, the top bit always must be zero). I need to think about whether this is intended.

@Pratyush
Copy link
Member

We actually haven't implemented the squaring optimization; right now our squaring code only uses the flag when deciding which assembly routine to call.

Also, our code now supports 64 * k bit moduli, so we need to check if the top bit is zero still, I believe

@mmagician
Copy link
Member Author

@Pratyush we have now :) #559

@mmagician mmagician added this to the next patch release milestone Dec 28, 2022
@Pratyush Pratyush merged commit e650582 into arkworks-rs:master Jan 10, 2023
@mmagician mmagician deleted the optimized-mont-mul-condtition branch January 10, 2023 11:04
andrewmilson added a commit to andrewmilson/algebra that referenced this pull request Feb 9, 2023
* upstream/master:
  Add a note on `add_assign_mixed` to CHANGELOG (arkworks-rs#600)
  Fix linting on nightly Rust (arkworks-rs#598)
  Build docs correctly on docs.rs (arkworks-rs#590)
  Set correct minimum supported Rust version (arkworks-rs#592)
  Add back pairing benchmarks. (arkworks-rs#586)
  Create test-templates/README (arkworks-rs#585)
  Create README.md for `bench-templates` (arkworks-rs#583)
  Update `master` branch to 0.4.0 (arkworks-rs#582)
  Unify model configs (arkworks-rs#580)
  Correctly evaluate over domain when `self` is zero polynomial (arkworks-rs#575)
  Improve `impl From<u128> for Fp` (arkworks-rs#573)
  should just check the top bit, not two bits (arkworks-rs#560)
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