Struct kimchi::snarky::folding::FullChallenge
source · pub struct FullChallenge<F>(_);
Trait Implementations§
source§impl<F: Clone> Clone for FullChallenge<F>
impl<F: Clone> Clone for FullChallenge<F>
source§fn clone(&self) -> FullChallenge<F>
fn clone(&self) -> FullChallenge<F>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<F: Debug> Debug for FullChallenge<F>
impl<F: Debug> Debug for FullChallenge<F>
source§impl<F: PrimeField> SnarkyType<F> for FullChallenge<FieldVar<F>>
impl<F: PrimeField> SnarkyType<F> for FullChallenge<FieldVar<F>>
§type Auxiliary = ()
type Auxiliary = ()
Some ‘out-of-circuit’ data, which is carried as part of Self.
This data isn’t encoded as CVars in the circuit, since the data may be large (e.g. a sparse merkle tree),
or may only be used by witness computations / for debugging.
§type OutOfCircuit = FullChallenge<F>
type OutOfCircuit = FullChallenge<F>
The equivalent “out-of-circuit” type.
For example, the super::boolean::Boolean snarky type has an out-of-circuit type of bool.
source§const SIZE_IN_FIELD_ELEMENTS: usize = 2usize
const SIZE_IN_FIELD_ELEMENTS: usize = 2usize
The number of field elements that this type takes.
source§fn to_cvars(&self) -> (Vec<FieldVar<F>>, Self::Auxiliary)
fn to_cvars(&self) -> (Vec<FieldVar<F>>, Self::Auxiliary)
Returns the circuit variables (and auxiliary data) behind this type.
source§fn from_cvars_unsafe(cvars: Vec<FieldVar<F>>, _aux: Self::Auxiliary) -> Self
fn from_cvars_unsafe(cvars: Vec<FieldVar<F>>, _aux: Self::Auxiliary) -> Self
Creates a new instance of this type from the given circuit variables (And some auxiliary data).
source§fn check(
&self,
_cs: &mut RunState<F>,
_loc: Cow<'static, str>
) -> SnarkyResult<()>
fn check( &self, _cs: &mut RunState<F>, _loc: Cow<'static, str> ) -> SnarkyResult<()>
Checks that the circuit variables behind this type are valid.
For some definition of valid.
For example, a Boolean snarky type would check that the field element representing it is either 0 or 1.
The function does this by adding constraints to your constraint system.
source§fn constraint_system_auxiliary() -> Self::Auxiliary
fn constraint_system_auxiliary() -> Self::Auxiliary
The “default” value of Self::Auxiliary.
This is passed to Self::from_cvars_unsafe when we are not generating a witness,
since we have no candidate value to get the auxiliary data from.
Note that we use an explicit value here rather than Auxiliary: Default,
since the default value for the type may not match the default value we actually want to pass!
source§fn value_to_field_elements(
value: &Self::OutOfCircuit
) -> (Vec<F>, Self::Auxiliary)
fn value_to_field_elements( value: &Self::OutOfCircuit ) -> (Vec<F>, Self::Auxiliary)
Converts an out-of-circuit value
fn value_of_field_elements( fields: Vec<F>, _aux: Self::Auxiliary ) -> Self::OutOfCircuit
fn compute<FUNC>( cs: &mut RunState<F>, loc: Cow<'static, str>, to_compute_value: FUNC ) -> SnarkyResult<Self>where FUNC: Fn(&dyn WitnessGeneration<F>) -> Self::OutOfCircuit,
fn read<G>(&self, g: G) -> Self::OutOfCircuitwhere G: WitnessGeneration<F>,
Auto Trait Implementations§
impl<F> RefUnwindSafe for FullChallenge<F>where F: RefUnwindSafe,
impl<F> Send for FullChallenge<F>where F: Send,
impl<F> Sync for FullChallenge<F>where F: Sync,
impl<F> Unpin for FullChallenge<F>where F: Unpin,
impl<F> UnwindSafe for FullChallenge<F>where F: UnwindSafe,
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
Mutably borrows from an owned value. Read more