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
Convert an instruction into the corresponding gadget.
impl From<Instruction> for Gadget
Convert an instruction into the corresponding gadget.
Source§fn from(val: Instruction) -> Gadget
fn from(val: Instruction) -> Gadget
Source§impl IntoEnumIterator for Gadget
impl IntoEnumIterator for Gadget
type Iterator = GadgetIter
fn iter() -> GadgetIter ⓘ
impl Copy for Gadget
impl Eq for Gadget
impl StructuralPartialEq for Gadget
Auto Trait Implementations§
impl Freeze for Gadget
impl RefUnwindSafe for Gadget
impl Send for Gadget
impl Sync for Gadget
impl Unpin for Gadget
impl UnsafeUnpin for Gadget
impl UnwindSafe for Gadget
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.