Struct poly_commitment::commitment::PolyComm
source · pub struct PolyComm<C> {
pub chunks: Vec<C>,
}
Expand description
Represent a polynomial commitment when the type is instantiated with a curve.
The structure also handles chunking, i.e. when we aim to handle polynomials
whose degree is higher than the SRS size. For this reason, we do use a
vector for the field chunks
.
Note that the parameter C
is not constrained to be a curve, therefore in
some places in the code, C
can refer to a scalar field element. For
instance, PolyComm<G::ScalarField>
is used to represent the evaluation of the
polynomial bound by a specific commitment, at a particular evaluation point.
Fields§
§chunks: Vec<C>
Implementations§
source§impl<C> PolyComm<C>where
C: CommitmentCurve,
impl<C> PolyComm<C>where C: CommitmentCurve,
sourcepub fn chunk_commitment(&self, zeta_n: C::ScalarField) -> Self
pub fn chunk_commitment(&self, zeta_n: C::ScalarField) -> Self
Multiplies each commitment chunk of f with powers of zeta^n
source§impl<F> PolyComm<F>where
F: Field,
impl<F> PolyComm<F>where F: Field,
sourcepub fn chunk_blinding(&self, zeta_n: F) -> F
pub fn chunk_blinding(&self, zeta_n: F) -> F
Multiplies each blinding chunk of f with powers of zeta^n
source§impl<A: Copy + Clone + CanonicalDeserialize + CanonicalSerialize> PolyComm<A>
impl<A: Copy + Clone + CanonicalDeserialize + CanonicalSerialize> PolyComm<A>
pub fn map<B, F>(&self, f: F) -> PolyComm<B>where F: FnMut(A) -> B, B: CanonicalDeserialize + CanonicalSerialize,
pub fn zip<B: Copy + CanonicalDeserialize + CanonicalSerialize>( &self, other: &PolyComm<B> ) -> Option<PolyComm<(A, B)>>
sourcepub fn get_first_chunk(&self) -> A
pub fn get_first_chunk(&self) -> A
Return only the first chunk Getting this single value is relatively common in the codebase, even though we should not do this, and abstract the chunks in the structure.
source§impl<C: AffineRepr> PolyComm<C>
impl<C: AffineRepr> PolyComm<C>
pub fn scale(&self, c: C::ScalarField) -> PolyComm<C>
sourcepub fn multi_scalar_mul(com: &[&PolyComm<C>], elm: &[C::ScalarField]) -> Self
pub fn multi_scalar_mul(com: &[&PolyComm<C>], elm: &[C::ScalarField]) -> Self
Performs a multi-scalar multiplication between scalars elm
and commitments com
.
If both are empty, returns a commitment of length 1 containing the point at infinity.
Panics
Panics if com
and elm
are not of the same size.