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

fix: fixed L_01 #27

Merged
merged 2 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions contracts/verifiers/PlonkVerifierFull.sol
Original file line number Diff line number Diff line change
Expand Up @@ -574,16 +574,14 @@ contract PlonkVerifier {
p := add(p, mul(vk_nb_custom_gates, 0x20)) // p points now to the wire commitments

let h_fr, ith_lagrange


h_fr := hash_fr(calldataload(p), calldataload(add(p, 0x20)), mPtr)
ith_lagrange := compute_ith_lagrange_at_z(z, zpnmo, add(nb_public_inputs, vk_index_commit_api_0), mPtr)
pi_commit := addmod(pi_commit, mulmod(h_fr, ith_lagrange, r_mod), r_mod)
p := add(p, 0x40)


}


// z zeta
// zpmno ζⁿ-1
// i i-th lagrange
Expand Down Expand Up @@ -868,6 +866,7 @@ contract PlonkVerifier {
fr_acc_mul_calldata(add(state, state_folded_claimed_values), add(aproof, proof_s1_at_zeta), acc_gamma)

acc_gamma := mulmod(acc_gamma, l_gamma_kzg, r_mod)

mstore(mPtr, vk_s2_com_x)
mstore(mPtr20, vk_s2_com_y)
point_acc_mul(state_folded_digests, mPtr, acc_gamma, mPtr40)
Expand Down Expand Up @@ -1002,6 +1001,7 @@ contract PlonkVerifier {
aproof,
add(proof_openings_qci_at_zeta, mul(vk_nb_custom_gates, 0x20))
)

for {
let i := 0
} lt(i, vk_nb_custom_gates) {
Expand Down
9 changes: 4 additions & 5 deletions contracts/verifiers/PlonkVerifierFullLarge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ contract PlonkVerifier {
uint256 private constant vk_s3_com_y = 2552117266413842861429350027587256255877998397978448202487083660679276635888;

uint256 private constant vk_coset_shift = 5;


uint256 private constant vk_qc_0_x = 3884624064879507288554125065509059886567955998027552754695080199794317463496;
uint256 private constant vk_qc_0_y = 3095893745686259387023328325251031582843387681306303361911851672293653329255;
Expand Down Expand Up @@ -574,16 +573,14 @@ contract PlonkVerifier {
p := add(p, mul(vk_nb_custom_gates, 0x20)) // p points now to the wire commitments

let h_fr, ith_lagrange


h_fr := hash_fr(calldataload(p), calldataload(add(p, 0x20)), mPtr)
ith_lagrange := compute_ith_lagrange_at_z(z, zpnmo, add(nb_public_inputs, vk_index_commit_api_0), mPtr)
pi_commit := addmod(pi_commit, mulmod(h_fr, ith_lagrange, r_mod), r_mod)
p := add(p, 0x40)


}


// z zeta
// zpmno ζⁿ-1
// i i-th lagrange
Expand Down Expand Up @@ -868,6 +865,7 @@ contract PlonkVerifier {
fr_acc_mul_calldata(add(state, state_folded_claimed_values), add(aproof, proof_s1_at_zeta), acc_gamma)

acc_gamma := mulmod(acc_gamma, l_gamma_kzg, r_mod)

mstore(mPtr, vk_s2_com_x)
mstore(mPtr20, vk_s2_com_y)
point_acc_mul(state_folded_digests, mPtr, acc_gamma, mPtr40)
Expand Down Expand Up @@ -1002,6 +1000,7 @@ contract PlonkVerifier {
aproof,
add(proof_openings_qci_at_zeta, mul(vk_nb_custom_gates, 0x20))
)

for {
let i := 0
} lt(i, vk_nb_custom_gates) {
Expand Down