53 for (
size_t i = 0; i <
rate; ++i) {
102 const size_t in_len = input.size();
106 for (
size_t i = 0; i < in_len; ++i) {
107 BB_ASSERT_EQ(input[i].is_constant(),
false,
"Sponge inputs should not be stdlib constants.");
117 for (
const auto& elem : sponge.
state) {
118 builder->update_used_witnesses(elem.witness_index);
#define BB_ASSERT_EQ(actual, expected,...)
#define ASSERT(expression,...)
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)
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
static constexpr size_t t