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

chore: toy avm snake case #4584

Merged
merged 2 commits into from
Feb 13, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#include "barretenberg/flavor/flavor_macros.hpp"
#include "barretenberg/polynomials/evaluation_domain.hpp"
#include "barretenberg/polynomials/polynomial.hpp"
#include "barretenberg/relations/generated/Toy/toy_avm.hpp"
#include "barretenberg/relations/generated/Toy/two_column_perm.hpp"
#include "barretenberg/relations/generated/toy/toy_avm.hpp"
#include "barretenberg/relations/generated/toy/two_column_perm.hpp"
#include "barretenberg/transcript/transcript.hpp"

namespace bb {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
#include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp"
#include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp"

#include "barretenberg/flavor/generated/Toy_flavor.hpp"
#include "barretenberg/relations/generated/Toy/lookup_xor.hpp"
#include "barretenberg/relations/generated/Toy/toy_avm.hpp"
#include "barretenberg/relations/generated/Toy/two_column_perm.hpp"
#include "barretenberg/flavor/generated/toy_flavor.hpp"
#include "barretenberg/relations/generated/toy/lookup_xor.hpp"
#include "barretenberg/relations/generated/toy/toy_avm.hpp"
#include "barretenberg/relations/generated/toy/two_column_perm.hpp"

namespace bb {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "../generated/Toy_circuit_builder.hpp"
#include "../generated/toy_circuit_builder.hpp"
#include "barretenberg/crypto/generators/generator_data.hpp"
#include "barretenberg/flavor/generated/Toy_flavor.hpp"
#include "barretenberg/proof_system/circuit_builder/generated/Toy_circuit_builder.hpp"
#include "barretenberg/flavor/generated/toy_flavor.hpp"
#include "barretenberg/proof_system/circuit_builder/generated/toy_circuit_builder.hpp"

#include <gtest/gtest.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
namespace bb::Toy_vm {

template <typename FF> struct Toy_avmRow {
FF toy_q_xor_table{};
FF toy_q_tuple_set{};
FF toy_q_xor{};
FF toy_q_xor_table{};
};

inline std::string get_relation_label_toy_avm(int index)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@


#include "./Toy_composer.hpp"
#include "barretenberg/proof_system/circuit_builder/generated/Toy_circuit_builder.hpp"
#include "./toy_composer.hpp"
#include "barretenberg/proof_system/circuit_builder/generated/toy_circuit_builder.hpp"
#include "barretenberg/proof_system/composer/composer_lib.hpp"
#include "barretenberg/proof_system/composer/permutation_lib.hpp"
#include "barretenberg/vm/generated/Toy_verifier.hpp"
#include "barretenberg/vm/generated/toy_verifier.hpp"

namespace bb {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

#pragma once

#include "barretenberg/proof_system/circuit_builder/generated/Toy_circuit_builder.hpp"
#include "barretenberg/proof_system/circuit_builder/generated/toy_circuit_builder.hpp"
#include "barretenberg/proof_system/composer/composer_lib.hpp"
#include "barretenberg/srs/global_crs.hpp"
#include "barretenberg/vm/generated/Toy_prover.hpp"
#include "barretenberg/vm/generated/Toy_verifier.hpp"
#include "barretenberg/vm/generated/toy_prover.hpp"
#include "barretenberg/vm/generated/toy_verifier.hpp"

namespace bb {
class ToyComposer {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


#include "Toy_prover.hpp"
#include "toy_prover.hpp"
#include "barretenberg/commitment_schemes/claim.hpp"
#include "barretenberg/commitment_schemes/commitment_key.hpp"
#include "barretenberg/honk/proof_system/logderivative_library.hpp"
Expand All @@ -14,6 +14,7 @@
namespace bb {

using Flavor = ToyFlavor;
using FF = Flavor::FF;

/**
* Create ToyProver from proving key, witness and manifest.
Expand Down Expand Up @@ -69,9 +70,12 @@ void ToyProver::execute_wire_commitments_round()
void ToyProver::execute_relation_check_rounds()
{
using Sumcheck = SumcheckProver<Flavor>;

auto sumcheck = Sumcheck(key->circuit_size, transcript);

FF alpha = transcript->template get_challenge<FF>("Sumcheck:alpha");
std::vector<FF> gate_challenges(numeric::get_msb(key->circuit_size));

for (size_t idx = 0; idx < gate_challenges.size(); idx++) {
gate_challenges[idx] = transcript->template get_challenge<FF>("Sumcheck:gate_challenge_" + std::to_string(idx));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#pragma once
#include "barretenberg/commitment_schemes/zeromorph/zeromorph.hpp"
#include "barretenberg/flavor/generated/Toy_flavor.hpp"
#include "barretenberg/flavor/generated/toy_flavor.hpp"
#include "barretenberg/plonk/proof_system/types/proof.hpp"
#include "barretenberg/relations/relation_parameters.hpp"
#include "barretenberg/sumcheck/sumcheck_output.hpp"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


#include "./Toy_verifier.hpp"
#include "./toy_verifier.hpp"
#include "barretenberg/commitment_schemes/zeromorph/zeromorph.hpp"
#include "barretenberg/numeric/bitop/get_msb.hpp"
#include "barretenberg/transcript/transcript.hpp"
Expand Down Expand Up @@ -82,11 +82,14 @@ bool ToyVerifier::verify_proof(const HonkProof& proof)
// Execute Sumcheck Verifier
const size_t log_circuit_size = numeric::get_msb(circuit_size);
auto sumcheck = SumcheckVerifier<Flavor>(log_circuit_size, transcript);

FF alpha = transcript->template get_challenge<FF>("Sumcheck:alpha");

auto gate_challenges = std::vector<FF>(log_circuit_size);
for (size_t idx = 0; idx < log_circuit_size; idx++) {
gate_challenges[idx] = transcript->template get_challenge<FF>("Sumcheck:gate_challenge_" + std::to_string(idx));
}

auto [multivariate_challenge, claimed_evaluations, sumcheck_verified] =
sumcheck.verify(relation_parameters, alpha, gate_challenges);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@


#pragma once
#include "barretenberg/flavor/generated/Toy_flavor.hpp"
#include "barretenberg/honk/proof_system/types/proof.hpp"
#include "barretenberg/flavor/generated/toy_flavor.hpp"
#include "barretenberg/plonk/proof_system/types/proof.hpp"
#include "barretenberg/sumcheck/sumcheck.hpp"

namespace bb {
Expand Down
Loading