-
Notifications
You must be signed in to change notification settings - Fork 599
feat: eccvm translator zk sumcheck #9199
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
Changes from all commits
109379e
767f4f7
e753e87
e95437d
ad55c27
3d41570
44f453e
084979b
9e5d1a1
5396443
66293fd
fdf441e
68a7946
26a4eb1
40f367f
ff1cbe2
3ff1e57
ec9e0a7
ad391e1
d6e29ce
077d998
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -311,9 +311,10 @@ Accumulator ECCVMSetRelationImpl<FF>::compute_grand_product_denominator(const Al | |
| // FF endomorphism_base_field_shift = FF::cube_root_of_unity(); | ||
| FF endomorphism_base_field_shift = FF(bb::fq::cube_root_of_unity()); | ||
|
|
||
| auto transcript_input1 = transcript_pc + transcript_Px * beta + transcript_Py * beta_sqr + z1 * beta_cube; | ||
| auto transcript_input1 = | ||
| transcript_pc + transcript_Px * beta + transcript_Py * beta_sqr + z1 * beta_cube; // degree = 1 | ||
| auto transcript_input2 = (transcript_pc - 1) + transcript_Px * endomorphism_base_field_shift * beta - | ||
| transcript_Py * beta_sqr + z2 * beta_cube; | ||
| transcript_Py * beta_sqr + z2 * beta_cube; // degree = 2 | ||
|
|
||
| // | q_mul | z2_zero | z1_zero | base_infinity | lookup | | ||
| // | ----- | ------- | ------- | ------------- |----------------------- | | ||
|
|
@@ -326,15 +327,15 @@ Accumulator ECCVMSetRelationImpl<FF>::compute_grand_product_denominator(const Al | |
| // | 1 | 0 | 1 | 1 | 1 | | ||
| // | 1 | 1 | 0 | 1 | 1 | | ||
| // | 1 | 1 | 1 | 1 | 1 | | ||
| transcript_input1 = (transcript_input1 + gamma) * lookup_first + (-lookup_first + 1); | ||
| transcript_input2 = (transcript_input2 + gamma) * lookup_second + (-lookup_second + 1); | ||
| transcript_input1 = (transcript_input1 + gamma) * lookup_first + (-lookup_first + 1); // degree 2 | ||
| transcript_input2 = (transcript_input2 + gamma) * lookup_second + (-lookup_second + 1); // degree 3 | ||
|
|
||
| // transcript_product = degree 3 | ||
| // transcript_product = degree 6 | ||
| auto transcript_product = (transcript_input1 * transcript_input2) * (-base_infinity + 1) + base_infinity; | ||
|
|
||
| // point_table_init_write = degree 4 | ||
| // point_table_init_write = degree 7 | ||
| auto point_table_init_write = transcript_mul * transcript_product + (-transcript_mul + 1); | ||
| denominator *= point_table_init_write; // degree-14 | ||
| denominator *= point_table_init_write; // degree 17 | ||
|
|
||
| // auto point_table_init_write_1 = transcript_mul * transcript_input1 + (-transcript_mul + 1); | ||
| // denominator *= point_table_init_write_1; // degree-11 | ||
|
|
@@ -391,25 +392,28 @@ void ECCVMSetRelationImpl<FF>::accumulate(ContainerOverSubrelations& accumulator | |
| { | ||
| using Accumulator = typename std::tuple_element_t<0, ContainerOverSubrelations>; | ||
| using View = typename Accumulator::View; | ||
| using ShortView = typename std::tuple_element_t<1, ContainerOverSubrelations>::View; | ||
|
|
||
| // degree-11 | ||
| Accumulator numerator_evaluation = compute_grand_product_numerator<Accumulator>(in, params); | ||
|
|
||
| // degree-17 | ||
| // degree-20 | ||
| Accumulator denominator_evaluation = compute_grand_product_denominator<Accumulator>(in, params); | ||
|
|
||
| const auto& lagrange_first = View(in.lagrange_first); | ||
| const auto& lagrange_last = View(in.lagrange_last); | ||
| const auto& lagrange_last_short = ShortView(in.lagrange_last); | ||
|
|
||
| const auto& z_perm = View(in.z_perm); | ||
| const auto& z_perm_shift = View(in.z_perm_shift); | ||
| const auto& z_perm_shift_short = ShortView(in.z_perm_shift); | ||
|
|
||
| // degree-18 | ||
| // degree-21 | ||
| std::get<0>(accumulator) += | ||
| ((z_perm + lagrange_first) * numerator_evaluation - (z_perm_shift + lagrange_last) * denominator_evaluation) * | ||
| scaling_factor; | ||
|
|
||
| // Contribution (2) | ||
| std::get<1>(accumulator) += (lagrange_last * z_perm_shift) * scaling_factor; | ||
| std::get<1>(accumulator) += lagrange_last_short * z_perm_shift_short * scaling_factor; | ||
|
Contributor
Author
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. Small optimization: taken into account the fact that the second component of the accumulator is actually of a much smaller degree ( 2 )
Contributor
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. ty for spotting that 👍 |
||
| } | ||
| } // namespace bb | ||
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 proving is quite slow and the time grows somewhat predictably.
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.
sounds good. 2^20 is a lot of eccvm operations, far more than we expect on the client, so reducing the range is fine