pub struct Verifier<C: Ciphersuite> { /* private fields */ }
Expand description
A batch verification context.
Implementations§
Source§impl<C> Verifier<C>where
C: Ciphersuite,
impl<C> Verifier<C>where
C: Ciphersuite,
Sourcepub fn verify<R: RngCore + CryptoRng>(self, rng: R) -> Result<(), Error<C>>
pub fn verify<R: RngCore + CryptoRng>(self, rng: R) -> Result<(), Error<C>>
Performs batch verification, returning Ok(())
if all signatures were
valid and Err
otherwise, or if the batch is empty.
The batch verification equation is:
h_G * -[sum(z_i * s_i)]P_G + sum([z_i]R_i + [z_i * c_i]VK_i) = 0_G
which we split out into:
h_G * -[sum(z_i * s_i)]P_G + sum([z_i]R_i) + sum([z_i * c_i]VK_i) = 0_G
so that we can use multiscalar multiplication speedups.
where for each signature i,
- VK_i is the verification key;
- R_i is the signature’s R value;
- s_i is the signature’s s value;
- c_i is the hash of the message and other data;
- z_i is a random 128-bit Scalar;
- h_G is the cofactor of the group;
- P_G is the generator of the subgroup;
As follows elliptic curve scalar multiplication convention, scalar variables are lowercase and group point variables are uppercase. This does not exactly match the RedDSA notation in the protocol specification §B.1.
Trait Implementations§
Auto Trait Implementations§
impl<C> Freeze for Verifier<C>
impl<C> RefUnwindSafe for Verifier<C>where
<<C as Ciphersuite>::Group as Group>::Element: RefUnwindSafe,
<<<C as Ciphersuite>::Group as Group>::Field as Field>::Scalar: RefUnwindSafe,
impl<C> Send for Verifier<C>
impl<C> Sync for Verifier<C>
impl<C> Unpin for Verifier<C>
impl<C> UnwindSafe for Verifier<C>where
<<C as Ciphersuite>::Group as Group>::Element: UnwindSafe,
<<<C as Ciphersuite>::Group as Group>::Field as Field>::Scalar: 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
Mutably borrows from an owned value. Read more