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

Add a Field::from_base_field_elements method #165

Merged
merged 3 commits into from
Jan 3, 2021

Conversation

ValarDragon
Copy link
Member

@ValarDragon ValarDragon commented Jan 2, 2021

Description

This PR adds a Field::from_base_field_elements() method. This is useful for writing hashing to curve code that is general over the base field of the curve.

Furthermore, this PR also fixes a type safety issue with field extensions, where an extension fields basefield may not extend from the base prime field. (Needed for this PR to compile)

To test this, I've added an fq2 and fq6 to test_fields.

closes: #163

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 (main)
  • 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

@Pratyush
Copy link
Member

Pratyush commented Jan 2, 2021

This LGTM. Quick question: since you’re editing the cubic extension file, I noticed there are some incorrect comments talking about quadratic extension. (Eg around lines 29 and 31) could you fix these also? Thanks :)

@ValarDragon
Copy link
Member Author

Fixed

@ValarDragon ValarDragon merged commit 210f35b into master Jan 3, 2021
@ValarDragon ValarDragon deleted the from_base_field_elements branch January 3, 2021 05:02
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.

Add Field::from_base_field_elements function
2 participants