barretenberg
Loading...
Searching...
No Matches
Public Types | Static Public Member Functions | Static Public Attributes | List of all members
crypto::Poseidon2Permutation< Params > Class Template Reference

Applies the Poseidon2 permutation function from https://eprint.iacr.org/2023/323 . This algorithm was implemented using https://github.com/HorizenLabs/poseidon2 as a reference. More...

#include <poseidon2_permutation.hpp>

Public Types

using FF = typename Params::FF
 
using State = std::array< FF, t >
 
using RoundConstants = std::array< FF, t >
 
using MatrixDiagonal = std::array< FF, t >
 
using RoundConstantsContainer = std::array< RoundConstants, NUM_ROUNDS >
 

Static Public Member Functions

static constexpr void matrix_multiplication_4x4 (State &input)
 
static constexpr void add_round_constants (State &input, const RoundConstants &rc)
 
static constexpr void matrix_multiplication_internal (State &input)
 
static constexpr void matrix_multiplication_external (State &input)
 
static constexpr void apply_single_sbox (FF &input)
 
static constexpr void apply_sbox (State &input)
 
static constexpr State permutation (const State &input)
 

Static Public Attributes

static constexpr size_t t = Params::t
 
static constexpr size_t d = Params::d
 
static constexpr size_t sbox_size = Params::sbox_size
 
static constexpr size_t rounds_f = Params::rounds_f
 
static constexpr size_t rounds_p = Params::rounds_p
 
static constexpr size_t NUM_ROUNDS = Params::rounds_f + Params::rounds_p
 
static constexpr MatrixDiagonal internal_matrix_diagonal
 
static constexpr RoundConstantsContainer round_constants = Poseidon2Bn254ScalarFieldParams::round_constants
 

Detailed Description

template<typename Params>
class crypto::Poseidon2Permutation< Params >

Applies the Poseidon2 permutation function from https://eprint.iacr.org/2023/323 . This algorithm was implemented using https://github.com/HorizenLabs/poseidon2 as a reference.

Template Parameters
Params

Member Function Documentation

◆ matrix_multiplication_4x4()

template<typename Params >
static constexpr void crypto::Poseidon2Permutation< Params >::matrix_multiplication_4x4 ( State &  input)
inlinestaticconstexpr

hardcoded algorithm that evaluates matrix multiplication using the following MDS matrix: / \ | 5 7 1 3 | | 4 6 1 1 | | 1 3 5 7 | | 1 1 4 6 | \ /

Algorithm is taken directly from the Poseidon2 paper.

Member Data Documentation

◆ internal_matrix_diagonal

template<typename Params >
constexpr MatrixDiagonal crypto::Poseidon2Permutation< Params >::internal_matrix_diagonal
staticconstexpr
Initial value:
=
Poseidon2Bn254ScalarFieldParams::internal_matrix_diagonal

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