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>
|
|
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 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 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 |
| |
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
-
◆ matrix_multiplication_4x4()
template<typename Params >
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.
◆ internal_matrix_diagonal
template<typename Params >
Initial value:=
Poseidon2Bn254ScalarFieldParams::internal_matrix_diagonal
The documentation for this class was generated from the following file: