Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::Poseidon2TransitionEntryRelationImpl< FF_ > Class Template Reference

Entry transition relation for the K=4 compressed Poseidon2 internal block. More...

#include <poseidon2_transition_entry_relation.hpp>

Public Types

using FF = FF_
 
using QuadParams = crypto::Poseidon2QuadBn254Params
 

Static Public Member Functions

template<typename AllEntities >
static bool skip (const AllEntities &in)
 
template<typename ContainerOverSubrelations , typename AllEntities , typename Parameters >
static void accumulate (ContainerOverSubrelations &evals, const AllEntities &in, const Parameters &, const FF &scaling_factor)
 

Static Public Attributes

static constexpr std::array< size_t, 3 > SUBRELATION_PARTIAL_LENGTHS
 
static constexpr fr D1 = QuadParams::D1
 
static constexpr auto & A_one = QuadParams::A_one
 
static constexpr auto & A2_one = QuadParams::A2_one
 
static constexpr fr sum_A_one = QuadParams::sum_A_one
 

Detailed Description

template<typename FF_>
class bb::Poseidon2TransitionEntryRelationImpl< FF_ >

Entry transition relation for the K=4 compressed Poseidon2 internal block.

The entry row holds the external-round output in standard encoding: (w_l, w_r, w_o, w_4) = (s_0, s_1, s_2, s_3) at the internal-block entry. Its wires share witness indices with the poseidon2_external propagate row, so they are copy-constrained to the true external output by the permutation relation.

The successor is the first compressed row, whose wires encode state[0] at 4 consecutive rounds: (w_l_shift, w_r_shift, w_o_shift, w_4_shift) = (state[0] at round 0, round 1, round 2, round 3).

w_l_shift = state[0] at round 0 = s_0 is enforced by the permutation relation because it shares the entry row's w_l witness. The three subrelations below cover rounds 1, 2, 3.

Each subrelation computes state[0] at the target round using the previous shifted wire, keeping the per-variable degree at 5.

Subrelations (each × q_poseidon2_transition_entry × gate separator, degree 7):

A_0 (round 1): w_r_shift = D_1 u_0 + w_r + w_o + w_4, u_0 = (w_l + q_l)^5

A_1 (round 2): w_o_shift = D_1 u_1 + 3 u_0 + (D_2+2) w_r + (D_3+2) w_o + (D_4+2) w_4 where u_1 = (w_r_shift + q_r)^5.

A_2 (round 3): w_4_shift = D_1 u_2 + 3 u_1 + (Σ + 6) u_0

  • (D_2^2 + D_2 + Σ + 4) w_r
  • (D_3^2 + D_3 + Σ + 4) w_o
  • (D_4^2 + D_4 + Σ + 4) w_4 where u_2 = (w_o_shift + q_o)^5.

Selector layout on the entry row: q_l = c_{rounds_f_begin + 0} // 1st internal round constant q_r = c_{rounds_f_begin + 1} q_o = c_{rounds_f_begin + 2} q_4, q_m, q_c, q_5 = 0 (unused)

Definition at line 48 of file poseidon2_transition_entry_relation.hpp.

Member Typedef Documentation

◆ FF

template<typename FF_ >
using bb::Poseidon2TransitionEntryRelationImpl< FF_ >::FF = FF_

Definition at line 50 of file poseidon2_transition_entry_relation.hpp.

◆ QuadParams

template<typename FF_ >
using bb::Poseidon2TransitionEntryRelationImpl< FF_ >::QuadParams = crypto::Poseidon2QuadBn254Params

Definition at line 51 of file poseidon2_transition_entry_relation.hpp.

Member Function Documentation

◆ accumulate()

template<typename FF_ >
template<typename ContainerOverSubrelations , typename AllEntities , typename Parameters >
static void bb::Poseidon2TransitionEntryRelationImpl< FF_ >::accumulate ( ContainerOverSubrelations &  evals,
const AllEntities &  in,
const Parameters &  ,
const FF scaling_factor 
)
inlinestatic

Definition at line 75 of file poseidon2_transition_entry_relation.hpp.

◆ skip()

template<typename FF_ >
template<typename AllEntities >
static bool bb::Poseidon2TransitionEntryRelationImpl< FF_ >::skip ( const AllEntities &  in)
inlinestatic

Definition at line 69 of file poseidon2_transition_entry_relation.hpp.

Member Data Documentation

◆ A2_one

template<typename FF_ >
constexpr auto& bb::Poseidon2TransitionEntryRelationImpl< FF_ >::A2_one = QuadParams::A2_one
staticconstexpr

Definition at line 66 of file poseidon2_transition_entry_relation.hpp.

◆ A_one

template<typename FF_ >
constexpr auto& bb::Poseidon2TransitionEntryRelationImpl< FF_ >::A_one = QuadParams::A_one
staticconstexpr

Definition at line 65 of file poseidon2_transition_entry_relation.hpp.

◆ D1

template<typename FF_ >
constexpr fr bb::Poseidon2TransitionEntryRelationImpl< FF_ >::D1 = QuadParams::D1
staticconstexpr

Definition at line 59 of file poseidon2_transition_entry_relation.hpp.

◆ SUBRELATION_PARTIAL_LENGTHS

template<typename FF_ >
constexpr std::array<size_t, 3> bb::Poseidon2TransitionEntryRelationImpl< FF_ >::SUBRELATION_PARTIAL_LENGTHS
staticconstexpr
Initial value:
{
7,
7,
7,
}

Definition at line 53 of file poseidon2_transition_entry_relation.hpp.

◆ sum_A_one

template<typename FF_ >
constexpr fr bb::Poseidon2TransitionEntryRelationImpl< FF_ >::sum_A_one = QuadParams::sum_A_one
staticconstexpr

Definition at line 67 of file poseidon2_transition_entry_relation.hpp.


The documentation for this class was generated from the following file: