-
Notifications
You must be signed in to change notification settings - Fork 376
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
Changes from 7 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
51177c0
add test.sh
hidenori-shinohara be3fc77
Field => Primefield32 attempt, doesn't work yet
hidenori-shinohara c260d6a
compiles...?
hidenori-shinohara 39f9119
actually it doesn't compile yet, but i'm making some progress
hidenori-shinohara fea23e7
okay maybe now it compiles
hidenori-shinohara 48da121
clean up an unused import
hidenori-shinohara 33d2de9
remove test.sh
hidenori-shinohara 55d4e39
start removing convert_polynomial and convert_vec
hidenori-shinohara 3d8ce1f
remove outdated utility functions
hidenori-shinohara 48c4f53
rename fp -> field
hidenori-shinohara cc74170
fp => field
hidenori-shinohara File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
use crate::air::Polynomial; | ||
use p3_baby_bear::BabyBear; | ||
use p3_field::Field; | ||
use p3_field::PrimeField32; | ||
use std::fmt::Debug; | ||
use std::ops::Index; | ||
|
@@ -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> { | ||
let inner_u8 = value | ||
.as_coefficients() | ||
.iter() | ||
|
@@ -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> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same with cleaning this up? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed |
||
value | ||
.iter() | ||
.map(|x| x.as_canonical_u32() as u8) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed