Skip to content

Commit

Permalink
- Add include guard to blake3
Browse files Browse the repository at this point in the history
- Remove zeta,alpha from relation_params
- remove manifest input from prover and verifier
- remove oracle and wrapper
- reinstate pcs types test
- add new transcript
- adapt pcs to transcript
- add public inputs and rel_param to prover key
- sumcheck returns an output
- sumcheck verifier does not depend on sumcheck round
  • Loading branch information
adr1anh committed Mar 3, 2023
1 parent 09db0be commit 9274dc0
Show file tree
Hide file tree
Showing 32 changed files with 803 additions and 1,277 deletions.
2 changes: 1 addition & 1 deletion cpp/src/aztec/crypto/blake3s/blake3s.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
Also, the length of the output in this specific implementation is fixed at 32 bytes which is the only
version relevant to Barretenberg.
*/

#pragma once
#include <stddef.h>
#include <stdint.h>
#include <vector>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,7 @@ template <typename CircuitConstructor>
StandardVerifier ComposerHelper<CircuitConstructor>::create_verifier(const CircuitConstructor& circuit_constructor)
{
compute_verification_key(circuit_constructor);
StandardVerifier output_state(
circuit_verification_key,
honk::StandardHonk::create_manifest(circuit_constructor.public_inputs.size(),
numeric::get_msb(circuit_verification_key->circuit_size)));
StandardVerifier output_state(circuit_verification_key);

// TODO(Cody): This should be more generic
auto kate_verification_key = std::make_unique<pcs::kzg::VerificationKey>("../srs_db/ignition");
Expand All @@ -242,9 +239,7 @@ StandardProver ComposerHelper<CircuitConstructor>::create_prover(const CircuitCo
compute_proving_key(circuit_constructor);
compute_witness(circuit_constructor);

size_t num_sumcheck_rounds(circuit_proving_key->log_circuit_size);
auto manifest = Flavor::create_manifest(circuit_constructor.public_inputs.size(), num_sumcheck_rounds);
StandardProver output_state(std::move(wire_polynomials), circuit_proving_key, manifest);
StandardProver output_state(std::move(wire_polynomials), circuit_proving_key);

// TODO(Cody): This should be more generic
std::unique_ptr<pcs::kzg::CommitmentKey> kate_commitment_key =
Expand Down
10 changes: 4 additions & 6 deletions cpp/src/aztec/honk/composer/standard_honk_composer.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <cstdint>
#include <honk/proof_system/prover.hpp>
#include <honk/sumcheck/sumcheck_round.hpp>
#include <honk/sumcheck/relations/arithmetic_relation.hpp>
#include <honk/sumcheck/relations/grand_product_computation_relation.hpp>
#include <honk/sumcheck/relations/grand_product_initialization_relation.hpp>
#include <honk/utils/public_inputs.hpp>
Expand Down Expand Up @@ -335,16 +336,13 @@ TEST(StandardHonkComposer, SumcheckRelationCorrectness)
// Generate beta and gamma
fr beta = fr::random_element();
fr gamma = fr::random_element();
fr zeta = fr::random_element();

// Compute public input delta
const auto public_inputs = composer.circuit_constructor.get_public_inputs();
auto public_input_delta =
honk::compute_public_input_delta<fr>(public_inputs, beta, gamma, prover.key->circuit_size);

sumcheck::RelationParameters<fr> params{
.zeta = zeta,
.alpha = fr::one(),
.beta = beta,
.gamma = gamma,
.public_input_delta = public_input_delta,
Expand Down Expand Up @@ -397,13 +395,13 @@ TEST(StandardHonkComposer, SumcheckRelationCorrectness)
// i-th row/vertex of the hypercube.
// We use ASSERT_EQ instead of EXPECT_EQ so that the tests stops at the first index at which the result is not
// 0, since result = 0 + C(transposed), which we expect will equal 0.
std::get<0>(relations).add_full_relation_value_contribution(result, evaluations_at_index_i, params);
result = std::get<0>(relations).evaluate_full_relation_value_contribution(evaluations_at_index_i, params);
ASSERT_EQ(result, 0);

std::get<1>(relations).add_full_relation_value_contribution(result, evaluations_at_index_i, params);
result = std::get<1>(relations).evaluate_full_relation_value_contribution(evaluations_at_index_i, params);
ASSERT_EQ(result, 0);

std::get<2>(relations).add_full_relation_value_contribution(result, evaluations_at_index_i, params);
result = std::get<2>(relations).evaluate_full_relation_value_contribution(evaluations_at_index_i, params);
ASSERT_EQ(result, 0);
}
}
Expand Down
274 changes: 0 additions & 274 deletions cpp/src/aztec/honk/oracle/oracle.hpp

This file was deleted.

Loading

0 comments on commit 9274dc0

Please sign in to comment.