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

Baby bear extension #942

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Baby bear extension #942

wants to merge 13 commits into from

Conversation

nicole-graus
Copy link
Contributor

Quartic Baby Bear Extension

Description

Add the field extension of Baby Bear of degree 4 using the irreducible polynomial x^4 + 11.

Type of change

Please delete options that are not relevant.

  • New feature
  • Bug fix
  • Optimization

@nicole-graus nicole-graus requested a review from a team as a code owner November 25, 2024 15:56
@codecov-commenter
Copy link

codecov-commenter commented Nov 25, 2024

Codecov Report

Attention: Patch coverage is 76.53959% with 80 lines in your changes missing coverage. Please review.

Project coverage is 71.12%. Comparing base (e443c93) to head (a339a32).

Files with missing lines Patch % Lines
.../src/field/fields/fft_friendly/quartic_babybear.rs 76.53% 80 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #942      +/-   ##
==========================================
+ Coverage   71.04%   71.12%   +0.07%     
==========================================
  Files         153      153              
  Lines       32770    33101     +331     
==========================================
+ Hits        23283    23542     +259     
- Misses       9487     9559      +72     

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

<Degree4BabyBearExtensionField as IsField>::add(a, a)
}

fn pow<T>(a: &Self::BaseType, mut exponent: T) -> Self::BaseType
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be written simpler. There are some repetitions of code

Copy link
Contributor

Choose a reason for hiding this comment

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

Solved here

Comment on lines 82 to 87
[
FieldElement::zero(),
FieldElement::zero(),
FieldElement::zero(),
FieldElement::zero(),
]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
[
FieldElement::zero(),
FieldElement::zero(),
FieldElement::zero(),
FieldElement::zero(),
]
Self::BaseType::default()

Copy link
Contributor

Choose a reason for hiding this comment

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

Solved here

Comment on lines 221 to 245
impl ByteConversion for [FieldElement<Babybear31PrimeField>; 4] {
#[cfg(feature = "alloc")]
fn to_bytes_be(&self) -> alloc::vec::Vec<u8> {
unimplemented!()
}

#[cfg(feature = "alloc")]
fn to_bytes_le(&self) -> alloc::vec::Vec<u8> {
unimplemented!()
}

fn from_bytes_be(_bytes: &[u8]) -> Result<Self, crate::errors::ByteConversionError>
where
Self: Sized,
{
unimplemented!()
}

fn from_bytes_le(_bytes: &[u8]) -> Result<Self, crate::errors::ByteConversionError>
where
Self: Sized,
{
unimplemented!()
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's better to implement this methods before merging the PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Implemented here

prop_assert_eq!(fft_eval, naive_eval);
}

// #[cfg(not(any(feature = "metal"),not(feature = "cuda")))]
Copy link
Contributor

Choose a reason for hiding this comment

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

if this line will be commented out, it's better to remove it

Copy link
Contributor

Choose a reason for hiding this comment

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

Removed in here

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.

6 participants