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
38template <typename FF>
39template <typename ContainerOverSubrelations, typename AllEntities, typename Parameters>
40void TranslatorPermutationRelationImpl<FF>::accumulate(ContainerOverSubrelations& accumulators,
41 const AllEntities& in,
42 const Parameters& params,
43 const FF& scaling_factor)
44{
45 [&]() {
47 using View = typename Accumulator::View;
48
49 const auto z_perm = View(in.z_perm);
50 const auto z_perm_shift = View(in.z_perm_shift);
51 const auto lagrange_first = View(in.lagrange_first);
52 const auto lagrange_last = View(in.lagrange_last);
53
54 // Contribution (1)
55 std::get<0>(accumulators) +=
56 (((z_perm + lagrange_first) * compute_grand_product_numerator<Accumulator>(in, params)) -
57 ((z_perm_shift + lagrange_last) * compute_grand_product_denominator<Accumulator>(in, params))) *
58 scaling_factor;
59 }();
60
61 [&]() {
63 using View = typename Accumulator::View;
64
65 const auto z_perm_shift = View(in.z_perm_shift);
66 const auto lagrange_last = View(in.lagrange_last);
67
68 // Contribution (2)
69 std::get<1>(accumulators) += (lagrange_last * z_perm_shift) * scaling_factor;
70 }();
71};
72} // 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