Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
prover_verifier_shared.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
7#pragma once
8#include <vector>
9namespace bb {
10
15template <typename FF>
16std::vector<FF> update_gate_challenges(const FF& perturbator_challenge,
17 const std::vector<FF>& gate_challenges,
18 const std::vector<FF>& init_challenges)
19{
21 gate_challenges.size(), init_challenges.size(), "gate_challenges and init_challenges must have same size");
22 const size_t num_challenges = gate_challenges.size();
23 std::vector<FF> next_gate_challenges(num_challenges);
24
25 for (size_t idx = 0; idx < num_challenges; idx++) {
26 next_gate_challenges[idx] = gate_challenges[idx] + perturbator_challenge * init_challenges[idx];
27 }
28 return next_gate_challenges;
29}
30
41template <typename FF> static FF evaluate_perturbator(std::vector<FF> coeffs, FF point)
42{
43 FF point_acc = FF(1);
44 FF result = FF(0);
45 for (size_t i = 0; i < coeffs.size(); i++) {
46 result += coeffs[i] * point_acc;
47 point_acc *= point;
48 }
49 return result;
50};
51} // namespace bb
#define BB_ASSERT_EQ(actual, expected,...)
Definition assert.hpp:59
Entry point for Barretenberg command-line interface.
typename Flavor::FF FF
std::vector< FF > update_gate_challenges(const FF &perturbator_challenge, const std::vector< FF > &gate_challenges, const std::vector< FF > &init_challenges)
Compute the gate challenges used in the combiner calculation.