[−][src]Struct redjubjub::batch::Verifier
A batch verification context.
Implementations
impl Verifier
[src]
pub fn new() -> Verifier
[src]
Construct a new batch verifier.
pub fn queue<I: Into<Item>>(&mut self, item: I)
[src]
Queue an Item for verification.
pub fn verify<R: RngCore + CryptoRng>(self, rng: R) -> Result<(), Error>
[src]
Perform batch verification, returning Ok(())
if all signatures were
valid and Err
otherwise.
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;
Since RedJubjub uses different subgroups for different types of signatures, SpendAuth's and Binding's, we need to have yet another point and associated scalar accumulator for all the signatures of each type in our batch, but we can still amortize computation nicely in one multiscalar multiplication:
h_G * ( [-sum(z_i * s_i): i_type == SpendAuth]P_SpendAuth + [-sum(z_i * s_i): i_type == Binding]P_Binding + sum([z_i]R_i) + sum([z_i * c_i]VK_i) ) = 0_G
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 RefUnwindSafe for Verifier
impl Send for Verifier
impl Sync for Verifier
impl Unpin for Verifier
impl UnwindSafe for Verifier
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,