pub struct ProverSetup<E: PairingCurve> {
pub g1_vec: Vec<E::G1>,
pub g2_vec: Vec<E::G2>,
pub h1: E::G1,
pub h2: E::G2,
pub ht: E::GT,
}Expand description
Prover setup parameters
Contains the generators and parameters needed to create proofs. The setup is transparent (no trusted setup) and can be generated from public randomness.
For square matrices: |Γ₁| = |Γ₂| = 2^((max_log_n+1)/2)
Fields§
§g1_vec: Vec<E::G1>Γ₁ - column generators in G1
g2_vec: Vec<E::G2>Γ₂ - row generators in G2
h1: E::G1h₁ - blinding generator in G1
h2: E::G2h₂ - blinding generator in G2
ht: E::GTh_t = e(h₁, h₂) - precomputed pairing
Implementations§
Source§impl<E: PairingCurve> ProverSetup<E>
impl<E: PairingCurve> ProverSetup<E>
Sourcepub fn new<R: RngCore>(rng: &mut R, max_log_n: usize) -> Self
pub fn new<R: RngCore>(rng: &mut R, max_log_n: usize) -> Self
Generate new prover setup with transparent randomness
For square matrices, generates n = 2^((max_log_n+1)/2) generators for both G1 and G2, supporting polynomials up to 2^max_log_n coefficients arranged as n×n matrices.
§Parameters
rng: Random number generatormax_log_n: Maximum log₂ of polynomial size (for n×n matrix with n² = 2^max_log_n)
§Returns
A new ProverSetup with randomly generated parameters
Sourcepub fn to_verifier_setup(&self) -> VerifierSetup<E>
pub fn to_verifier_setup(&self) -> VerifierSetup<E>
Derive verifier setup from prover setup
Precomputes pairing values for efficient verification by computing delta and chi values for all rounds of the inner product protocol.
Sourcepub fn max_nu(&self) -> usize
pub fn max_nu(&self) -> usize
Returns the maximum nu (log column dimension) supported by this setup
Trait Implementations§
Source§impl<E: Clone + PairingCurve> Clone for ProverSetup<E>
impl<E: Clone + PairingCurve> Clone for ProverSetup<E>
Source§fn clone(&self) -> ProverSetup<E>
fn clone(&self) -> ProverSetup<E>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<E: Debug + PairingCurve> Debug for ProverSetup<E>
impl<E: Debug + PairingCurve> Debug for ProverSetup<E>
Source§impl<E: PairingCurve> DoryDeserialize for ProverSetup<E>where
Vec<E::G1>: DoryDeserialize,
Vec<E::G2>: DoryDeserialize,
E::G1: DoryDeserialize,
E::G2: DoryDeserialize,
E::GT: DoryDeserialize,
impl<E: PairingCurve> DoryDeserialize for ProverSetup<E>where
Vec<E::G1>: DoryDeserialize,
Vec<E::G2>: DoryDeserialize,
E::G1: DoryDeserialize,
E::G2: DoryDeserialize,
E::GT: DoryDeserialize,
Source§fn deserialize_with_mode<R: Read>(
reader: R,
compress: Compress,
validate: Validate,
) -> Result<Self, SerializationError>
fn deserialize_with_mode<R: Read>( reader: R, compress: Compress, validate: Validate, ) -> Result<Self, SerializationError>
Source§fn deserialize_compressed<R: Read>(
reader: R,
) -> Result<Self, SerializationError>where
Self: Sized,
fn deserialize_compressed<R: Read>(
reader: R,
) -> Result<Self, SerializationError>where
Self: Sized,
Source§fn deserialize_compressed_unchecked<R: Read>(
reader: R,
) -> Result<Self, SerializationError>where
Self: Sized,
fn deserialize_compressed_unchecked<R: Read>(
reader: R,
) -> Result<Self, SerializationError>where
Self: Sized,
Source§fn deserialize_uncompressed<R: Read>(
reader: R,
) -> Result<Self, SerializationError>where
Self: Sized,
fn deserialize_uncompressed<R: Read>(
reader: R,
) -> Result<Self, SerializationError>where
Self: Sized,
Source§fn deserialize_uncompressed_unchecked<R: Read>(
reader: R,
) -> Result<Self, SerializationError>where
Self: Sized,
fn deserialize_uncompressed_unchecked<R: Read>(
reader: R,
) -> Result<Self, SerializationError>where
Self: Sized,
Source§impl<E: PairingCurve> DorySerialize for ProverSetup<E>where
Vec<E::G1>: DorySerialize,
Vec<E::G2>: DorySerialize,
E::G1: DorySerialize,
E::G2: DorySerialize,
E::GT: DorySerialize,
impl<E: PairingCurve> DorySerialize for ProverSetup<E>where
Vec<E::G1>: DorySerialize,
Vec<E::G2>: DorySerialize,
E::G1: DorySerialize,
E::G2: DorySerialize,
E::GT: DorySerialize,
Source§fn serialize_with_mode<W: Write>(
&self,
writer: W,
compress: Compress,
) -> Result<(), SerializationError>
fn serialize_with_mode<W: Write>( &self, writer: W, compress: Compress, ) -> Result<(), SerializationError>
Source§fn serialized_size(&self, compress: Compress) -> usize
fn serialized_size(&self, compress: Compress) -> usize
Source§fn serialize_compressed<W: Write>(
&self,
writer: W,
) -> Result<(), SerializationError>
fn serialize_compressed<W: Write>( &self, writer: W, ) -> Result<(), SerializationError>
Source§fn compressed_size(&self) -> usize
fn compressed_size(&self) -> usize
Source§fn serialize_uncompressed<W: Write>(
&self,
writer: W,
) -> Result<(), SerializationError>
fn serialize_uncompressed<W: Write>( &self, writer: W, ) -> Result<(), SerializationError>
Source§fn uncompressed_size(&self) -> usize
fn uncompressed_size(&self) -> usize
Source§impl From<ArkworksProverSetup> for ProverSetup<BN254>
impl From<ArkworksProverSetup> for ProverSetup<BN254>
Source§fn from(setup: ArkworksProverSetup) -> Self
fn from(setup: ArkworksProverSetup) -> Self
Source§impl From<ProverSetup<BN254>> for ArkworksProverSetup
impl From<ProverSetup<BN254>> for ArkworksProverSetup
Source§fn from(setup: ProverSetup<BN254>) -> Self
fn from(setup: ProverSetup<BN254>) -> Self
Auto Trait Implementations§
impl<E> Freeze for ProverSetup<E>where
<E as PairingCurve>::G1: Freeze,
<E as PairingCurve>::G2: Freeze,
<E as PairingCurve>::GT: Freeze,
impl<E> RefUnwindSafe for ProverSetup<E>where
<E as PairingCurve>::G1: RefUnwindSafe,
<E as PairingCurve>::G2: RefUnwindSafe,
<E as PairingCurve>::GT: RefUnwindSafe,
impl<E> Send for ProverSetup<E>
impl<E> Sync for ProverSetup<E>
impl<E> Unpin for ProverSetup<E>where
<E as PairingCurve>::G1: Unpin,
<E as PairingCurve>::G2: Unpin,
<E as PairingCurve>::GT: Unpin,
impl<E> UnwindSafe for ProverSetup<E>where
<E as PairingCurve>::G1: UnwindSafe,
<E as PairingCurve>::G2: UnwindSafe,
<E as PairingCurve>::GT: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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