Skip to content

Commit

Permalink
A few comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Rumata888 committed Dec 6, 2023
1 parent a1801df commit 6098063
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@

namespace proof_system {

/**
* @brief Circuit builder for the ToyAVM that is used to explain generic permutation settings
*
* @tparam Flavor
*/
template <typename Flavor> class ToyAVMCircuitBuilder {
public:
using FF = Flavor::FF;
Expand Down Expand Up @@ -55,13 +60,15 @@ template <typename Flavor> class ToyAVMCircuitBuilder {
polys.lagrange_first[0] = 1;

for (size_t i = 0; i < num_gates; ++i) {
// Fill out the witness polynomials
polys.permutation_set_column_1[i] = wires[0][i];
polys.permutation_set_column_2[i] = wires[1][i];
polys.permutation_set_column_3[i] = wires[2][i];
polys.permutation_set_column_4[i] = wires[3][i];
polys.self_permutation_column[i] = wires[4][i];
// By default the permutation is over all rows where we place data
polys.enable_tuple_set_permutation[i] = 1;
// The same column permutation alternates between even and odd values
polys.enable_single_column_permutation[i] = 1;
polys.enable_first_set_permutation[i] = i & 1;
polys.enable_second_set_permutation[i] = 1 - (i & 1);
Expand Down Expand Up @@ -90,8 +97,10 @@ template <typename Flavor> class ToyAVMCircuitBuilder {
.eccvm_set_permutation_delta = 0,
};

// Compute polynomial values
auto polynomials = compute_polynomials();
const size_t num_rows = polynomials.get_polynomial_size();

// Check the tuple permutation relation
proof_system::honk::logderivative_library::compute_logderivative_inverse<
Flavor,
Expand All @@ -115,6 +124,7 @@ template <typename Flavor> class ToyAVMCircuitBuilder {
return false;
}
}
// Check the single permutation relation
proof_system::honk::logderivative_library::compute_logderivative_inverse<
Flavor,
honk::sumcheck::GenericPermutationRelation<honk::sumcheck::ExampleSameWirePermutationSettings, FF>>(
Expand Down

0 comments on commit 6098063

Please sign in to comment.