Struct folding::standard_config::StandardConfig
source · pub struct StandardConfig<G, Col, Chall, I, W, Srs, Sel = (), Str = EmptyStructure<G>>(_);
Expand description
A standard folding config that supports:
G
: any curve
Col
: any column implementing FoldingColumnTrait
Chall
: any challenge
Sel
: any dynamic selector
Str
: structures that can be indexed by Col
, thus implementing Index<Col>
I
: instances (implementing Instance) that can be indexed by Chall
W
: witnesses (implementing Witness) that can be indexed by Col
and Sel
ⓘ
use ark_poly::{EvaluationDomain, Radix2EvaluationDomain};
use mina_poseidon::FqSponge;
use folding::{examples::{BaseSponge, Curve, Fp}, FoldingScheme};
// instanciating the config with our types and the defaults for selectors and structure
type MyConfig = StandardConfig<Curve, MyCol, MyChallenge, MyInstance<Curve>, MyWitness<Curve>>;
let constraints = vec![constraint()];
let domain = Radix2EvaluationDomain::<Fp>::new(2).unwrap();
let srs = poly_commitment::srs::SRS::<Curve>::create(2);
srs.get_lagrange_basis(domain);
// this is the default structure, which does nothing or panics if
// indexed (as it shouldn't be indexed)
let structure = EmptyStructure::default();
// here we can use the config
let (scheme, _) =
FoldingScheme::<MyConfig>::new(constraints, &srs, domain, &structure);
let [left, right] = pairs;
let left = (left.0, left.1);
let right = (right.0, right.1);
let mut fq_sponge = BaseSponge::new(Curve::other_curve_sponge_params());
let _output = scheme.fold_instance_witness_pair(left, right, &mut fq_sponge);
Trait Implementations§
source§impl<G, Col, Chall, I, W, Srs, Sel, Str> Debug for StandardConfig<G, Col, Chall, I, W, Srs, Sel, Str>
impl<G, Col, Chall, I, W, Srs, Sel, Str> Debug for StandardConfig<G, Col, Chall, I, W, Srs, Sel, Str>
source§impl<G, Col, Chall, Sel, Str, I, W, Srs> FoldingConfig for StandardConfig<G, Col, Chall, I, W, Srs, Sel, Str>where
Self: 'static,
G: CommitmentCurve,
I: Instance<G> + Index<Chall, Output = G::ScalarField> + Clone,
W: Witness<G> + Clone + Index<Col, Output = [G::ScalarField]> + Index<Sel, Output = [G::ScalarField]>,
Srs: SRS<G>,
Col: Hash + Eq + Debug + Clone + FoldingColumnTrait,
Sel: Ord + Copy + Hash + Debug,
Chall: Hash + Eq + Debug + Copy,
Str: Clone + Index<Col, Output = [G::ScalarField]>,
impl<G, Col, Chall, Sel, Str, I, W, Srs> FoldingConfig for StandardConfig<G, Col, Chall, I, W, Srs, Sel, Str>where Self: 'static, G: CommitmentCurve, I: Instance<G> + Index<Chall, Output = G::ScalarField> + Clone, W: Witness<G> + Clone + Index<Col, Output = [G::ScalarField]> + Index<Sel, Output = [G::ScalarField]>, Srs: SRS<G>, Col: Hash + Eq + Debug + Clone + FoldingColumnTrait, Sel: Ord + Copy + Hash + Debug, Chall: Hash + Eq + Debug + Copy, Str: Clone + Index<Col, Output = [G::ScalarField]>,
type Column = Col
type Selector = Sel
§type Challenge = Chall
type Challenge = Chall
The type of an abstract challenge that can be found in the expressions
provided as constraints.
§type Srs = Srs
type Srs = Srs
The SRS used by the polynomial commitment. The SRS is used to commit to
the additional columns that are added by the quadraticization.
§type Witness = W
type Witness = W
For PlonK, it will be the polynomials in evaluation form that we commit
to, i.e. the columns.
In the generic prover/verifier, it would be
kimchi_msm::witness::Witness
.type Structure = Str
type Env = Env<G, Col, Chall, Sel, Str, I, W>
source§impl<G, Col, Chall, I, W, Srs, Sel, Str> Hash for StandardConfig<G, Col, Chall, I, W, Srs, Sel, Str>
impl<G, Col, Chall, I, W, Srs, Sel, Str> Hash for StandardConfig<G, Col, Chall, I, W, Srs, Sel, Str>
source§fn hash<__HGColChallIWSrsSelStr>(&self, __state: &mut __HGColChallIWSrsSelStr)where
__HGColChallIWSrsSelStr: Hasher,
fn hash<__HGColChallIWSrsSelStr>(&self, __state: &mut __HGColChallIWSrsSelStr)where __HGColChallIWSrsSelStr: Hasher,
source§impl<G, Col, Chall, I, W, Srs, Sel, Str> PartialEq<StandardConfig<G, Col, Chall, I, W, Srs, Sel, Str>> for StandardConfig<G, Col, Chall, I, W, Srs, Sel, Str>
impl<G, Col, Chall, I, W, Srs, Sel, Str> PartialEq<StandardConfig<G, Col, Chall, I, W, Srs, Sel, Str>> for StandardConfig<G, Col, Chall, I, W, Srs, Sel, Str>
impl<G, Col, Chall, I, W, Srs, Sel, Str> Eq for StandardConfig<G, Col, Chall, I, W, Srs, Sel, Str>
Auto Trait Implementations§
impl<G, Col, Chall, I, W, Srs, Sel, Str> RefUnwindSafe for StandardConfig<G, Col, Chall, I, W, Srs, Sel, Str>where Chall: RefUnwindSafe, Col: RefUnwindSafe, G: RefUnwindSafe, I: RefUnwindSafe, Sel: RefUnwindSafe, Srs: RefUnwindSafe, Str: RefUnwindSafe, W: RefUnwindSafe,
impl<G, Col, Chall, I, W, Srs, Sel, Str> Send for StandardConfig<G, Col, Chall, I, W, Srs, Sel, Str>where Chall: Send, Col: Send, G: Send, I: Send, Sel: Send, Srs: Send, Str: Send, W: Send,
impl<G, Col, Chall, I, W, Srs, Sel, Str> Sync for StandardConfig<G, Col, Chall, I, W, Srs, Sel, Str>where Chall: Sync, Col: Sync, G: Sync, I: Sync, Sel: Sync, Srs: Sync, Str: Sync, W: Sync,
impl<G, Col, Chall, I, W, Srs, Sel, Str> Unpin for StandardConfig<G, Col, Chall, I, W, Srs, Sel, Str>where Chall: Unpin, Col: Unpin, G: Unpin, I: Unpin, Sel: Unpin, Srs: Unpin, Str: Unpin, W: Unpin,
impl<G, Col, Chall, I, W, Srs, Sel, Str> UnwindSafe for StandardConfig<G, Col, Chall, I, W, Srs, Sel, Str>where Chall: UnwindSafe, Col: UnwindSafe, G: UnwindSafe, I: UnwindSafe, Sel: UnwindSafe, Srs: UnwindSafe, Str: UnwindSafe, W: 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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more