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, 35> SUBRELATION_PARTIAL_LENGTHS = { 3, 3, 3, 3, 3, 3, 5, 3, 4, 3, 3, 3,
18 3, 3, 3, 3, 3, 4, 5, 4, 7, 3, 5, 4,
19 4, 5, 4, 5, 5, 7, 6, 6, 7, 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 static std::string get_subrelation_label(size_t index)
42 {
43 switch (index) {
44 case 6:
45 return "TOP_LEVEL_COND";
46 case 17:
47 return "START_AFTER_END";
48 case 18:
49 return "ZERO_SIZED_WRITE";
50 case 19:
51 return "END_IF_WRITE_IS_ZERO";
52 case 20:
53 return "END_WRITE_CONDITION";
54 case 21:
55 return "END_ON_ERR";
56 case 22:
57 return "INIT_READS_LEFT";
58 case 24:
59 return "DECR_COPY_SIZE";
60 case 25:
61 return "INCR_WRITE_ADDR";
62 case 26:
63 return "INIT_READ_ADDR";
64 case 27:
65 return "INCR_READ_ADDR";
66 case 28:
67 return "DECR_READ_COUNT";
68 case 29:
69 return "PADDING_CONDITION";
70 case 31:
71 return "PAD_VALUE";
72 case 32:
73 return "CD_COPY_COLUMN";
74 }
75 return std::to_string(index);
76 }
77
78 // Subrelation indices constants, to be used in tests.
79 static constexpr size_t SR_TOP_LEVEL_COND = 6;
80 static constexpr size_t SR_START_AFTER_END = 17;
81 static constexpr size_t SR_ZERO_SIZED_WRITE = 18;
82 static constexpr size_t SR_END_IF_WRITE_IS_ZERO = 19;
83 static constexpr size_t SR_END_WRITE_CONDITION = 20;
84 static constexpr size_t SR_END_ON_ERR = 21;
85 static constexpr size_t SR_INIT_READS_LEFT = 22;
86 static constexpr size_t SR_DECR_COPY_SIZE = 24;
87 static constexpr size_t SR_INCR_WRITE_ADDR = 25;
88 static constexpr size_t SR_INIT_READ_ADDR = 26;
89 static constexpr size_t SR_INCR_READ_ADDR = 27;
90 static constexpr size_t SR_DECR_READ_COUNT = 28;
91 static constexpr size_t SR_PADDING_CONDITION = 29;
92 static constexpr size_t SR_PAD_VALUE = 31;
93 static constexpr size_t SR_CD_COPY_COLUMN = 32;
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:79
static constexpr const std::string_view NAME
Definition data_copy.hpp:39
static constexpr size_t SR_PAD_VALUE
Definition data_copy.hpp:92
static constexpr size_t SR_END_IF_WRITE_IS_ZERO
Definition data_copy.hpp:82
static constexpr size_t SR_INCR_READ_ADDR
Definition data_copy.hpp:89
static constexpr size_t SR_ZERO_SIZED_WRITE
Definition data_copy.hpp:81
static constexpr size_t SR_END_WRITE_CONDITION
Definition data_copy.hpp:83
static constexpr size_t SR_DECR_READ_COUNT
Definition data_copy.hpp:90
static constexpr size_t SR_START_AFTER_END
Definition data_copy.hpp:80
static constexpr size_t SR_INIT_READS_LEFT
Definition data_copy.hpp:85
static constexpr size_t SR_INCR_WRITE_ADDR
Definition data_copy.hpp:87
static constexpr size_t SR_INIT_READ_ADDR
Definition data_copy.hpp:88
static constexpr size_t SR_DECR_COPY_SIZE
Definition data_copy.hpp:86
static constexpr size_t SR_END_ON_ERR
Definition data_copy.hpp:84
static constexpr size_t SR_CD_COPY_COLUMN
Definition data_copy.hpp:93
static constexpr size_t SR_PADDING_CONDITION
Definition data_copy.hpp:91
static std::string get_subrelation_label(size_t index)
Definition data_copy.hpp:41
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, 35 > SUBRELATION_PARTIAL_LENGTHS
Definition data_copy.hpp:17
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.