Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

Add BW6-767 curve and update BW6-761 to use the new bw6 model #156

Merged
merged 16 commits into from
Sep 1, 2023

Conversation

swasilyev
Copy link
Contributor

@swasilyev swasilyev commented Mar 27, 2023

Completes #154, requires arkworks-rs/algebra#633


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 and others added 13 commits March 8, 2023 11:59
use bls12-381 instead of 377 for test imports

fix the inline comments with correct name and params


Set the right base field


Equation for base curve is y2 = x3 + 1


fill in pairing params


adapt sage scripts with correct moduli


calculate the correct cubic non residue


correct the parameter B in the curve equation


remove the specialized method for mult by nonresidue

nonresidue is two, so default will be doubling

calculate more correct parameters for fq3

`TRACE_MINUS_ONE_DIV_TWO` and `QUADRATIC_NONRESIDUE_TO_T`

compute the right fq3 & fp6 frobenious coefficients


calculate the cofactor for g1


use the g1 generator from gnark's fork


use the right g2 equation


g2 cofactor is slightly smaller than g1 cofactor


get the g2 generators from gnark's fork


update g1 and g2 curve info in the comments


fill in `COFACTOR_INV` value for g1


fill in `COFACTOR_INV` value for g2
author information
2-adicity of the scalar field
2. Curve specific hard part of the final exp moved from algebra
2. Miller loop params changed to the "unoptimized" version
@mmagician mmagician changed the title BW6-767 Add BW6-767 curve and update BW6-761 to use the new bw6 model Mar 31, 2023
@mmagician mmagician mentioned this pull request Mar 31, 2023
6 tasks
Comment on lines +20 to +33
const X: BigInteger = BigInt::new([
0xd201000000010000,
0x0,
0x0,
0x0,
0x0,
0x0,
0x0,
0x0,
0x0,
0x0,
0x0,
0x0,
]);
Copy link
Member

Choose a reason for hiding this comment

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

We can use the BigInt macro to avoid having to do this manual specification. Though right now the macro does not handle hexadecimal inputs. I can submit a PR for this though.

Copy link
Member

Choose a reason for hiding this comment

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

@swasilyev you should be able to now use updated macro from Pratyush's new PR in algebra: arkworks-rs/algebra#635

Copy link
Member

Choose a reason for hiding this comment

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

We've discussed with @swasilyev to leave it as-is in this PR, and later to submit another PR where we use the macro for ALL curves.

Copy link
Member

Choose a reason for hiding this comment

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

Created an issue for this: #169

@mmagician mmagician merged commit 7e58260 into arkworks-rs:master Sep 1, 2023
32 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants