-
Notifications
You must be signed in to change notification settings - Fork 140
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
Circle starks #924
Circle starks #924
Conversation
…rks into optimize_mersenne31
…rks into optimize_mersenne31
…rks into optimize_mersenne31
This reverts commit 21d09c6.
/// As a result we obtain the coefficients of the polynomial in the basis: {1, y, x, xy, 2xˆ2 -1, 2xˆ2y-y, 2xˆ3-x, 2xˆ3y-xy,...} | ||
/// Note that eval has to be a vector of length a power of two 2^n. | ||
#[cfg(feature = "alloc")] | ||
pub fn interpolate_cfft( |
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.
As an optimization, we could just send the twiddles as input to the function. This is useful when we have to interpolate multiple columns
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.
We believe that reusing twiddles for different polynomials within the same domain would be better handled by a dedicated function, rather than incorporating it here. Its implementation should depend on specific protocol requirements.
/// returns the evaluation of the polynomial on the points of the standard coset of size 2^n. | ||
/// Note that coeff has to be a vector with length a power of two 2^n. | ||
#[cfg(feature = "alloc")] | ||
pub fn evaluate_cfft( |
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.
Similar comment to the one after this one. Twiddles could be given as inputs
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.
Same as the previous comment.
pub fn order_cfft_result_naive( | ||
input: &mut [FieldElement<Mersenne31Field>], | ||
) -> Vec<FieldElement<Mersenne31Field>> { | ||
let mut result = Vec::new(); |
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.
maybe we can use interleave
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.
That would not solve the memory usage problem. There is a way to do it in-place recursively, but we thought it would be better to implement that when we need to optimize.
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.
The PR is looking good! Left more comments.
As a side note, if we use an unwrap
and we're 100% sure that it won't panic, let's add an explanation either as function docs (this is done under a /// # Panics
section) or as a comment above the line.
Co-authored-by: Ivan Litteri <[email protected]>
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.
LGTM. Great work!
Circle Starks
This PR introduces the foundational components necessary for the Circle Starks protocol implementation.
Key Features:
Type of change
Checklist