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>

source§

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

Formats the value using the given formatter. Read more
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]>,

§

type Column = Col

§

type Selector = Sel

§

type Challenge = Chall

The type of an abstract challenge that can be found in the expressions provided as constraints.
§

type Curve = G

The target curve used by the polynomial commitment
§

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 Instance = I

For Plonk, it will be the commitments to the polynomials and the challenges
§

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>

source§

fn hash<__HGColChallIWSrsSelStr>(&self, __state: &mut __HGColChallIWSrsSelStr)where __HGColChallIWSrsSelStr: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
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>

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

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,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V