pub struct BatchVerifier<S: RingSuite> { /* private fields */ }Expand description
Batch verifier for ring VRF proofs.
Collects ring proofs from one or more rings (sharing the same KZG SRS) 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 seeded with the KZG SRS taken from ring_verifier.
Any ring verifier sharing the same SRS can later be passed to
Self::push or BatchItem::new; the verifier supplied here is
only used to extract the KZG verifier key.
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.
Sourcepub fn push(
&mut self,
verifier: &RingVerifier<S>,
ios: impl AsRef<[VrfIo<S>]>,
ad: impl AsRef<[u8]>,
proof: &Proof<S>,
) -> Result<(), Error>
pub fn push( &mut self, verifier: &RingVerifier<S>, ios: impl AsRef<[VrfIo<S>]>, ad: impl AsRef<[u8]>, proof: &Proof<S>, ) -> Result<(), Error>
Prepare and push a proof in one step.
Returns Error::InvalidData if the proof’s key commitment cannot be
converted (e.g. identity point on SW-form suites).
Auto Trait Implementations§
impl<S> Freeze for BatchVerifier<S>
impl<S> RefUnwindSafe for BatchVerifier<S>where
<S as Suite>::Affine: Sized + RefUnwindSafe,
<<S as Suite>::Affine as AffineRepr>::Config: Sized,
<<S as Suite>::Affine as AffineRepr>::BaseField: 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,
impl<S> Send for BatchVerifier<S>
impl<S> Sync for BatchVerifier<S>
impl<S> Unpin for BatchVerifier<S>where
<S as Suite>::Affine: Sized + Unpin,
<<S as Suite>::Affine as AffineRepr>::Config: Sized,
<<S as Suite>::Affine as AffineRepr>::BaseField: 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,
impl<S> UnsafeUnpin for BatchVerifier<S>where
<S as Suite>::Affine: Sized,
<<S as Suite>::Affine as AffineRepr>::Config: Sized,
<<S as Suite>::Affine as AffineRepr>::BaseField: Sized,
<<S as RingSuite>::Pairing as Pairing>::G1Affine: UnsafeUnpin,
<<S as RingSuite>::Pairing as Pairing>::G2Prepared: UnsafeUnpin,
impl<S> UnwindSafe for BatchVerifier<S>where
<S as Suite>::Affine: Sized + UnwindSafe,
<<S as Suite>::Affine as AffineRepr>::Config: Sized,
<<S as Suite>::Affine as AffineRepr>::BaseField: 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,
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> 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