Struct LinearCodePCS

Source
pub struct LinearCodePCS<L, F, P, C, H>
where F: PrimeField, C: Config, P: Polynomial<F>, H: CRHScheme, L: LinearEncode<F, C, P, H>,
{ /* private fields */ }
Expand description

Any linear-code-based commitment scheme.

Trait Implementations§

Source§

impl<L, F, P, C, H> PolynomialCommitment<F, P> for LinearCodePCS<L, F, P, C, H>
where L: LinearEncode<F, C, P, H>, F: PrimeField + Absorb, P: Polynomial<F>, C: Config + 'static, Vec<F>: Borrow<<H as CRHScheme>::Input>, H::Output: Into<C::Leaf> + Send, C::Leaf: Sized + Clone + Default + Send + AsRef<C::Leaf>, H: CRHScheme + 'static,

Source§

fn setup<R: RngCore>( max_degree: usize, num_vars: Option<usize>, rng: &mut R, ) -> Result<Self::UniversalParams, Self::Error>

This is only a default setup with reasonable parameters. To create your own public parameters (from which vk/ck can be derived by trim), see the documentation for BrakedownPCUniversalParams or LigeroPCUniversalParams.

Source§

type UniversalParams = <L as LinearEncode<F, C, P, H>>::LinCodePCParams

The universal parameters for the commitment scheme. These are “trimmed” down to Self::CommitterKey and Self::VerifierKey by Self::trim.
Source§

type CommitterKey = <L as LinearEncode<F, C, P, H>>::LinCodePCParams

The committer key for the scheme; used to commit to a polynomial and then open the commitment to produce an evaluation proof.
Source§

type VerifierKey = <L as LinearEncode<F, C, P, H>>::LinCodePCParams

The verifier key for the scheme; used to check an evaluation proof.
Source§

type Commitment = LinCodePCCommitment<C>

The commitment to a polynomial.
Source§

type CommitmentState = LinCodePCCommitmentState<F, H>

Auxiliary state of the commitment, output by the commit phase. It contains information that can be reused by the committer during the open phase, such as the commitment randomness. Not to be shared with the verifier.
Source§

type Proof = Vec<LinCodePCProof<F, C>>

The evaluation proof for a single point.
Source§

type BatchProof = Vec<<LinearCodePCS<L, F, P, C, H> as PolynomialCommitment<F, P>>::Proof>

The evaluation proof for a query set.
Source§

type Error = Error

The error type for the scheme.
Source§

fn trim( pp: &Self::UniversalParams, _supported_degree: usize, _supported_hiding_bound: usize, _enforced_degree_bounds: Option<&[usize]>, ) -> Result<(Self::CommitterKey, Self::VerifierKey), Self::Error>

Specializes the public parameters for polynomials up to the given supported_degree and for enforcing degree bounds in the range 1..=supported_degree.
Source§

fn commit<'a>( ck: &Self::CommitterKey, polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<F, P>>, _rng: Option<&mut dyn RngCore>, ) -> Result<(Vec<LabeledCommitment<Self::Commitment>>, Vec<Self::CommitmentState>), Self::Error>
where P: 'a,

Outputs a list of commitments to polynomials. If polynomials[i].is_hiding(), then the i-th commitment is hiding up to polynomials.hiding_bound() queries. rng should not be None if polynomials[i].is_hiding() == true for any i. Read more
Source§

fn open<'a>( ck: &Self::CommitterKey, _labeled_polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<F, P>>, commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>, point: &'a P::Point, sponge: &mut impl CryptographicSponge, states: impl IntoIterator<Item = &'a Self::CommitmentState>, _rng: Option<&mut dyn RngCore>, ) -> Result<Self::Proof, Self::Error>
where P: 'a, Self::CommitmentState: 'a, Self::Commitment: 'a,

open but with individual challenges
Source§

fn check<'a>( vk: &Self::VerifierKey, commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>, point: &'a P::Point, values: impl IntoIterator<Item = F>, proof_array: &Self::Proof, sponge: &mut impl CryptographicSponge, _rng: Option<&mut dyn RngCore>, ) -> Result<bool, Self::Error>
where Self::Commitment: 'a,

check but with individual challenges
Source§

fn batch_open<'a>( ck: &Self::CommitterKey, labeled_polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<F, P>>, commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>, query_set: &QuerySet<P::Point>, sponge: &mut impl CryptographicSponge, states: impl IntoIterator<Item = &'a Self::CommitmentState>, rng: Option<&mut dyn RngCore>, ) -> Result<Self::BatchProof, Self::Error>
where P: 'a, Self::CommitmentState: 'a, Self::Commitment: 'a,

Open several polynomials at one or more points each (possibly different for each polynomial). Each entry in the in the query set of points contains the label of the polynomial which should be queried at that point. Read more
Source§

fn batch_check<'a, R: RngCore>( vk: &Self::VerifierKey, commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>, query_set: &QuerySet<P::Point>, evaluations: &Evaluations<P::Point, F>, proof: &Self::BatchProof, sponge: &mut impl CryptographicSponge, rng: &mut R, ) -> Result<bool, Self::Error>
where Self::Commitment: 'a,

Verify opening proofs for several polynomials at one or more points each (possibly different for each polynomial). Each entry in the query set of points contains the label of the polynomial which was queried at that point. Read more
Source§

fn open_combinations<'a>( ck: &Self::CommitterKey, linear_combinations: impl IntoIterator<Item = &'a LinearCombination<F>>, polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<F, P>>, commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>, query_set: &QuerySet<P::Point>, sponge: &mut impl CryptographicSponge, states: impl IntoIterator<Item = &'a Self::CommitmentState>, rng: Option<&mut dyn RngCore>, ) -> Result<BatchLCProof<F, Self::BatchProof>, Self::Error>
where Self::CommitmentState: 'a, Self::Commitment: 'a, P: 'a,

Open commitments to all polynomials involved in a number of linear combinations (LC) simultaneously.
Source§

fn check_combinations<'a, R: RngCore>( vk: &Self::VerifierKey, linear_combinations: impl IntoIterator<Item = &'a LinearCombination<F>>, commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>, eqn_query_set: &QuerySet<P::Point>, eqn_evaluations: &Evaluations<P::Point, F>, proof: &BatchLCProof<F, Self::BatchProof>, sponge: &mut impl CryptographicSponge, rng: &mut R, ) -> Result<bool, Self::Error>
where Self::Commitment: 'a,

Verify opening proofs for all polynomials involved in a number of linear combinations (LC) simultaneously.

Auto Trait Implementations§

§

impl<L, F, P, C, H> Freeze for LinearCodePCS<L, F, P, C, H>

§

impl<L, F, P, C, H> RefUnwindSafe for LinearCodePCS<L, F, P, C, H>

§

impl<L, F, P, C, H> Send for LinearCodePCS<L, F, P, C, H>
where L: Send, P: Send, C: Send, H: Send,

§

impl<L, F, P, C, H> Sync for LinearCodePCS<L, F, P, C, H>
where L: Sync, C: Sync, H: Sync,

§

impl<L, F, P, C, H> Unpin for LinearCodePCS<L, F, P, C, H>
where L: Unpin, F: Unpin, P: Unpin, C: Unpin, H: Unpin,

§

impl<L, F, P, C, H> UnwindSafe for LinearCodePCS<L, F, P, C, H>

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

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V