Skip to main content

BatchVerifier

Struct BatchVerifier 

Source
pub struct BatchVerifier<E: Pairing, T>
where T: PlonkTranscript<E::ScalarField, KZG<E>>,
{ /* private fields */ }
Expand description

Accumulating batch verifier for ring proofs across one or more rings.

Accumulates proofs from one or more rings (keysets) into a single batched pairing check. All rings must share the same KZG SRS.

Holds its own transcript instance, cloned on each push_prepared call so the per-proof entropy can be folded in without touching the originating RingVerifier. Per-proof independence is ensured by the entropy derived during preparation (which absorbs the full proof via the per-ring transcript), so the base transcript only needs to be deterministic, not proof-specific.

Implementations§

Source§

impl<E: Pairing, T> BatchVerifier<E, T>
where T: PlonkTranscript<E::ScalarField, KZG<E>>,

Source

pub fn new(kzg_vk: KzgVerifierKey<E>, transcript: T) -> Self

Creates a new multi-ring batch verifier.

Source

pub fn push<J>( &mut self, verifier: &RingVerifier<E::ScalarField, KZG<E>, J, T>, proof: RingProof<E::ScalarField, KZG<E>>, result: Affine<J>, )
where J: TECurveConfig<BaseField = E::ScalarField>,

Adds a ring proof to the batch.

Source

pub fn push_prepared<J>(&mut self, item: BatchItem<E, J>)
where J: TECurveConfig<BaseField = E::ScalarField>,

Accumulates a prepared BatchItem into the batch.

Equivalent to push, but splits the work: the caller builds the BatchItem (transcript replay, challenge derivation, PIOP setup) separately from accumulation. Useful when preparation should be parallelized. BatchItem::new is independent of the accumulator state, so multiple items can be built in parallel and then pushed sequentially here.

Source

pub fn verify(&self) -> bool

Verifies all accumulated proofs in a single batched pairing check.

Auto Trait Implementations§

§

impl<E, T> Freeze for BatchVerifier<E, T>
where T: Freeze, <E as Pairing>::G1Affine: Freeze, <E as Pairing>::G2Prepared: Freeze,

§

impl<E, T> RefUnwindSafe for BatchVerifier<E, T>

§

impl<E, T> Send for BatchVerifier<E, T>
where T: Send,

§

impl<E, T> Sync for BatchVerifier<E, T>
where T: Sync,

§

impl<E, T> Unpin for BatchVerifier<E, T>
where T: Unpin, <E as Pairing>::G1Affine: Unpin, <E as Pairing>::G2Prepared: Unpin, <E as Pairing>::ScalarField: Unpin,

§

impl<E, T> UnsafeUnpin for BatchVerifier<E, T>

§

impl<E, T> UnwindSafe for BatchVerifier<E, T>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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