Enum arrabbiata::column::Gadget
source · pub enum Gadget {
NoOp,
App,
EllipticCurveAddition,
EllipticCurveScaling,
PoseidonFullRound(usize),
PoseidonSpongeAbsorb,
}
Expand description
This enum represents the different gadgets that can be used in the circuit.
The selectors are defined at setup time, can take only the values 0
or
1
and are public.
Variants§
NoOp
A dummy gadget, doing nothing. Use for padding.
App
The gadget defining the app.
For now, the application is considered to be a one-line computation. However, we want to see the application as a collection of reusable gadgets.
See <https://github.com/o1-labs/proof-systems/issues/3074>
EllipticCurveAddition
EllipticCurveScaling
PoseidonFullRound(usize)
The following gadgets implement the Poseidon hash instance described in the top-level documentation. In the current setup, with crate::NUMBER_OF_COLUMNS columns, we can compute 5 full rounds per row.
We split the Poseidon gadget in 13 sub-gadgets, one for each set of 5 full rounds and one for the absorbtion. The parameter is the starting round of Poseidon. It is expected to be a multiple of five.
Note that, for now, the gadget can only be used by the verifier circuit.
PoseidonSpongeAbsorb
Absorb [PlonkSpongeConstants::SPONGE_WIDTH - 1] elements into the sponge. The elements are absorbed into the last [PlonkSpongeConstants::SPONGE_WIDTH - 1] elements of the permutation state.
The values to be absorbed depend on the state of the environment while executing this instruction.
Note that, for now, the gadget can only be used by the verifier circuit.
Trait Implementations§
source§impl From<Instruction> for Gadget
impl From<Instruction> for Gadget
Convert an instruction into the corresponding gadget.