Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
data_copy.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 data_copyImpl {
14 public:
15 using FF = FF_;
16
17 static constexpr std::array<size_t, 34> SUBRELATION_PARTIAL_LENGTHS = { 3, 3, 3, 3, 3, 3, 5, 3, 4, 3, 3, 3,
18 3, 3, 3, 4, 5, 4, 6, 3, 5, 3, 4, 5,
19 4, 5, 5, 6, 5, 5, 6, 3, 3, 3 };
20
21 template <typename AllEntities> inline static bool skip(const AllEntities& in)
22 {
23 using C = ColumnAndShifts;
24
25 const auto data_copy_SEL = in.get(C::data_copy_sel_rd_copy) + in.get(C::data_copy_sel_cd_copy);
26
27 return (data_copy_SEL).is_zero();
28 }
29
30 template <typename ContainerOverSubrelations, typename AllEntities>
31 void static accumulate(ContainerOverSubrelations& evals,
32 const AllEntities& in,
33 [[maybe_unused]] const RelationParameters<FF>&,
34 [[maybe_unused]] const FF& scaling_factor);
35};
36
37template <typename FF> class data_copy : public Relation<data_copyImpl<FF>> {
38 public:
39 static constexpr const std::string_view NAME = "data_copy";
40
41 // Subrelation indices constants, to be used in tests.
42 static constexpr size_t SR_TOP_LEVEL_COND = 6;
43 static constexpr size_t SR_START_AFTER_END = 15;
44 static constexpr size_t SR_ZERO_SIZED_WRITE = 16;
45 static constexpr size_t SR_END_IF_WRITE_IS_ZERO = 17;
46 static constexpr size_t SR_END_WRITE_CONDITION = 18;
47 static constexpr size_t SR_END_ON_ERR = 19;
48 static constexpr size_t SR_INIT_READS_LEFT = 20;
49 static constexpr size_t SR_DECR_COPY_SIZE = 22;
50 static constexpr size_t SR_INCR_WRITE_ADDR = 23;
51 static constexpr size_t SR_INIT_READ_ADDR = 24;
52 static constexpr size_t SR_INCR_READ_ADDR = 25;
53 static constexpr size_t SR_DECR_READ_COUNT = 26;
54 static constexpr size_t SR_PADDING_CONDITION = 27;
55 static constexpr size_t SR_PAD_VALUE = 29;
56 static constexpr size_t SR_CD_COPY_COLUMN = 30;
57
58 static std::string get_subrelation_label(size_t index)
59 {
60 switch (index) {
62 return "TOP_LEVEL_COND";
64 return "START_AFTER_END";
66 return "ZERO_SIZED_WRITE";
68 return "END_IF_WRITE_IS_ZERO";
70 return "END_WRITE_CONDITION";
71 case SR_END_ON_ERR:
72 return "END_ON_ERR";
74 return "INIT_READS_LEFT";
76 return "DECR_COPY_SIZE";
78 return "INCR_WRITE_ADDR";
80 return "INIT_READ_ADDR";
82 return "INCR_READ_ADDR";
84 return "DECR_READ_COUNT";
86 return "PADDING_CONDITION";
87 case SR_PAD_VALUE:
88 return "PAD_VALUE";
90 return "CD_COPY_COLUMN";
91 }
92 return std::to_string(index);
93 }
94};
95
96} // namespace bb::avm2
A wrapper for Relations to expose methods used by the Sumcheck prover or verifier to add the contribu...
static constexpr size_t SR_TOP_LEVEL_COND
Definition data_copy.hpp:42
static constexpr const std::string_view NAME
Definition data_copy.hpp:39
static constexpr size_t SR_PAD_VALUE
Definition data_copy.hpp:55
static constexpr size_t SR_END_IF_WRITE_IS_ZERO
Definition data_copy.hpp:45
static constexpr size_t SR_INCR_READ_ADDR
Definition data_copy.hpp:52
static constexpr size_t SR_ZERO_SIZED_WRITE
Definition data_copy.hpp:44
static constexpr size_t SR_END_WRITE_CONDITION
Definition data_copy.hpp:46
static constexpr size_t SR_DECR_READ_COUNT
Definition data_copy.hpp:53
static constexpr size_t SR_START_AFTER_END
Definition data_copy.hpp:43
static constexpr size_t SR_INIT_READS_LEFT
Definition data_copy.hpp:48
static constexpr size_t SR_INCR_WRITE_ADDR
Definition data_copy.hpp:50
static constexpr size_t SR_INIT_READ_ADDR
Definition data_copy.hpp:51
static constexpr size_t SR_DECR_COPY_SIZE
Definition data_copy.hpp:49
static constexpr size_t SR_END_ON_ERR
Definition data_copy.hpp:47
static constexpr size_t SR_CD_COPY_COLUMN
Definition data_copy.hpp:56
static constexpr size_t SR_PADDING_CONDITION
Definition data_copy.hpp:54
static std::string get_subrelation_label(size_t index)
Definition data_copy.hpp:58
static void accumulate(ContainerOverSubrelations &evals, const AllEntities &in, const RelationParameters< FF > &, const FF &scaling_factor)
static bool skip(const AllEntities &in)
Definition data_copy.hpp:21
static constexpr std::array< size_t, 34 > SUBRELATION_PARTIAL_LENGTHS
Definition data_copy.hpp:17
ColumnAndShifts
Definition columns.hpp:34
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.