jf_relation::gates

Trait Gate

Source
pub trait Gate<F: Field>: Downcast + DynClone {
    // Required method
    fn name(&self) -> &'static str;

    // Provided methods
    fn q_lc(&self) -> [F; 4] { ... }
    fn q_hash(&self) -> [F; 4] { ... }
    fn q_mul(&self) -> [F; 2] { ... }
    fn q_ecc(&self) -> F { ... }
    fn q_c(&self) -> F { ... }
    fn q_o(&self) -> F { ... }
    fn q_lookup(&self) -> F { ... }
    fn q_dom_sep(&self) -> F { ... }
    fn table_key(&self) -> F { ... }
    fn table_dom_sep(&self) -> F { ... }
}
Expand description

Describes a gate with getter for all selectors configuration

Required Methods§

Source

fn name(&self) -> &'static str

Get the name of a gate.

Provided Methods§

Source

fn q_lc(&self) -> [F; 4]

Selectors for linear combination.

Source

fn q_hash(&self) -> [F; 4]

Selectors for Rescue hashes.

Source

fn q_mul(&self) -> [F; 2]

Selectors for multiplication.

Source

fn q_ecc(&self) -> F

The selector for elliptic curve operation.

Source

fn q_c(&self) -> F

Constant selector.

Source

fn q_o(&self) -> F

Output wire selector.

Source

fn q_lookup(&self) -> F

UltraPlonk lookup selector.

Source

fn q_dom_sep(&self) -> F

UltraPlonk lookup domain separation selector.

Source

fn table_key(&self) -> F

UltraPlonk table keys.

Source

fn table_dom_sep(&self) -> F

UltraPlonk table domain separation ids

Implementations§

Source§

impl<F> dyn Gate<F>
where F: Any + 'static + Field,

Source

pub fn is<__T: Gate<F>>(&self) -> bool

Returns true if the trait object wraps an object of type __T.

Source

pub fn downcast<__T: Gate<F>>(self: Box<Self>) -> Result<Box<__T>, Box<Self>>

Returns a boxed object from a boxed trait object if the underlying object is of type __T. Returns the original boxed trait if it isn’t.

Source

pub fn downcast_rc<__T: Gate<F>>(self: Rc<Self>) -> Result<Rc<__T>, Rc<Self>>

Returns an Rc-ed object from an Rc-ed trait object if the underlying object is of type __T. Returns the original Rc-ed trait if it isn’t.

Source

pub fn downcast_ref<__T: Gate<F>>(&self) -> Option<&__T>

Returns a reference to the object within the trait object if it is of type __T, or None if it isn’t.

Source

pub fn downcast_mut<__T: Gate<F>>(&mut self) -> Option<&mut __T>

Returns a mutable reference to the object within the trait object if it is of type __T, or None if it isn’t.

Trait Implementations§

Source§

impl<F: Field> Clone for Box<dyn Gate<F>>

Source§

fn clone(&self) -> Box<dyn Gate<F>>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<F: Field> Debug for dyn Gate<F> + 'static

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Implementors§

Source§

impl<F> Gate<F> for AdditionGate
where F: Field,

Source§

impl<F> Gate<F> for BoolGate
where F: Field,

Source§

impl<F> Gate<F> for CondSelectGate
where F: Field,

Source§

impl<F> Gate<F> for ConstantAdditionGate<F>
where F: Field,

Source§

impl<F> Gate<F> for ConstantGate<F>
where F: Field,

Source§

impl<F> Gate<F> for ConstantMultiplicationGate<F>
where F: Field,

Source§

impl<F> Gate<F> for EqualityGate
where F: Field,

Source§

impl<F> Gate<F> for IoGate
where F: Field,

Source§

impl<F> Gate<F> for LinCombGate<F>
where F: Field,

Source§

impl<F> Gate<F> for LogicOrGate
where F: Field,

Source§

impl<F> Gate<F> for LogicOrOutputGate
where F: Field,

Source§

impl<F> Gate<F> for LookupGate<F>
where F: Field,

Source§

impl<F> Gate<F> for MulAddGate<F>
where F: Field,

Source§

impl<F> Gate<F> for MultiplicationGate
where F: Field,

Source§

impl<F> Gate<F> for PaddingGate
where F: Field,

Source§

impl<F> Gate<F> for QuadPolyGate<F>
where F: Field,

Source§

impl<F> Gate<F> for QuaternaryPointSelectXGate<F>
where F: PrimeField,

Source§

impl<F> Gate<F> for QuaternaryPointSelectYGate<F>
where F: PrimeField,

Source§

impl<F> Gate<F> for SubtractionGate
where F: Field,

Source§

impl<F, P> Gate<F> for CurvePointXAdditionGate<P>
where F: PrimeField, P: Config<BaseField = F>,

Source§

impl<F, P> Gate<F> for CurvePointYAdditionGate<P>
where F: PrimeField, P: Config<BaseField = F>,

Source§

impl<F, P> Gate<F> for EdwardsCurveEquationGate<P>
where F: PrimeField, P: Config<BaseField = F>,

Source§

impl<F: Field> Gate<F> for FifthRootGate