Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
poseidon2_perm.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <string_view>
4
8
9namespace bb::avm2 {
10
11template <typename FF_> class optimized_poseidon2_permImpl {
12 public:
13 using FF = FF_;
14
15 static constexpr std::array<size_t, 100> SUBRELATION_PARTIAL_LENGTHS = {
16 3, 3, 3, 3, 3, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
17 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
18 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 3, 3, 3, 3
19 };
20
21 template <typename AllEntities> inline static bool skip(const AllEntities& in)
22 {
23 using C = ColumnAndShifts;
24 return (in.get(C::poseidon2_perm_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 optimized_poseidon2_perm : public Relation<optimized_poseidon2_permImpl<FF>> {
35 public:
36 static constexpr const std::string_view NAME = "poseidon2_perm";
37
38 static std::string get_subrelation_label(size_t index)
39 {
40#ifdef AVM_INCLUDE_COLUMN_INFORMATION
41 switch (index) {}
42#endif
43 return std::to_string(index);
44 }
45};
46
47} // 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 const std::string_view NAME
static constexpr std::array< size_t, 100 > SUBRELATION_PARTIAL_LENGTHS
static bool skip(const AllEntities &in)
static void accumulate(ContainerOverSubrelations &evals, const AllEntities &in, const RelationParameters< FF > &, const FF &scaling_factor)
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.