Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
translator_permutation_relation_impl.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
9
10namespace bb {
11
35template <typename FF>
36template <typename ContainerOverSubrelations, typename AllEntities, typename Parameters>
37void TranslatorPermutationRelationImpl<FF>::accumulate(ContainerOverSubrelations& accumulators,
38 const AllEntities& in,
39 const Parameters& params,
40 const FF& scaling_factor)
41{
42 [&]() {
44 using View = typename Accumulator::View;
45
46 const auto z_perm = View(in.z_perm);
47 const auto z_perm_shift = View(in.z_perm_shift);
48 const auto lagrange_first = View(in.lagrange_first);
49 const auto lagrange_last = View(in.lagrange_last);
50
51 // Contribution (1)
52 std::get<0>(accumulators) +=
53 (((z_perm + lagrange_first) * compute_grand_product_numerator<Accumulator>(in, params)) -
54 ((z_perm_shift + lagrange_last) * compute_grand_product_denominator<Accumulator>(in, params))) *
55 scaling_factor;
56 }();
57
58 [&]() {
60 using View = typename Accumulator::View;
61
62 const auto z_perm_shift = View(in.z_perm_shift);
63 const auto lagrange_last = View(in.lagrange_last);
64
65 // Contribution (2)
66 std::get<1>(accumulators) += (lagrange_last * z_perm_shift) * scaling_factor;
67 }();
68};
69} // namespace bb
static void accumulate(ContainerOverSubrelations &accumulators, const AllEntities &in, const Parameters &params, const FF &scaling_factor)
Compute contribution of the goblin translator permutation relation for a given edge (internal functio...
Entry point for Barretenberg command-line interface.
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13