pub struct IndexedRelation<Fp: PrimeField, Fq: PrimeField, E1: ArrabbiataCurve<ScalarField = Fp, BaseField = Fq>, E2: ArrabbiataCurve<ScalarField = Fq, BaseField = Fp>>where
    E1::BaseField: PrimeField,
    E2::BaseField: PrimeField,{
    pub domain_fp: EvaluationDomains<E1::ScalarField>,
    pub domain_fq: EvaluationDomains<E2::ScalarField>,
    pub srs_e1: SRS<E1>,
    pub srs_e2: SRS<E2>,
    pub app_size: usize,
    pub circuit_gates: Vec<Gadget>,
    pub selectors_comm: ([PolyComm<E1>; 18], [PolyComm<E2>; 18]),
    pub constraints_fp: HashMap<Gadget, Vec<Sparse<Fp, { MV_POLYNOMIAL_ARITY }, { MAX_DEGREE }>>>,
    pub constraints_fq: HashMap<Gadget, Vec<Sparse<Fq, { MV_POLYNOMIAL_ARITY }, { MAX_DEGREE }>>>,
    pub initial_sponge: [BigInt; 3],
}
Expand description

An indexed relation is a structure that contains all the information needed describing a specialised sub-class of the NP relation. It includes some (protocol) parameters like the SRS, the evaluation domains, and the constraints describing the computation.

The prover will be instantiated for a particular indexed relation, and the verifier will be instantiated with (relatively) the same indexed relation.

Fields§

§domain_fp: EvaluationDomains<E1::ScalarField>

Domain for Fp

§domain_fq: EvaluationDomains<E2::ScalarField>

Domain for Fq

§srs_e1: SRS<E1>

SRS for the first curve

§srs_e2: SRS<E2>

SRS for the second curve

§app_size: usize

The application size, i.e. the number of rows per accumulation an application can use.

Note that the value is the same for both circuits. We do suppose both SRS are of the same sizes and the verifier circuits are the same.

§circuit_gates: Vec<Gadget>

The description of the program, in terms of gadgets. For now, the program is the same for both curves.

The number of elements is exactly the size of the SRS.

§selectors_comm: ([PolyComm<E1>; 18], [PolyComm<E2>; 18])

Commitments to the selectors used by both circuits

§constraints_fp: HashMap<Gadget, Vec<Sparse<Fp, { MV_POLYNOMIAL_ARITY }, { MAX_DEGREE }>>>

The constraints given as multivariate polynomials using the mvpoly library, indexed by the gadget to ease the selection of the constraints while computing the cross-terms during the accumulation process.

When the accumulation scheme is implemented, this structure will probably be subject to changes as the SNARK used for the accumulation scheme will probably work over expressions used in kimchi::circuits::expr. We leave that for the future, and focus on the accumulation scheme implementation.

We keep two sets of constraints for the time being as we might want in the future to have different circuits for one of the curves, as inspired by CycleFold. In the current design, both circuits are the same and the prover will do the same job over both curves.

§constraints_fq: HashMap<Gadget, Vec<Sparse<Fq, { MV_POLYNOMIAL_ARITY }, { MAX_DEGREE }>>>§initial_sponge: [BigInt; 3]

Initial state of the sponge, containing circuit specific information.

Implementations§

source§

impl<Fp: PrimeField, Fq: PrimeField, E1: ArrabbiataCurve<ScalarField = Fp, BaseField = Fq>, E2: ArrabbiataCurve<ScalarField = Fq, BaseField = Fp>> IndexedRelation<Fp, Fq, E1, E2>where E1::BaseField: PrimeField, E2::BaseField: PrimeField,

source

pub fn new(srs_log2_size: usize) -> Self

source

pub fn get_srs_size(&self) -> usize

source

pub fn get_srs_blinders(&self) -> (E1, E2)

Auto Trait Implementations§

§

impl<Fp, Fq, E1, E2> RefUnwindSafe for IndexedRelation<Fp, Fq, E1, E2>where E1: RefUnwindSafe, E2: RefUnwindSafe, Fp: RefUnwindSafe, Fq: RefUnwindSafe,

§

impl<Fp, Fq, E1, E2> Send for IndexedRelation<Fp, Fq, E1, E2>

§

impl<Fp, Fq, E1, E2> Sync for IndexedRelation<Fp, Fq, E1, E2>

§

impl<Fp, Fq, E1, E2> Unpin for IndexedRelation<Fp, Fq, E1, E2>where E1: Unpin, E2: Unpin, Fp: Unpin, Fq: Unpin,

§

impl<Fp, Fq, E1, E2> UnwindSafe for IndexedRelation<Fp, Fq, E1, E2>where E1: UnwindSafe, E2: UnwindSafe, Fp: UnwindSafe, Fq: 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
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