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, 32> SUBRELATION_PARTIAL_LENGTHS = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2,
18 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
19 2, 2, 2, 4, 4, 4, 3, 4, 4, 4 };
20
21 template <typename AllEntities> inline static bool skip(const AllEntities& in)
22 {
23 using C = ColumnAndShifts;
24
25 return (in.get(C::scalar_mul_sel)).is_zero();
26 }
27
28 template <typename ContainerOverSubrelations, typename AllEntities>
29 void static accumulate(ContainerOverSubrelations& evals,
30 const AllEntities& in,
31 [[maybe_unused]] const RelationParameters<FF>&,
32 [[maybe_unused]] const FF& scaling_factor);
33};
34
35template <typename FF> class scalar_mul : public Relation<scalar_mulImpl<FF>> {
36 public:
37 static constexpr const std::string_view NAME = "scalar_mul";
38
39 static std::string get_subrelation_label(size_t index)
40 {
41 switch (index) {
42 case 5:
43 return "START_AFTER_LATCH";
44 case 6:
45 return "SELECTOR_ON_START";
46 case 7:
47 return "SELECTOR_CONSISTENCY";
48 case 11:
49 return "INPUT_CONSISTENCY_X";
50 case 12:
51 return "INPUT_CONSISTENCY_Y";
52 case 13:
53 return "INPUT_CONSISTENCY_INF";
54 case 14:
55 return "INPUT_CONSISTENCY_SCALAR";
56 }
57 return std::to_string(index);
58 }
59
60 // Subrelation indices constants, to be used in tests.
61 static constexpr size_t SR_START_AFTER_LATCH = 5;
62 static constexpr size_t SR_SELECTOR_ON_START = 6;
63 static constexpr size_t SR_SELECTOR_CONSISTENCY = 7;
64 static constexpr size_t SR_INPUT_CONSISTENCY_X = 11;
65 static constexpr size_t SR_INPUT_CONSISTENCY_Y = 12;
66 static constexpr size_t SR_INPUT_CONSISTENCY_INF = 13;
67 static constexpr size_t SR_INPUT_CONSISTENCY_SCALAR = 14;
68};
69
70} // 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_INPUT_CONSISTENCY_INF
static constexpr size_t SR_SELECTOR_CONSISTENCY
static constexpr size_t SR_START_AFTER_LATCH
static constexpr size_t SR_SELECTOR_ON_START
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 constexpr std::array< size_t, 32 > SUBRELATION_PARTIAL_LENGTHS
static bool skip(const AllEntities &in)
ColumnAndShifts
Definition columns.hpp:35
AvmFlavorSettings::FF FF
Definition field.hpp:10
std::string to_string(bb::avm2::ValueTag tag)
Container for parameters used by the grand product (permutation, lookup) Honk relations.