pub struct BatchVerifier<E: Pairing, T>{ /* 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>
impl<E: Pairing, T> BatchVerifier<E, T>
Sourcepub fn new(kzg_vk: KzgVerifierKey<E>, transcript: T) -> Self
pub fn new(kzg_vk: KzgVerifierKey<E>, transcript: T) -> Self
Creates a new multi-ring batch verifier.
Sourcepub 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>,
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.
Sourcepub fn push_prepared<J>(&mut self, item: BatchItem<E, J>)where
J: TECurveConfig<BaseField = E::ScalarField>,
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.
Auto Trait Implementations§
impl<E, T> Freeze for BatchVerifier<E, T>
impl<E, T> RefUnwindSafe for BatchVerifier<E, T>where
T: RefUnwindSafe,
<E as Pairing>::G1Affine: RefUnwindSafe,
<E as Pairing>::G2Prepared: RefUnwindSafe,
<E as Pairing>::ScalarField: RefUnwindSafe,
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>where
T: UnsafeUnpin,
<E as Pairing>::G1Affine: UnsafeUnpin,
<E as Pairing>::G2Prepared: UnsafeUnpin,
impl<E, T> UnwindSafe for BatchVerifier<E, T>where
T: UnwindSafe,
<E as Pairing>::G1Affine: UnwindSafe,
<E as Pairing>::G2Prepared: UnwindSafe,
<E as Pairing>::ScalarField: 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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