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

chore: make FpOperations use PrimeField32 to clean up type inconsistency hacks #203

Merged
merged 11 commits into from
Feb 13, 2024

Conversation

hidenori-shinohara
Copy link
Contributor

Currently, it takes Field but then under the hood, we actually use BabyBear. This PR removes that hack and makes FpOperations take PrimeField32 and use that, hence removing the hardcoded BabyBear.

@@ -58,7 +56,7 @@ impl<'a, T: Debug + Default + Clone> From<Iter<'a, T>> for Limbs<T> {
}

// TODO: we probably won't need this in the future when we do things properly.
pub fn convert_polynomial<F: Field>(value: Polynomial<BabyBear>) -> Limbs<F> {
pub fn convert_polynomial<F: PrimeField32>(value: Polynomial<F>) -> Limbs<F> {
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 these should be cleaned up since we don't need it anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@@ -69,8 +67,7 @@ pub fn convert_polynomial<F: Field>(value: Polynomial<BabyBear>) -> Limbs<F> {
Limbs(inner)
}

// TODO: we probably won't need this in the future when we do things properly.
pub fn convert_vec<F: Field>(value: Vec<BabyBear>) -> Vec<F> {
pub fn convert_vec<F: PrimeField32>(value: Vec<F>) -> Vec<F> {
Copy link
Contributor

Choose a reason for hiding this comment

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

same with cleaning this up?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@hidenori-shinohara hidenori-shinohara marked this pull request as ready for review February 12, 2024 23:41
@puma314 puma314 merged commit 3250778 into main Feb 13, 2024
6 checks passed
@puma314 puma314 deleted the hide/fp-babybear branch February 13, 2024 02:51
jtguibas pushed a commit that referenced this pull request Mar 29, 2024
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.

2 participants