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.
Trait Implementations§
Source§impl<'de, C> Deserialize<'de> for PolyComm<C>where
C: CanonicalDeserialize + CanonicalSerialize,
impl<'de, C> Deserialize<'de> for PolyComm<C>where
C: CanonicalDeserialize + CanonicalSerialize,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<'de, T, U> DeserializeAs<'de, PolyComm<T>> for PolyComm<U>where
U: DeserializeAs<'de, T>,
impl<'de, T, U> DeserializeAs<'de, PolyComm<T>> for PolyComm<U>where
U: DeserializeAs<'de, T>,
Source§fn deserialize_as<D>(deserializer: D) -> Result<PolyComm<T>, D::Error>where
D: Deserializer<'de>,
fn deserialize_as<D>(deserializer: D) -> Result<PolyComm<T>, D::Error>where
D: Deserializer<'de>,
Source§impl<'a, G, CamlG> From<&'a CamlPolyComm<CamlG>> for PolyComm<G>
impl<'a, G, CamlG> From<&'a CamlPolyComm<CamlG>> for PolyComm<G>
Source§fn from(camlpolycomm: &'a CamlPolyComm<CamlG>) -> PolyComm<G>
fn from(camlpolycomm: &'a CamlPolyComm<CamlG>) -> PolyComm<G>
Source§impl<'a, G, CamlG> From<&'a PolyComm<G>> for CamlPolyComm<CamlG>
impl<'a, G, CamlG> From<&'a PolyComm<G>> for CamlPolyComm<CamlG>
Source§impl<G, CamlG> From<CamlPolyComm<CamlG>> for PolyComm<G>where
G: AffineRepr + From<CamlG>,
impl<G, CamlG> From<CamlPolyComm<CamlG>> for PolyComm<G>where
G: AffineRepr + From<CamlG>,
Source§fn from(camlpolycomm: CamlPolyComm<CamlG>) -> PolyComm<G>
fn from(camlpolycomm: CamlPolyComm<CamlG>) -> PolyComm<G>
Source§impl<'a, G> IntoIterator for &'a PolyComm<G>
impl<'a, G> IntoIterator for &'a PolyComm<G>
Source§impl<T, U> SerializeAs<PolyComm<T>> for PolyComm<U>where
U: SerializeAs<T>,
impl<T, U> SerializeAs<PolyComm<T>> for PolyComm<U>where
U: SerializeAs<T>,
Source§fn serialize_as<S>(
source: &PolyComm<T>,
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
fn serialize_as<S>(
source: &PolyComm<T>,
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
impl<C: Eq> Eq for PolyComm<C>
impl<C> StructuralPartialEq for PolyComm<C>
Auto Trait Implementations§
impl<C> Freeze for PolyComm<C>
impl<C> RefUnwindSafe for PolyComm<C>where
C: RefUnwindSafe,
impl<C> Send for PolyComm<C>where
C: Send,
impl<C> Sync for PolyComm<C>where
C: Sync,
impl<C> Unpin for PolyComm<C>where
C: Unpin,
impl<C> UnwindSafe for PolyComm<C>where
C: UnwindSafe,
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)