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 Missing Components for BLS12-377 Curve #922

Merged
merged 9 commits into from
Oct 3, 2024

Conversation

jotabulacios
Copy link
Contributor

Add Missing Components for BLS12-377 Curve

Description

This PR adds the missing components of the curve, such as the twist and field extension implementations

  • New feature

/// (a0 + a1 * t) * (b0 + b1 * t) = a0 * b0 + a1 * b1 * Self::residue() + (a0 * b1 + a1 * b0) * t
/// where `t.pow(2)` equals `Q::residue()`.
fn mul(a: &Self::BaseType, b: &Self::BaseType) -> Self::BaseType {
let q = -FieldElement::from(5); // This is where u^2 = -5 is applied
Copy link
Contributor

Choose a reason for hiding this comment

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

Have this as a constant, since it is the non-residue

@codecov-commenter
Copy link

codecov-commenter commented Oct 1, 2024

Codecov Report

Attention: Patch coverage is 72.79597% with 108 lines in your changes missing coverage. Please review.

Project coverage is 70.96%. Comparing base (7a427aa) to head (058d23c).

Files with missing lines Patch % Lines
...rt_weierstrass/curves/bls12_377/field_extension.rs 52.00% 108 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #922      +/-   ##
==========================================
+ Coverage   70.95%   70.96%   +0.01%     
==========================================
  Files         143      144       +1     
  Lines       31284    31669     +385     
==========================================
+ Hits        22197    22474     +277     
- Misses       9087     9195     +108     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jotabulacios jotabulacios marked this pull request as ready for review October 1, 2024 14:38
@jotabulacios jotabulacios requested a review from a team as a code owner October 1, 2024 14:38
pub struct BLS12377Residue;
impl HasQuadraticNonResidue<BLS12377PrimeField> for BLS12377Residue {
fn residue() -> FieldElement<BLS12377PrimeField> {
-FieldElement::from(5)
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be the constant

@ColoCarletti ColoCarletti added this pull request to the merge queue Oct 3, 2024
Merged via the queue into main with commit 86b2789 Oct 3, 2024
8 checks passed
@ColoCarletti ColoCarletti deleted the add_bls12_377_missing_components branch October 3, 2024 15:52
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