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: Planned, auditors: [], commit: }
3// external_1: { status: not started, auditors: [], commit: }
4// external_2: { status: not started, auditors: [], commit: }
5// =====================
6
7#pragma once
9
10namespace bb {
11
40template <typename FF>
41template <typename ContainerOverSubrelations, typename AllEntities, typename Parameters>
42void TranslatorPermutationRelationImpl<FF>::accumulate(ContainerOverSubrelations& accumulators,
43 const AllEntities& in,
44 const Parameters& params,
45 const FF& scaling_factor)
46{
47 [&]() {
49 using View = typename Accumulator::View;
50
51 const auto z_perm = View(in.z_perm);
52 const auto z_perm_shift = View(in.z_perm_shift);
53 const auto lagrange_first = View(in.lagrange_first);
54 const auto lagrange_last = View(in.lagrange_last);
55
56 // Contribution (1)
57 std::get<0>(accumulators) +=
58 (((z_perm + lagrange_first) * compute_grand_product_numerator<Accumulator>(in, params)) -
59 ((z_perm_shift + lagrange_last) * compute_grand_product_denominator<Accumulator>(in, params))) *
60 scaling_factor;
61 }();
62
63 [&]() {
65 using View = typename Accumulator::View;
66
67 const auto z_perm_shift = View(in.z_perm_shift);
68 const auto lagrange_last = View(in.lagrange_last);
69
70 // Contribution (2)
71 std::get<1>(accumulators) += (lagrange_last * z_perm_shift) * scaling_factor;
72 }();
73};
74} // 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.
Definition api.hpp:5
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13