pub struct BatchVerifier<S: RingSuite> { /* private fields */ }Expand description
Batch verifier for ring VRF proofs.
Collects multiple ring proofs and verifies them together, amortizing the cost of pairing checks and multi-scalar multiplications.
The same subgroup membership assumptions as Verifier apply to all
points fed into the batch (I/O pairs and proof points).
Implementations§
Source§impl<S: RingSuite> BatchVerifier<S>
impl<S: RingSuite> BatchVerifier<S>
Sourcepub fn new(ring_verifier: RingVerifier<S>) -> Self
pub fn new(ring_verifier: RingVerifier<S>) -> Self
Create a new batch verifier from a ring verifier instance.
Sourcepub fn prepare(
&self,
ios: impl AsRef<[VrfIo<S>]>,
ad: impl AsRef<[u8]>,
proof: &Proof<S>,
) -> BatchItem<S>
pub fn prepare( &self, ios: impl AsRef<[VrfIo<S>]>, ad: impl AsRef<[u8]>, proof: &Proof<S>, ) -> BatchItem<S>
Prepare a proof for deferred batch verification.
Performs the cheap per-proof work (hashing, transcript setup) without the expensive pairing and MSM checks.
Sourcepub fn push_prepared(&mut self, item: BatchItem<S>)
pub fn push_prepared(&mut self, item: BatchItem<S>)
Push a previously prepared item into the batch.
Auto Trait Implementations§
impl<S> Freeze for BatchVerifier<S>where
<<S as Suite>::Affine as AffineRepr>::Config: Sized,
<<S as Suite>::Affine as AffineRepr>::BaseField: Sized + Freeze,
<S as Suite>::Affine: Sized,
<<S as RingSuite>::Pairing as Pairing>::G1Affine: Freeze,
<<S as RingSuite>::Pairing as Pairing>::G2Prepared: Freeze,
<<S as RingSuite>::Pairing as Pairing>::ScalarField == <<S as Suite>::Affine as AffineRepr>::BaseField,
impl<S> RefUnwindSafe for BatchVerifier<S>where
<<S as Suite>::Affine as AffineRepr>::Config: Sized,
<<S as Suite>::Affine as AffineRepr>::BaseField: Sized + RefUnwindSafe,
<S as Suite>::Affine: Sized + RefUnwindSafe,
<<S as RingSuite>::Pairing as Pairing>::G1Affine: RefUnwindSafe,
<<S as RingSuite>::Pairing as Pairing>::G2Prepared: RefUnwindSafe,
<<S as Suite>::Affine as AffineRepr>::ScalarField: RefUnwindSafe,
<<S as RingSuite>::Pairing as Pairing>::ScalarField == <<S as Suite>::Affine as AffineRepr>::BaseField,
impl<S> Send for BatchVerifier<S>
impl<S> Sync for BatchVerifier<S>
impl<S> Unpin for BatchVerifier<S>where
<<S as Suite>::Affine as AffineRepr>::Config: Sized,
<<S as Suite>::Affine as AffineRepr>::BaseField: Sized + Unpin,
<S as Suite>::Affine: Sized + Unpin,
<<S as RingSuite>::Pairing as Pairing>::G1Affine: Unpin,
<<S as RingSuite>::Pairing as Pairing>::G2Prepared: Unpin,
<<S as Suite>::Affine as AffineRepr>::ScalarField: Unpin,
<<S as RingSuite>::Pairing as Pairing>::ScalarField == <<S as Suite>::Affine as AffineRepr>::BaseField,
impl<S> UnsafeUnpin for BatchVerifier<S>where
<<S as Suite>::Affine as AffineRepr>::Config: Sized,
<<S as Suite>::Affine as AffineRepr>::BaseField: Sized + UnsafeUnpin,
<S as Suite>::Affine: Sized,
<<S as RingSuite>::Pairing as Pairing>::G1Affine: UnsafeUnpin,
<<S as RingSuite>::Pairing as Pairing>::G2Prepared: UnsafeUnpin,
<<S as RingSuite>::Pairing as Pairing>::ScalarField == <<S as Suite>::Affine as AffineRepr>::BaseField,
impl<S> UnwindSafe for BatchVerifier<S>where
<<S as Suite>::Affine as AffineRepr>::Config: Sized,
<<S as Suite>::Affine as AffineRepr>::BaseField: Sized + UnwindSafe,
<S as Suite>::Affine: Sized + UnwindSafe,
<<S as RingSuite>::Pairing as Pairing>::G1Affine: UnwindSafe,
<<S as RingSuite>::Pairing as Pairing>::G2Prepared: UnwindSafe,
<<S as Suite>::Affine as AffineRepr>::ScalarField: UnwindSafe,
<<S as RingSuite>::Pairing as Pairing>::ScalarField == <<S as Suite>::Affine as AffineRepr>::BaseField,
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
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>
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 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>
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