Struct StandardConfig

Source
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>

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]>,

Source§

type Column = Col

Source§

type Selector = Sel

Source§

type Challenge = Chall

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

type Curve = G

The target curve used by the polynomial commitment
Source§

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

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

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.
Source§

type Structure = Str

Source§

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 for StandardConfig<G, Col, Chall, I, W, Srs, Sel, Str>

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

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> 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>

§

impl<G, Col, Chall, I, W, Srs, Sel, Str> Send for StandardConfig<G, Col, Chall, I, W, Srs, Sel, Str>
where G: Send, Col: Send, Chall: Send, Sel: Send, Str: Send, I: Send, W: Send, Srs: Send,

§

impl<G, Col, Chall, I, W, Srs, Sel, Str> Sync for StandardConfig<G, Col, Chall, I, W, Srs, Sel, Str>
where G: Sync, Col: Sync, Chall: Sync, Sel: Sync, Str: Sync, I: Sync, W: Sync, Srs: Sync,

§

impl<G, Col, Chall, I, W, Srs, Sel, Str> Unpin for StandardConfig<G, Col, Chall, I, W, Srs, Sel, Str>
where G: Unpin, Col: Unpin, Chall: Unpin, Sel: Unpin, Str: Unpin, I: Unpin, W: Unpin, Srs: Unpin,

§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Q
where 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 T
where 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

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 for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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 T
where V: MultiLane<T>,

§

fn vzip(self) -> V