Skip to main content

Val

Trait Val 

Source
pub trait Val {
    type PreferredConstraintField: PrimeField;
    type Var: AllocVar<Self, Self::PreferredConstraintField> + GR1CSVar<Self::PreferredConstraintField, Value = Self>;
    type EmulatedVar<F: SonobeField>: AllocVar<Self, F> + GR1CSVar<F, Value = Self>;
}
Expand description

Val associates a type with its in-circuit variables.

Required Associated Types§

Source

type PreferredConstraintField: PrimeField

Val::PreferredConstraintField is the preferred constraint field for expressing Self in-circuit.

Source

type Var: AllocVar<Self, Self::PreferredConstraintField> + GR1CSVar<Self::PreferredConstraintField, Value = Self>

Val::Var is the canonical in-circuit variable.

In this case, the circuit is defined over the preferred constraint field and can represent Self directly (i.e., without emulation).

Source

type EmulatedVar<F: SonobeField>: AllocVar<Self, F> + GR1CSVar<F, Value = Self>

Val::EmulatedVar is the emulated in-circuit variable.

In this case, the circuit is defined over an arbitrary field F which may differ from the preferred constraint field, and Self is represented in-circuit via emulation.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<P: FpConfig<N>, const N: usize> Val for Fp<P, N>

Source§

impl<P: SWCurveConfig<ScalarField: SonobeField, BaseField: SonobeField>> Val for Projective<P>

Implementors§