pub struct DecomposableFoldingScheme<'a, CF: FoldingConfig> { /* private fields */ }
Implementations§
source§impl<'a, CF: FoldingConfig> DecomposableFoldingScheme<'a, CF>
impl<'a, CF: FoldingConfig> DecomposableFoldingScheme<'a, CF>
sourcepub fn new(
constraints: BTreeMap<CF::Selector, Vec<FoldingCompatibleExpr<CF>>>,
common_constraints: Vec<FoldingCompatibleExpr<CF>>,
srs: &'a CF::Srs,
domain: Radix2EvaluationDomain<<<CF as FoldingConfig>::Curve as AffineRepr>::ScalarField>,
structure: &CF::Structure
) -> (Self, FoldingCompatibleExpr<CF>)
pub fn new( constraints: BTreeMap<CF::Selector, Vec<FoldingCompatibleExpr<CF>>>, common_constraints: Vec<FoldingCompatibleExpr<CF>>, srs: &'a CF::Srs, domain: Radix2EvaluationDomain<<<CF as FoldingConfig>::Curve as AffineRepr>::ScalarField>, structure: &CF::Structure ) -> (Self, FoldingCompatibleExpr<CF>)
Creates a new folding scheme for decomposable circuits. It takes as input:
- a set of constraints, each associated with a particular selector;
- a list of common constraints, that are applied to every instance regardless of the selector (can be empty);
- a structured reference string;
- a domain;
- a structure of the associated folding configuration.
The function uses the normal
FoldingScheme::new()
function to create the decomposable scheme, using for that the concatenation of the constraints associated with each selector multiplied by the selector, and the common constraints. This product is performed withFoldingCompatibleExprInner::Extensions(ExpExtension::Selector(s))
.
sourcepub fn get_number_of_additional_columns(&self) -> usize
pub fn get_number_of_additional_columns(&self) -> usize
Return the number of additional columns added by quadraticization
sourcepub fn fold_instance_witness_pair<A, B, Sponge>(
&self,
a: A,
b: B,
selector: Option<CF::Selector>,
fq_sponge: &mut Sponge
) -> FoldingOutput<CF>where
A: RelaxablePair<CF::Curve, CF::Instance, CF::Witness>,
B: RelaxablePair<CF::Curve, CF::Instance, CF::Witness>,
Sponge: FqSponge<<<CF as FoldingConfig>::Curve as AffineRepr>::BaseField, CF::Curve, <<CF as FoldingConfig>::Curve as AffineRepr>::ScalarField>,
pub fn fold_instance_witness_pair<A, B, Sponge>( &self, a: A, b: B, selector: Option<CF::Selector>, fq_sponge: &mut Sponge ) -> FoldingOutput<CF>where A: RelaxablePair<CF::Curve, CF::Instance, CF::Witness>, B: RelaxablePair<CF::Curve, CF::Instance, CF::Witness>, Sponge: FqSponge<<<CF as FoldingConfig>::Curve as AffineRepr>::BaseField, CF::Curve, <<CF as FoldingConfig>::Curve as AffineRepr>::ScalarField>,
folding with a selector will assume that only the selector in question
is enabled (i.e. set to 1) in all rows, and any other selector is 0 over
all rows.
If that is not the case, providing None
will fold without assumptions
sourcepub fn fold_instance_pair<A, B, Sponge>(
&self,
a: A,
b: B,
error_commitments: [PolyComm<CF::Curve>; 2],
fq_sponge: &mut Sponge
) -> RelaxedInstance<CF::Curve, CF::Instance>where
A: RelaxableInstance<CF::Curve, CF::Instance>,
B: RelaxableInstance<CF::Curve, CF::Instance>,
Sponge: FqSponge<<<CF as FoldingConfig>::Curve as AffineRepr>::BaseField, CF::Curve, <<CF as FoldingConfig>::Curve as AffineRepr>::ScalarField>,
pub fn fold_instance_pair<A, B, Sponge>( &self, a: A, b: B, error_commitments: [PolyComm<CF::Curve>; 2], fq_sponge: &mut Sponge ) -> RelaxedInstance<CF::Curve, CF::Instance>where A: RelaxableInstance<CF::Curve, CF::Instance>, B: RelaxableInstance<CF::Curve, CF::Instance>, Sponge: FqSponge<<<CF as FoldingConfig>::Curve as AffineRepr>::BaseField, CF::Curve, <<CF as FoldingConfig>::Curve as AffineRepr>::ScalarField>,
Fold two relaxable instances into a relaxed instance.
It is parametrized by two different types A
and B
that represent
“relaxable” instances to be able to fold a normal and “already relaxed”
instance.
Auto Trait Implementations§
impl<'a, CF> RefUnwindSafe for DecomposableFoldingScheme<'a, CF>where <CF as FoldingConfig>::Challenge: RefUnwindSafe, <CF as FoldingConfig>::Column: RefUnwindSafe, <<CF as FoldingConfig>::Curve as AffineRepr>::ScalarField: RefUnwindSafe, <CF as FoldingConfig>::Selector: RefUnwindSafe, <CF as FoldingConfig>::Srs: RefUnwindSafe, <CF as FoldingConfig>::Structure: RefUnwindSafe,
impl<'a, CF> Send for DecomposableFoldingScheme<'a, CF>where <CF as FoldingConfig>::Challenge: Send, <CF as FoldingConfig>::Column: Send, <CF as FoldingConfig>::Selector: Send, <CF as FoldingConfig>::Srs: Sync, <CF as FoldingConfig>::Structure: Send,
impl<'a, CF> Sync for DecomposableFoldingScheme<'a, CF>where <CF as FoldingConfig>::Challenge: Sync, <CF as FoldingConfig>::Column: Sync, <CF as FoldingConfig>::Selector: Sync, <CF as FoldingConfig>::Srs: Sync, <CF as FoldingConfig>::Structure: Sync,
impl<'a, CF> Unpin for DecomposableFoldingScheme<'a, CF>where <CF as FoldingConfig>::Challenge: Unpin, <CF as FoldingConfig>::Column: Unpin, <<CF as FoldingConfig>::Curve as AffineRepr>::ScalarField: Unpin, <CF as FoldingConfig>::Selector: Unpin, <CF as FoldingConfig>::Structure: Unpin,
impl<'a, CF> UnwindSafe for DecomposableFoldingScheme<'a, CF>where <CF as FoldingConfig>::Challenge: UnwindSafe, <CF as FoldingConfig>::Column: UnwindSafe, <<CF as FoldingConfig>::Curve as AffineRepr>::ScalarField: UnwindSafe, <CF as FoldingConfig>::Selector: UnwindSafe, <CF as FoldingConfig>::Srs: RefUnwindSafe, <CF as FoldingConfig>::Structure: 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