Struct redjubjub::batch::Verifier[][src]

pub struct Verifier { /* fields omitted */ }

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

impl Default for Verifier[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> Conv for T

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.