pub trait PoseidonSpongeInstructions<F: Field, S: Spec<F, T, RATE>, D: Domain<F, RATE>, const T: usize, const RATE: usize>: PoseidonInstructions<F, S, T, RATE> {
    // Required methods
    fn initial_state(
        &self,
        layouter: &mut impl Layouter<F>
    ) -> Result<[Self::Word; T], Error>;
    fn add_input(
        &self,
        layouter: &mut impl Layouter<F>,
        initial_state: &[Self::Word; T],
        input: &Absorbing<PaddedWord<F>, RATE>
    ) -> Result<[Self::Word; T], Error>;
    fn get_output(state: &[Self::Word; T]) -> Squeezing<Self::Word, RATE>;
}
Expand description

The set of circuit instructions required to use the Sponge and Hash gadgets.

Required Methods§

source

fn initial_state( &self, layouter: &mut impl Layouter<F> ) -> Result<[Self::Word; T], Error>

Returns the initial empty state for the given domain.

source

fn add_input( &self, layouter: &mut impl Layouter<F>, initial_state: &[Self::Word; T], input: &Absorbing<PaddedWord<F>, RATE> ) -> Result<[Self::Word; T], Error>

Adds the given input to the state.

source

fn get_output(state: &[Self::Word; T]) -> Squeezing<Self::Word, RATE>

Extracts sponge output from the given state.

Implementors§

source§

impl<F: Field, S: Spec<F, WIDTH, RATE>, D: Domain<F, RATE>, const WIDTH: usize, const RATE: usize> PoseidonSpongeInstructions<F, S, D, WIDTH, RATE> for Pow5Chip<F, WIDTH, RATE>