Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
scalar_mul.hpp
Go to the documentation of this file.
1// AUTOGENERATED FILE
2#pragma once
3
4#include <string_view>
5
10
11namespace bb::avm2 {
12
13template <typename FF_> class scalar_mulImpl {
14 public:
15 using FF = FF_;
16
17 static constexpr std::array<size_t, 29> SUBRELATION_PARTIAL_LENGTHS = { 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3,
18 3, 3, 3, 3, 2, 2, 2, 4, 4, 4, 3, 4, 4, 4 };
19
20 template <typename AllEntities> inline static bool skip(const AllEntities& in)
21 {
22 using C = ColumnAndShifts;
23
24 return (in.get(C::scalar_mul_sel)).is_zero();
25 }
26
27 template <typename ContainerOverSubrelations, typename AllEntities>
28 void static accumulate(ContainerOverSubrelations& evals,
29 const AllEntities& in,
30 [[maybe_unused]] const RelationParameters<FF>&,
31 [[maybe_unused]] const FF& scaling_factor);
32};
33
34template <typename FF> class scalar_mul : public Relation<scalar_mulImpl<FF>> {
35 public:
36 static constexpr const std::string_view NAME = "scalar_mul";
37
38 // Subrelation indices constants, to be used in tests.
39 static constexpr size_t SR_START_AFTER_LATCH = 4;
40 static constexpr size_t SR_SELECTOR_ON_START_OR_END = 5;
41 static constexpr size_t SR_SELECTOR_CONSISTENCY = 6;
42 static constexpr size_t SR_INPUT_CONSISTENCY_X = 8;
43 static constexpr size_t SR_INPUT_CONSISTENCY_Y = 9;
44 static constexpr size_t SR_INPUT_CONSISTENCY_INF = 10;
45 static constexpr size_t SR_INPUT_CONSISTENCY_SCALAR = 11;
46 static constexpr size_t SR_DECREMENT_INDEX = 14;
47
48 static std::string get_subrelation_label(size_t index)
49 {
50 switch (index) {
52 return "START_AFTER_LATCH";
54 return "SELECTOR_ON_START_OR_END";
56 return "SELECTOR_CONSISTENCY";
58 return "INPUT_CONSISTENCY_X";
60 return "INPUT_CONSISTENCY_Y";
62 return "INPUT_CONSISTENCY_INF";
64 return "INPUT_CONSISTENCY_SCALAR";
66 return "DECREMENT_INDEX";
67 }
68 return std::to_string(index);
69 }
70};
71
72} // namespace bb::avm2
A wrapper for Relations to expose methods used by the Sumcheck prover or verifier to add the contribu...
static std::string get_subrelation_label(size_t index)
static constexpr size_t SR_INPUT_CONSISTENCY_X
static constexpr const std::string_view NAME
static constexpr size_t SR_SELECTOR_ON_START_OR_END
static constexpr size_t SR_INPUT_CONSISTENCY_INF
static constexpr size_t SR_SELECTOR_CONSISTENCY
static constexpr size_t SR_START_AFTER_LATCH
static constexpr size_t SR_DECREMENT_INDEX
static constexpr size_t SR_INPUT_CONSISTENCY_Y
static constexpr size_t SR_INPUT_CONSISTENCY_SCALAR
static void accumulate(ContainerOverSubrelations &evals, const AllEntities &in, const RelationParameters< FF > &, const FF &scaling_factor)
static bool skip(const AllEntities &in)
static constexpr std::array< size_t, 29 > SUBRELATION_PARTIAL_LENGTHS
AvmFlavorSettings::FF FF
Definition field.hpp:10
ColumnAndShifts
Definition columns.hpp:34
std::string to_string(bb::avm2::ValueTag tag)
Container for parameters used by the grand product (permutation, lookup) Honk relations.