|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
Bilinear / batched-eq custom gate (Mega flavors only). More...
#include <bilinear_or_batched_eq_check_relation.hpp>
Public Types | |
| using | FF = FF_ |
Static Public Member Functions | |
| template<typename AllEntities > | |
| static bool | skip (const AllEntities &in) |
| template<typename ContainerOverSubrelations , typename AllEntities , typename Parameters > | |
| static void | accumulate (ContainerOverSubrelations &evals, const AllEntities &in, BB_UNUSED const Parameters ¶ms, const FF &scaling_factor) |
Static Public Attributes | |
| static constexpr std::array< size_t, 2 > | SUBRELATION_PARTIAL_LENGTHS { 6, 5 } |
Bilinear / batched-eq custom gate (Mega flavors only).
One precomputed selector q_bilinear_batched_eq ∈ {0, 1, 2} multiplexes two row-modes:
The second product uses the q_5 selector, which is committed only in the Mega flavors (shared with the poseidon2-quad relations), so this relation is part of the Mega flavors only.
Two subrelations:
Subrelation 1: q_cp · (2 − q_cp) · (q_m·w_l·w_r + q_5·w_l·w_o + q_l·w_l + q_r·w_r + q_o·w_o + q_4·w_4 + q_c)
Subrelation 2: q_cp · (q_cp − 1) · (q_o · w_o + q_4 · w_4 + q_m)
Mode evaluation:
The BATCHED_EQ-mode factor of 2 is absorbed by scaling batched_eq_half_1 and batched_eq_half_2 by half inside the relation, so the builder writes q_l..q_5, q_c, q_m raw — no caller-side scaling. BILINEAR mode is gated by q_cp·(2−q_cp), which evaluates to 1 at q_cp = 1, so its selectors are also written raw.
Trace placement: shares the existing arithmetic block (q_arith and q_bilinear_batched_eq are mutually exclusive per row — set_gate_selector(GateKind::BilinearBatchedEq, …) zeros q_arith and vice versa).
Partial lengths:
Definition at line 57 of file bilinear_or_batched_eq_check_relation.hpp.
| using bb::BilinearOrBatchedEqCheckRelationImpl< FF_ >::FF = FF_ |
Definition at line 59 of file bilinear_or_batched_eq_check_relation.hpp.
|
inlinestatic |
| evals | transformed to evals + C(in(X)...)*scaling_factor |
| in | Inputs to the relation algebra |
| parameters | Unused in this relation |
| scaling_factor | optional term to scale the evaluation before adding to evals. |
Definition at line 75 of file bilinear_or_batched_eq_check_relation.hpp.
|
inlinestatic |
Definition at line 63 of file bilinear_or_batched_eq_check_relation.hpp.
|
staticconstexpr |
Definition at line 61 of file bilinear_or_batched_eq_check_relation.hpp.