Module poseidon

Source
Expand description

This module implements the Poseidon constraint polynomials.

Structs§

Poseidon
Implementation of the Poseidon gate Poseidon quotient poly contribution computation f^7 + c(x) - f(wx) Conjunction of:

Constants§

POS_ROWS_PER_HASH
Number of PLONK rows required to implement Poseidon
ROUNDS_PER_HASH
Number of rounds
ROUNDS_PER_ROW
Number of rows
SPONGE_WIDTH
Width of the sponge
STATE_ORDER
The order in a row in which we store states before and after permutations

Functions§

generate_witness
generate_witness(row, params, witness_cols, input) uses a sponge initialized with params to generate a witness for starting at row row in witness_cols, and with input input.
round_to_cols
Given a Poseidon round from 0 to 4 (inclusive), returns the columns (as a range) that are used in this round.