Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
ecc_wnaf_short_relation.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
8
12
13namespace bb {
14
15template <typename FF_> class ECCVMWnafShortRelationImpl : public ECCVMWnafRelationImpl<FF_> {
16 public:
17 using FF = FF_;
19
20 // Tightened partial lengths per actual subrelation degree. The base relation declares all 5; many subrelations
21 // are deg 2 or deg 3 and only need partial length 3 or 4. The deepest (RANGE_S* and FIRST_SLICE_POSITIVE) stay
22 // at 5, so MAX_PARTIAL_RELATION_LENGTH at the flavor level is unchanged.
23 static constexpr std::array<size_t, Base::NUM_SUBRELATIONS> SUBRELATION_PARTIAL_LENGTHS{
24 5, 5, 5, 5, 5, 5, 5, 5, // RANGE_S1HI..RANGE_S4LO (deg 4)
25 4, // SCALAR_SUM_CHECK (deg 3)
26 4, // ROUND_CHECK (deg 3)
27 4, // ROUND_SHIFT_ZERO (deg 3)
28 4, // SCALAR_SUM_SHIFT_ZERO (deg 3)
29 4, // PC_CHECK (deg 3)
30 4, // SKEW_RANGE (deg 3)
31 3, 3, 3, 3, // INACTIVE_SLICE_W0..W3 (deg 2)
32 3, // INACTIVE_ROUND (deg 2)
33 3, // INACTIVE_PC (deg 2)
34 5, // FIRST_SLICE_POSITIVE (deg 4)
35 3, // INACTIVE_POINT_TRANSITION (deg 2)
36 4, // PRECOMPUTE_SELECT_SHAPE (deg 3)
37 };
39
68 template <typename AllEntities> inline static bool skip(const AllEntities& in)
69 {
70 return (in.precompute_select + in.precompute_select_shift).is_zero();
71 }
72
73 template <typename ContainerOverSubrelations, typename AllEntities, typename Parameters>
74 static void accumulate(ContainerOverSubrelations& accumulator,
75 const AllEntities& in,
76 const Parameters& params,
77 const FF& scaling_factor);
78};
79
81
82} // namespace bb
ECCVMWnafRelationImpl evaluates relations that convert scalar multipliers into 4-bit WNAF slices.
static bool skip(const AllEntities &in)
Skip rows on which every subrelation contributes the identically-zero polynomial.
static constexpr std::array< size_t, Base::NUM_SUBRELATIONS > SUBRELATION_PARTIAL_LENGTHS
static void accumulate(ContainerOverSubrelations &accumulator, const AllEntities &in, const Parameters &params, const FF &scaling_factor)
A wrapper for Relations to expose methods used by the Sumcheck prover or verifier to add the contribu...
Entry point for Barretenberg command-line interface.
Definition api.hpp:5