-
Notifications
You must be signed in to change notification settings - Fork 136
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
Stark: Prover and Verifier over field extensions #716
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #716 +/- ##
==========================================
- Coverage 96.10% 96.09% -0.02%
==========================================
Files 133 133
Lines 30052 30166 +114
==========================================
+ Hits 28882 28987 +105
- Misses 1170 1179 +9 ☔ View full report in Codecov by Sentry. |
) -> FieldElement<F> | ||
where | ||
FieldElement<F>: Serializable, | ||
{ | ||
loop { | ||
let value: FieldElement<F> = self.sample_field_element(); | ||
if !lde_roots_of_unity_coset.iter().any(|x| x == &value) | ||
&& !trace_roots_of_unity.iter().any(|x| x == &value) | ||
if !lde_roots_of_unity_coset |
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.
Given that roots of unity are real for the cases we have, it would suffice to check if the imaginary part is non-zero to know it is an ood point, avoiding the cloning and extension
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.
True! But that would work for quadratic extensions only (and would be a sufficient but not necessary condition to be out of the LDE). For the case of Stone the field extension is the prime field itself.
A way to avoid cloning and extending would be to add an eq
method to the trait IsSubFieldOf
and force subfields to implement efficient comparison with elements of the extension.
Co-authored-by: Mario Rugiero <[email protected]>
@@ -46,7 +51,7 @@ pub fn validate_trace<F: IsFFTField, A: AIR<Field = F>>( | |||
let boundary_value = constraint.value.clone(); | |||
let trace_value = trace.get(step, col); | |||
|
|||
if &boundary_value != trace_value { | |||
if &boundary_value.clone().to_extension() != trace_value { |
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.
Is this clone needed ?
Prover and Verifier over field extensions
Description
This PR is the first step to support field extensions in the stark prover and verifier.
In summary, this PR
FieldExtension
to bothIsStarkProver
andIsStarkVerifier
.There is a followup PR that improves the way the prover handles the trace and avoids casting it to the field extension. This is so dividided in two PRs to make reviewing easier.
Type of change