diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/gas.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/gas.hpp index a5e2adfe5a0..7c69045c001 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/gas.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/gas.hpp @@ -41,7 +41,7 @@ template class gasImpl { { Avm_DECLARE_VIEWS(0); - auto tmp = (gas_sel_gas_cost - gas_sel_gas_cost); + auto tmp = ((gas_sel_gas_cost - gas_sel_gas_cost) - FF(0)); tmp *= scaling_factor; std::get<0>(evals) += tmp; } @@ -49,7 +49,7 @@ template class gasImpl { { Avm_DECLARE_VIEWS(1); - auto tmp = (gas_l2_gas_fixed_table - gas_l2_gas_fixed_table); + auto tmp = ((gas_l2_gas_fixed_table - gas_l2_gas_fixed_table) - FF(0)); tmp *= scaling_factor; std::get<1>(evals) += tmp; } @@ -57,7 +57,7 @@ template class gasImpl { { Avm_DECLARE_VIEWS(2); - auto tmp = (gas_da_gas_fixed_table - gas_da_gas_fixed_table); + auto tmp = ((gas_da_gas_fixed_table - gas_da_gas_fixed_table) - FF(0)); tmp *= scaling_factor; std::get<2>(evals) += tmp; } diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/powers.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/powers.hpp index dab82e6757e..7c43cb2db78 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/powers.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/powers.hpp @@ -37,7 +37,7 @@ template class powersImpl { { Avm_DECLARE_VIEWS(0); - auto tmp = (powers_power_of_2 - powers_power_of_2); + auto tmp = ((powers_power_of_2 - powers_power_of_2) - FF(0)); tmp *= scaling_factor; std::get<0>(evals) += tmp; } diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_prover.cpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_prover.cpp index 3ddd8f14aca..a10bc668d02 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_prover.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_prover.cpp @@ -963,9 +963,6 @@ void AvmProver::execute_relation_check_rounds() * */ void AvmProver::execute_pcs_rounds() { - using Curve = typename Flavor::Curve; - using ZeroMorph = ZeroMorphProver_; - auto prover_opening_claim = ZeroMorph::prove(prover_polynomials.get_unshifted(), prover_polynomials.get_to_be_shifted(), sumcheck_output.claimed_evaluations.get_unshifted(), diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_prover.hpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_prover.hpp index 4fe30cb7fcd..3f95563ac06 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_prover.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_prover.hpp @@ -16,6 +16,8 @@ class AvmProver { using Flavor = AvmFlavor; using FF = Flavor::FF; using PCS = Flavor::PCS; + using Curve = Flavor::Curve; + using ZeroMorph = ZeroMorphProver_; using PCSCommitmentKey = Flavor::CommitmentKey; using ProvingKey = Flavor::ProvingKey; using Polynomial = Flavor::Polynomial; diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_verifier.cpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_verifier.cpp index 5fe89bc3d48..0a863144aad 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_verifier.cpp @@ -52,7 +52,8 @@ bool AvmVerifier::verify_proof(const HonkProof& proof, const std::vector; + // using Curve = Flavor::Curve; + // using ZeroMorph = ZeroMorphVerifier_; using VerifierCommitments = Flavor::VerifierCommitments; using CommitmentLabels = Flavor::CommitmentLabels; @@ -739,13 +740,15 @@ bool AvmVerifier::verify_proof(const HonkProof& proof, const std::vectorget_g1_identity(), // transcript); + // auto pairing_points = PCS::reduce_verify(opening_claim, transcript); // auto verified = pcs_verification_key->pairing_check(pairing_points[0], pairing_points[1]); // return sumcheck_verified.value() && verified; return sumcheck_verified.value(); diff --git a/bb-pilcom/bb-pil-backend/src/prover_builder.rs b/bb-pilcom/bb-pil-backend/src/prover_builder.rs index be412cf0d57..ee129d6ca83 100644 --- a/bb-pilcom/bb-pil-backend/src/prover_builder.rs +++ b/bb-pilcom/bb-pil-backend/src/prover_builder.rs @@ -25,6 +25,8 @@ impl ProverBuilder for BBFiles { using Flavor = {name}Flavor; using FF = Flavor::FF; using PCS = Flavor::PCS; + using Curve = Flavor::Curve; + using ZeroMorph = ZeroMorphProver_; using PCSCommitmentKey = Flavor::CommitmentKey; using ProvingKey = Flavor::ProvingKey; using Polynomial = Flavor::Polynomial; @@ -39,7 +41,7 @@ impl ProverBuilder for BBFiles { void execute_wire_commitments_round(); void execute_log_derivative_inverse_round(); void execute_relation_check_rounds(); - void execute_zeromorph_rounds(); + void execute_pcs_rounds(); HonkProof export_proof(); HonkProof construct_proof(); @@ -64,8 +66,6 @@ impl ProverBuilder for BBFiles { std::shared_ptr commitment_key; - using ZeroMorph = ZeroMorphProver_; - private: HonkProof proof; }}; @@ -190,16 +190,16 @@ impl ProverBuilder for BBFiles { * @details See https://hackmd.io/dlf9xEwhTQyE3hiGbq4FsA?view for a complete description of the unrolled protocol. * * */ - void {name}Prover::execute_zeromorph_rounds() + void {name}Prover::execute_pcs_rounds() {{ - ZeroMorph::prove(prover_polynomials.get_unshifted(), - prover_polynomials.get_to_be_shifted(), - sumcheck_output.claimed_evaluations.get_unshifted(), - sumcheck_output.claimed_evaluations.get_shifted(), - sumcheck_output.challenge, - commitment_key, - transcript); - + auto prover_opening_claim = ZeroMorph::prove(prover_polynomials.get_unshifted(), + prover_polynomials.get_to_be_shifted(), + sumcheck_output.claimed_evaluations.get_unshifted(), + sumcheck_output.claimed_evaluations.get_shifted(), + sumcheck_output.challenge, + commitment_key, + transcript); + PCS::compute_opening_proof(commitment_key, prover_opening_claim, transcript); }} @@ -226,7 +226,7 @@ impl ProverBuilder for BBFiles { // Fiat-Shamir: rho, y, x, z // Execute Zeromorph multilinear PCS - execute_zeromorph_rounds(); + execute_pcs_rounds(); return export_proof(); }} @@ -271,7 +271,6 @@ fn includes_cpp(name: &str) -> String { #include \"barretenberg/honk/proof_system/permutation_library.hpp\" #include \"barretenberg/plonk_honk_shared/library/grand_product_library.hpp\" #include \"barretenberg/polynomials/polynomial.hpp\" - #include \"barretenberg/relations/lookup_relation.hpp\" #include \"barretenberg/relations/permutation_relation.hpp\" #include \"barretenberg/sumcheck/sumcheck.hpp\" " diff --git a/bb-pilcom/bb-pil-backend/src/verifier_builder.rs b/bb-pilcom/bb-pil-backend/src/verifier_builder.rs index 710b9cafadc..ed93731b67f 100644 --- a/bb-pilcom/bb-pil-backend/src/verifier_builder.rs +++ b/bb-pilcom/bb-pil-backend/src/verifier_builder.rs @@ -132,7 +132,8 @@ impl VerifierBuilder for BBFiles { using FF = Flavor::FF; using Commitment = Flavor::Commitment; // using PCS = Flavor::PCS; - // using ZeroMorph = ZeroMorphVerifier_; + // using Curve = Flavor::Curve; + // using ZeroMorph = ZeroMorphVerifier_; using VerifierCommitments = Flavor::VerifierCommitments; using CommitmentLabels = Flavor::CommitmentLabels; @@ -182,13 +183,15 @@ impl VerifierBuilder for BBFiles { // Execute ZeroMorph rounds. See https://hackmd.io/dlf9xEwhTQyE3hiGbq4FsA?view for a complete description of the // unrolled protocol. // NOTE: temporarily disabled - facing integration issues - // auto pairing_points = ZeroMorph::verify(commitments.get_unshifted(), + // auto opening_claim = ZeroMorph::verify(commitments.get_unshifted(), // commitments.get_to_be_shifted(), // claimed_evaluations.get_unshifted(), // claimed_evaluations.get_shifted(), // multivariate_challenge, + // pcs_verification_key->get_g1_identity(), // transcript); + // auto pairing_points = PCS::reduce_verify(opening_claim, transcript); // auto verified = pcs_verification_key->pairing_check(pairing_points[0], pairing_points[1]); // return sumcheck_verified.value() && verified; return sumcheck_verified.value();