pub struct StandardConfig<G, Col, Chall, I, W, Srs, Sel = (), Str = EmptyStructure<G>>(/* private fields */);
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};
// instantiating 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
Source§type Challenge = Chall
type Challenge = Chall
The type of an abstract challenge that can be found in the expressions
provided as constraints.
Source§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.
Source§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 for StandardConfig<G, Col, Chall, I, W, Srs, Sel, Str>
impl<G, Col, Chall, I, W, Srs, Sel, Str> PartialEq 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> Freeze for StandardConfig<G, Col, Chall, I, W, Srs, Sel, Str>
impl<G, Col, Chall, I, W, Srs, Sel, Str> RefUnwindSafe for StandardConfig<G, Col, Chall, I, W, Srs, Sel, Str>where
G: RefUnwindSafe,
Col: RefUnwindSafe,
Chall: RefUnwindSafe,
Sel: RefUnwindSafe,
Str: RefUnwindSafe,
I: RefUnwindSafe,
W: RefUnwindSafe,
Srs: RefUnwindSafe,
impl<G, Col, Chall, I, W, Srs, Sel, Str> Send for StandardConfig<G, Col, Chall, I, W, Srs, Sel, Str>
impl<G, Col, Chall, I, W, Srs, Sel, Str> Sync for StandardConfig<G, Col, Chall, I, W, Srs, Sel, Str>
impl<G, Col, Chall, I, W, Srs, Sel, Str> Unpin for StandardConfig<G, Col, Chall, I, W, Srs, Sel, Str>
impl<G, Col, Chall, I, W, Srs, Sel, Str> UnwindSafe for StandardConfig<G, Col, Chall, I, W, Srs, Sel, Str>where
G: UnwindSafe,
Col: UnwindSafe,
Chall: UnwindSafe,
Sel: UnwindSafe,
Str: UnwindSafe,
I: UnwindSafe,
W: UnwindSafe,
Srs: 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 Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more