10 #ifndef CRYPTO3_HASH_POSEIDON_POLICY_HPP
11 #define CRYPTO3_HASH_POSEIDON_POLICY_HPP
14 #include <type_traits>
28 template<
typename FieldType, std::
size_t Arity, std::
size_t PartRounds>
33 constexpr
static const std::size_t
word_bits = field_type::modulus_bits;
36 constexpr
static const std::size_t
digest_bits = field_type::modulus_bits;
39 constexpr
static const std::size_t
state_bits = (Arity + 1) * field_type::modulus_bits;
43 constexpr
static const std::size_t
block_bits = Arity * field_type::modulus_bits;
64 template<
typename FieldType, std::
size_t Arity, std::
size_t PartRounds,
typename Enable =
void>
67 template<
typename FieldType, std::
size_t PartRounds>
69 std::enable_if_t<PartRounds == 69 || PartRounds == 55>> :
72 template<
typename FieldType, std::
size_t PartRounds>
74 std::enable_if_t<PartRounds == 69 || PartRounds == 55>> :
77 template<
typename FieldType, std::
size_t PartRounds>
79 std::enable_if_t<PartRounds == 70 || PartRounds == 56>> :
82 template<
typename FieldType, std::
size_t PartRounds>
84 std::enable_if_t<PartRounds == 70 || PartRounds == 56>> :
87 template<
typename FieldType, std::
size_t PartRounds>
89 std::enable_if_t<PartRounds == 70 || PartRounds == 56>> :
92 template<
typename FieldType, std::
size_t PartRounds>
94 std::enable_if_t<PartRounds == 70 || PartRounds == 56>> :
97 template<
typename FieldType, std::
size_t PartRounds>
99 std::enable_if_t<PartRounds == 72 || PartRounds == 57>> :
102 template<
typename FieldType, std::
size_t PartRounds>
104 std::enable_if_t<PartRounds == 72 || PartRounds == 57>> :
107 template<
typename FieldType, std::
size_t PartRounds>
109 std::enable_if_t<PartRounds == 72 || PartRounds == 57>> :
112 template<
typename FieldType, std::
size_t PartRounds>
114 std::enable_if_t<PartRounds == 72 || PartRounds == 57>> :
117 template<
typename FieldType, std::
size_t PartRounds>
119 std::enable_if_t<PartRounds == 72 || PartRounds == 57>> :
122 template<
typename FieldType, std::
size_t PartRounds>
124 std::enable_if_t<PartRounds == 72 || PartRounds == 57>> :
127 template<
typename FieldType, std::
size_t PartRounds>
129 std::enable_if_t<PartRounds == 72 || PartRounds == 57>> :
132 template<
typename FieldType, std::
size_t PartRounds>
134 std::enable_if_t<PartRounds == 72 || PartRounds == 57>> :
137 template<
typename FieldType, std::
size_t PartRounds>
139 std::enable_if_t<PartRounds == 74 || PartRounds == 59>> :
142 template<
typename FieldType, std::
size_t PartRounds>
144 std::enable_if_t<PartRounds == 74 || PartRounds == 59>> :
147 template<
typename FieldType, std::
size_t PartRounds>
149 std::enable_if_t<PartRounds == 74 || PartRounds == 59>> :
152 template<
typename FieldType, std::
size_t PartRounds>
154 std::enable_if_t<PartRounds == 75 || PartRounds == 60>> :
157 template<
typename FieldType, std::
size_t PartRounds>
159 std::enable_if_t<PartRounds == 77 || PartRounds == 61>> :
Definition: poseidon_policy.hpp:51
const state_type & operator()() const
Definition: poseidon_policy.hpp:53
Poseidon internal parameters.
Definition: poseidon_policy.hpp:29
element_type digest_type
Definition: poseidon_policy.hpp:37
std::array< element_type, Arity+1 > state_type
Definition: poseidon_policy.hpp:41
constexpr static const std::size_t state_words
Definition: poseidon_policy.hpp:40
constexpr static const std::size_t state_bits
Definition: poseidon_policy.hpp:39
constexpr static const std::size_t digest_bits
Definition: poseidon_policy.hpp:36
field_type::value_type element_type
Definition: poseidon_policy.hpp:31
element_type word_type
Definition: poseidon_policy.hpp:34
std::array< element_type, Arity > block_type
Definition: poseidon_policy.hpp:45
constexpr static const std::size_t part_rounds
Definition: poseidon_policy.hpp:49
constexpr static const std::size_t block_bits
Definition: poseidon_policy.hpp:43
FieldType field_type
Definition: poseidon_policy.hpp:30
constexpr static const std::size_t word_bits
Definition: poseidon_policy.hpp:33
constexpr static const std::size_t full_rounds
Definition: poseidon_policy.hpp:47
constexpr static const std::size_t half_full_rounds
Definition: poseidon_policy.hpp:48
constexpr static const std::size_t block_words
Definition: poseidon_policy.hpp:44
Definition: poseidon_policy.hpp:65