Barretenberg
The ZK-SNARK library at the core of Aztec
|
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) |
Native form of Poseidon2 permutation from https://eprint.iacr.org/2023/323. | |
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 = Params::internal_matrix_diagonal |
static constexpr RoundConstantsContainer | round_constants = Params::round_constants |
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.
Params |
Definition at line 25 of file poseidon2_permutation.hpp.
using bb::crypto::Poseidon2Permutation< Params >::FF = typename Params::FF |
Definition at line 43 of file poseidon2_permutation.hpp.
using bb::crypto::Poseidon2Permutation< Params >::MatrixDiagonal = std::array<FF, t> |
Definition at line 46 of file poseidon2_permutation.hpp.
using bb::crypto::Poseidon2Permutation< Params >::RoundConstants = std::array<FF, t> |
Definition at line 45 of file poseidon2_permutation.hpp.
using bb::crypto::Poseidon2Permutation< Params >::RoundConstantsContainer = std::array<RoundConstants, NUM_ROUNDS> |
Definition at line 47 of file poseidon2_permutation.hpp.
using bb::crypto::Poseidon2Permutation< Params >::State = std::array<FF, t> |
Definition at line 44 of file poseidon2_permutation.hpp.
|
inlinestaticconstexpr |
Definition at line 85 of file poseidon2_permutation.hpp.
|
inlinestaticconstexpr |
Definition at line 123 of file poseidon2_permutation.hpp.
|
inlinestaticconstexpr |
Definition at line 115 of file poseidon2_permutation.hpp.
|
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.
Definition at line 52 of file poseidon2_permutation.hpp.
|
inlinestaticconstexpr |
Definition at line 105 of file poseidon2_permutation.hpp.
|
inlinestaticconstexpr |
Definition at line 92 of file poseidon2_permutation.hpp.
|
inlinestaticconstexpr |
Native form of Poseidon2 permutation from https://eprint.iacr.org/2023/323.
The permutation consists of one initial linear layer, then a set of external rounds, a set of internal rounds, and a set of external rounds.
input |
Definition at line 137 of file poseidon2_permutation.hpp.
|
staticconstexpr |
Definition at line 34 of file poseidon2_permutation.hpp.
|
staticconstexpr |
Definition at line 49 of file poseidon2_permutation.hpp.
|
staticconstexpr |
Definition at line 41 of file poseidon2_permutation.hpp.
|
staticconstexpr |
Definition at line 50 of file poseidon2_permutation.hpp.
|
staticconstexpr |
Definition at line 38 of file poseidon2_permutation.hpp.
|
staticconstexpr |
Definition at line 40 of file poseidon2_permutation.hpp.
|
staticconstexpr |
Definition at line 36 of file poseidon2_permutation.hpp.
|
staticconstexpr |
Definition at line 31 of file poseidon2_permutation.hpp.