Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
folding_test_utils.hpp
Go to the documentation of this file.
1// === AUDIT STATUS ===
2// internal: { status: not started, auditors: [], date: YYYY-MM-DD }
3// external_1: { status: not started, auditors: [], date: YYYY-MM-DD }
4// external_2: { status: not started, auditors: [], date: YYYY-MM-DD }
5// =====================
6
13
14namespace bb {
15
23template <typename Flavor>
24static bool check_accumulator_target_sum_manual(const std::shared_ptr<DeciderProvingKey_<Flavor>>& accumulator)
25{
26 using DeciderProvingKeys = DeciderProvingKeys_<Flavor, 2>;
27 using PGInternal = ProtogalaxyProverInternal<DeciderProvingKeys>;
28
29 const size_t accumulator_size = accumulator->dyadic_size();
30 PGInternal pg_internal;
31 const auto expected_honk_evals = pg_internal.compute_row_evaluations(
32 accumulator->polynomials, accumulator->alphas, accumulator->relation_parameters);
33 // Construct pow(\vec{betas*}) as in the paper
34 GateSeparatorPolynomial expected_gate_separators(accumulator->gate_challenges, accumulator->gate_challenges.size());
35
36 // Compute the corresponding target sum and create a dummy accumulator
37 typename Flavor::FF expected_target_sum{ 0 };
38 for (size_t idx = 0; idx < accumulator_size; idx++) {
39 expected_target_sum += expected_honk_evals[idx] * expected_gate_separators[idx];
40 }
41 return accumulator->target_sum == expected_target_sum;
42}
43} // namespace bb
typename Curve::ScalarField FF
GateSeparatorPolynomial(const std::vector< FF > &betas, const size_t log_num_monomials)
Construct a new GateSeparatorPolynomial.
Entry point for Barretenberg command-line interface.