54 for (
size_t i = 0; i <
rate; ++i) {
103 const size_t in_len = input.size();
107 for (
size_t i = 0; i < in_len; ++i) {
108 BB_ASSERT_EQ(input[i].is_constant(),
false,
"Sponge inputs should not be stdlib constants.");
118 for (
const auto& elem : sponge.
state) {
#define BB_ASSERT(expression,...)
#define BB_ASSERT_EQ(actual, expected,...)
Implements the circuit form of a cryptographic sponge over prime fields.
static constexpr size_t rate
FieldSponge(Builder *builder_, size_t in_len)
std::array< field_t, t > state
void absorb(const field_t &input)
static constexpr size_t t
std::array< field_t, rate > cache
static field_t hash_internal(std::span< const field_t > input)
Use the sponge to hash an input vector.
static constexpr size_t capacity
Circuit form of Poseidon2 permutation from https://eprint.iacr.org/2023/323.
static State permutation(Builder *builder, const State &input)
Circuit form of Poseidon2 permutation from https://eprint.iacr.org/2023/323.
void convert_constant_to_fixed_witness(Builder *ctx)
void mark_witness_as_used(const field_t< Builder > &field)
Mark a field_t witness as used (for UltraBuilder only).
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
static constexpr size_t t