Skip to main content

ProverSetup

Struct ProverSetup 

Source
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::G1

h₁ - blinding generator in G1

§h2: E::G2

h₂ - blinding generator in G2

§ht: E::GT

h_t = e(h₁, h₂) - precomputed pairing

Implementations§

Source§

impl<E: PairingCurve> ProverSetup<E>

Source

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 generator
  • max_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

Source

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.

Source

pub fn max_nu(&self) -> usize

Returns the maximum nu (log column dimension) supported by this setup

Source

pub fn max_sigma(&self) -> usize

Returns the maximum sigma (log row dimension) supported by this setup

For square matrices, this always equals max_nu()

Source

pub fn max_log_n(&self) -> usize

Returns the maximum log₂ of polynomial size supported

For n×n matrices: max_log_n = 2 * max_nu

Trait Implementations§

Source§

impl<E: Clone + PairingCurve> Clone for ProverSetup<E>
where E::G1: Clone, E::G2: Clone, E::GT: Clone,

Source§

fn clone(&self) -> ProverSetup<E>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<E: Debug + PairingCurve> Debug for ProverSetup<E>
where E::G1: Debug, E::G2: Debug, E::GT: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<E: PairingCurve> DoryDeserialize for ProverSetup<E>

Source§

fn deserialize_with_mode<R: Read>( reader: R, compress: Compress, validate: Validate, ) -> Result<Self, SerializationError>

Deserialize with customization flags.
Source§

fn deserialize_compressed<R: Read>( reader: R, ) -> Result<Self, SerializationError>
where Self: Sized,

Deserialize from compressed form with validation.
Source§

fn deserialize_compressed_unchecked<R: Read>( reader: R, ) -> Result<Self, SerializationError>
where Self: Sized,

Deserialize from compressed form without validation. Read more
Source§

fn deserialize_uncompressed<R: Read>( reader: R, ) -> Result<Self, SerializationError>
where Self: Sized,

Deserialize from uncompressed form with validation.
Source§

fn deserialize_uncompressed_unchecked<R: Read>( reader: R, ) -> Result<Self, SerializationError>
where Self: Sized,

Deserialize from uncompressed form without validation. Read more
Source§

impl<E: PairingCurve> DorySerialize for ProverSetup<E>

Source§

fn serialize_with_mode<W: Write>( &self, writer: W, compress: Compress, ) -> Result<(), SerializationError>

Serialize with customization flags.
Source§

fn serialized_size(&self, compress: Compress) -> usize

Returns the serialized size in bytes for the given compression mode.
Source§

fn serialize_compressed<W: Write>( &self, writer: W, ) -> Result<(), SerializationError>

Serialize in compressed form.
Source§

fn compressed_size(&self) -> usize

Returns the compressed size in bytes.
Source§

fn serialize_uncompressed<W: Write>( &self, writer: W, ) -> Result<(), SerializationError>

Serialize in uncompressed form.
Source§

fn uncompressed_size(&self) -> usize

Returns the uncompressed size in bytes.
Source§

impl From<ArkworksProverSetup> for ProverSetup<BN254>

Source§

fn from(setup: ArkworksProverSetup) -> Self

Converts to this type from the input type.
Source§

impl From<ProverSetup<BN254>> for ArkworksProverSetup

Source§

fn from(setup: ProverSetup<BN254>) -> Self

Converts to this type from the input type.

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>

§

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>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more