Struct poly_commit::KzgParams
source · pub struct KzgParams<P: Pairing> { /* private fields */ }Expand description
Kate polynomial commitment params used for prover polynomial domain and proof verification
Implementations§
source§impl<P: Pairing> KzgParams<P>
impl<P: Pairing> KzgParams<P>
pub fn setup(k: u64, r: P::ScalarField) -> Self
pub fn commit( &self, poly: &Coefficients<P::ScalarField> ) -> Result<Commitment<P::G1Affine>, Error>
pub fn commit_key(&self) -> &Vec<P::G1Affine>
pub fn opening_key(&self) -> P::G2Affine
pub fn beta_h(&self) -> P::G2Affine
pub fn max_degree(&self) -> usize
pub fn trim(&self, truncated_degree: usize) -> Self
pub fn create_witness( &self, poly: &Coefficients<P::ScalarField>, at: P::ScalarField ) -> Witness<P>
sourcepub fn compute_aggregate_witness(
&self,
polynomials: &[Coefficients<P::ScalarField>],
point: &P::ScalarField,
v_challenge: &P::ScalarField
) -> Coefficients<P::ScalarField>
pub fn compute_aggregate_witness( &self, polynomials: &[Coefficients<P::ScalarField>], point: &P::ScalarField, v_challenge: &P::ScalarField ) -> Coefficients<P::ScalarField>
Computes a single witness for multiple polynomials at the same point, by taking a random linear combination of the individual witnesses. We apply the same optimization mentioned in when computing each witness; removing f(z).
Trait Implementations§
source§impl<P: Pairing> Decode for KzgParams<P>where
Vec<P::G1Affine>: Decode,
P::G2Affine: Decode,
impl<P: Pairing> Decode for KzgParams<P>where Vec<P::G1Affine>: Decode, P::G2Affine: Decode,
source§impl<P: Default + Pairing> Default for KzgParams<P>where
P::G1Affine: Default,
P::G2Affine: Default,
impl<P: Default + Pairing> Default for KzgParams<P>where P::G1Affine: Default, P::G2Affine: Default,
source§impl<P: Pairing> Encode for KzgParams<P>where
Vec<P::G1Affine>: Encode,
P::G2Affine: Encode,
impl<P: Pairing> Encode for KzgParams<P>where Vec<P::G1Affine>: Encode, P::G2Affine: Encode,
source§fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy )
Convert self to a slice and append it to the destination.
source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
If possible give a hint of expected size of the encoding. Read more
source§fn using_encoded<R, F>(&self, f: F) -> Rwhere
F: FnOnce(&[u8]) -> R,
fn using_encoded<R, F>(&self, f: F) -> Rwhere F: FnOnce(&[u8]) -> R,
Convert self to a slice and then invoke the given closure with it.
source§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more
source§impl<P: PartialEq + Pairing> PartialEq<KzgParams<P>> for KzgParams<P>where
P::G1Affine: PartialEq,
P::G2Affine: PartialEq,
impl<P: PartialEq + Pairing> PartialEq<KzgParams<P>> for KzgParams<P>where P::G1Affine: PartialEq, P::G2Affine: PartialEq,
impl<P: Pairing> EncodeLike<KzgParams<P>> for KzgParams<P>where Vec<P::G1Affine>: Encode, P::G2Affine: Encode,
impl<P: Pairing> StructuralPartialEq for KzgParams<P>
Auto Trait Implementations§
impl<P> RefUnwindSafe for KzgParams<P>where <P as Pairing>::G1Affine: RefUnwindSafe, <P as Pairing>::G2Affine: RefUnwindSafe,
impl<P> Send for KzgParams<P>where <P as Pairing>::G2Affine: Send,
impl<P> Sync for KzgParams<P>where <P as Pairing>::G2Affine: Sync,
impl<P> Unpin for KzgParams<P>where <P as Pairing>::G1Affine: Unpin, <P as Pairing>::G2Affine: Unpin,
impl<P> UnwindSafe for KzgParams<P>where <P as Pairing>::G1Affine: UnwindSafe, <P as Pairing>::G2Affine: 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