Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
to_radix.hpp
Go to the documentation of this file.
1// AUTOGENERATED FILE
2#pragma once
3
4#include <string_view>
5
9
10namespace bb::avm2 {
11
12template <typename FF_> class to_radixImpl {
13 public:
14 using FF = FF_;
15
16 static constexpr std::array<size_t, 37> SUBRELATION_PARTIAL_LENGTHS = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 5, 3,
17 3, 3, 3, 3, 4, 5, 4, 3, 3, 5, 3, 3, 3,
18 3, 3, 3, 3, 5, 3, 4, 3, 3, 3, 3 };
19
20 template <typename AllEntities> inline static bool skip(const AllEntities& in)
21 {
22 using C = ColumnAndShifts;
23
24 return (in.get(C::to_radix_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 to_radix : public Relation<to_radixImpl<FF>> {
35 public:
36 static constexpr const std::string_view NAME = "to_radix";
37
38 // Subrelation indices constants, to be used in tests.
39 static constexpr size_t SR_SEL_ON_START_OR_END = 4;
40 static constexpr size_t SR_TRACE_CONTINUITY = 5;
41 static constexpr size_t SR_START_AFTER_LATCH = 6;
42 static constexpr size_t SR_OVERFLOW_CHECK = 33;
43 static constexpr size_t SR_RADIX_CONTINUITY = 34;
44 static constexpr size_t SR_VALUE_CONTINUITY = 35;
45 static constexpr size_t SR_SAFE_LIMBS_CONTINUITY = 36;
46
47 static std::string get_subrelation_label(size_t index)
48 {
49#ifdef AVM_INCLUDE_COLUMN_INFORMATION
50 switch (index) {
52 return "SEL_ON_START_OR_END";
54 return "TRACE_CONTINUITY";
56 return "START_AFTER_LATCH";
58 return "OVERFLOW_CHECK";
60 return "RADIX_CONTINUITY";
62 return "VALUE_CONTINUITY";
64 return "SAFE_LIMBS_CONTINUITY";
65 }
66#endif
67 return std::to_string(index);
68 }
69};
70
71} // 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_TRACE_CONTINUITY
Definition to_radix.hpp:40
static constexpr size_t SR_RADIX_CONTINUITY
Definition to_radix.hpp:43
static constexpr size_t SR_SEL_ON_START_OR_END
Definition to_radix.hpp:39
static constexpr size_t SR_START_AFTER_LATCH
Definition to_radix.hpp:41
static constexpr size_t SR_VALUE_CONTINUITY
Definition to_radix.hpp:44
static constexpr size_t SR_OVERFLOW_CHECK
Definition to_radix.hpp:42
static std::string get_subrelation_label(size_t index)
Definition to_radix.hpp:47
static constexpr size_t SR_SAFE_LIMBS_CONTINUITY
Definition to_radix.hpp:45
static constexpr const std::string_view NAME
Definition to_radix.hpp:36
static void accumulate(ContainerOverSubrelations &evals, const AllEntities &in, const RelationParameters< FF > &, const FF &scaling_factor)
static bool skip(const AllEntities &in)
Definition to_radix.hpp:20
static constexpr std::array< size_t, 37 > SUBRELATION_PARTIAL_LENGTHS
Definition to_radix.hpp:16
AvmFlavorSettings::FF FF
Definition field.hpp:10
ColumnAndShifts
Definition columns.hpp:35
std::string to_string(bb::avm2::ValueTag tag)
Container for parameters used by the grand product (permutation, lookup) Honk relations.