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

bogu hw #8

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion prover.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,18 @@ def round_3(self) -> Message3:
) * ZW.values[
i % group_order
] == 0

# TODO: your code
# NOTE: the implementation of id(x) is `Cell.label()`:
#
# ```
# # Outputs the label (an inner-field element) representing a given
# # (column, row) pair. Expects section = 1 for left, 2 right, 3 output
# def label(self, group_order: int) -> Scalar:
# assert self.row < group_order
# return Scalar.roots_of_unity(group_order)[self.row] * self.column.value
# ```
#
# NOTE: the results of `Z(wX) g(X) - Z(X) f(X)` and `z(X) f(X) - z(wX) g(X)` are different.
permutation_grand_product_coeff = (
(
self.rlc(A_coeff, roots_coeff)
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def generate_srs(cls, powers: int, tau: int):
# powers_of_x[2] = b.G1 * tau**2 = powers_of_x[1] * tau
# ...
# powers_of_x[i] = b.G1 * tau**i = powers_of_x[i - 1] * tau
# TODO: generate powers_of_x
powers_of_x[0] = b.G1

for i in range(1, powers):
Expand Down
2 changes: 1 addition & 1 deletion verifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def verify_proof(self, group_order: int, pf, public=[]) -> bool:
z_eval = proof["z_eval"]
zw_eval = proof["zw_eval"]
t_eval = proof["t_eval"]

# TODO: your code
f_eval = (
(a_eval + beta * zeta + gamma)
* (b_eval + beta * zeta * 2 + gamma)
Expand Down