Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
ecc_wnaf_relation.hpp
Go to the documentation of this file.
1// === AUDIT STATUS ===
2// internal: { status: Complete, auditors: [Raju], commit: 2a49eb6 }
3// external_1: { status: not started, auditors: [], commit: }
4// external_2: { status: not started, auditors: [], commit: }
5// =====================
6
7#pragma once
9
10namespace bb {
43template <typename FF_> class ECCVMWnafRelationImpl {
44 public:
45 using FF = FF_;
46
47 // Named subrelation indices — matches SUBRELATION_PARTIAL_LENGTHS ordering.
48 enum SubrelationIndex : size_t {
49 // Range checks: each 2-bit slice is in {0, 1, 2, 3}
58 // Scalar sum accumulation: check slice consistency across rows
60 // Round transition: combined round increment / round==7 check
62 // Round shift must be 0 at transition or first row
64 // Scalar sum shift must be 0 at transition or first row
66 // PC transition: combined pc decrement / pc propagation
68 // Skew is 0 or 7
70 // When precompute_select == 0: force slices to zero (w0)
72 // When precompute_select == 0: force slices to zero (w1)
74 // When precompute_select == 0: force slices to zero (w2)
76 // When precompute_select == 0: force slices to zero (w3)
78 // When precompute_select == 0: force round to zero
80 // When precompute_select == 0: force pc to zero
82 // First slice positive: s1hi_shift >= 2 at transitions
84 // When precompute_select == 0: force point_transition to zero
86 // Precompute select shape: monotonically non-decreasing after first row
89 };
90
91 static constexpr std::array<size_t, 23> SUBRELATION_PARTIAL_LENGTHS{ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
92 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 };
93 static_assert(NUM_SUBRELATIONS == SUBRELATION_PARTIAL_LENGTHS.size());
94
95 template <typename ContainerOverSubrelations, typename AllEntities, typename Parameters>
96 static void accumulate(ContainerOverSubrelations& accumulator,
97 const AllEntities& in,
98 const Parameters& /* unused */,
99 const FF& scaling_factor);
100};
101
103
104} // namespace bb
ECCVMWnafRelationImpl evaluates relations that convert scalar multipliers into 4-bit WNAF slices.
static constexpr std::array< size_t, 23 > SUBRELATION_PARTIAL_LENGTHS
static void accumulate(ContainerOverSubrelations &accumulator, const AllEntities &in, const Parameters &, const FF &scaling_factor)
ECCVMWnafRelationImpl evaluates relations that convert scalar multipliers into 4-bit WNAF slices.
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