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
9
10namespace bb::avm2 {
11
12template <typename FF_> class optimized_poseidon2_permImpl {
13 public:
14 using FF = FF_;
15
16 static constexpr std::array<size_t, 265> SUBRELATION_PARTIAL_LENGTHS = {
17 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,
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, 7, 7, 7, 7, 7, 7,
19 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,
20 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,
21 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,
22 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,
23 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,
24 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
25 };
26
27 template <typename AllEntities> inline static bool skip(const AllEntities& in)
28 {
29 using C = ColumnAndShifts;
30
31 return (in.get(C::poseidon2_perm_sel)).is_zero();
32 }
33
34 template <typename ContainerOverSubrelations, typename AllEntities>
35 void static accumulate(ContainerOverSubrelations& evals,
36 const AllEntities& in,
37 [[maybe_unused]] const RelationParameters<FF>&,
38 [[maybe_unused]] const FF& scaling_factor);
39};
40
41template <typename FF> class optimized_poseidon2_perm : public Relation<optimized_poseidon2_permImpl<FF>> {
42 public:
43 static constexpr const std::string_view NAME = "poseidon2_perm";
44
45 static std::string get_subrelation_label(size_t index)
46 {
47 switch (index) {}
48 return std::to_string(index);
49 }
50};
51
52} // 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, 265 > SUBRELATION_PARTIAL_LENGTHS
static bool skip(const AllEntities &in)
static void accumulate(ContainerOverSubrelations &evals, const AllEntities &in, const RelationParameters< FF > &, const FF &scaling_factor)
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.