4. Method 2

This method biases towards a faster verifying time, and is roughly twice as slow to open on. The API is exactly the same as in method 1. See A. Optimizations for more details.

M2Open


#![allow(unused)]
fn main() {
M2Open(transcript: Transcript, 
       evals: Vec<Vec<Scalar>>, 
       polys: Vec<Polynomial>, 
       point_set_index: usize) -> Proof
}

This method

  1. Transcribes the following (all points serialized compressed if possible)
    • each of the evals row by row with the utf-8 message open evals
    • each of the points in order with the utf-8 message open points
  2. Constructs by
    • Reading SCALAR_SIZE bytes from transcript with utf-8 message open gamma
    • Intepreting the bytes as an integer in big endian modded by the modulus of the scalar field
  3. Computing, for each polynomial
  4. Polynomial divide to get , with remainder .
  5. Compute
  6. Serialize in compressed form and transcribe with the message open W1.
  7. Construct in the same way as we did , reading with message open z.
  8. Compute by computing . 1
  9. Comupute
  10. Compute
  11. Compute
  12. Compute
  13. Return and serialize in compressed form

M2Verify


#![allow(unused)]
fn main() {
M2Verify(transcript: Transcript, 
         commits: Vec<Commitment>, 
         evals: Vec<Vec<Scalar>>,
         (w_1, w_2): Proof,
         point_set_index: usize) -> bool
}

Let the evals be , commits be , and the points be . Commit must be for the polynomial that evaluates to at points .

This method

  1. Transcribes the points/evals the same as in the opening
  2. Reads same is in the opening
  3. Transcribes
  4. Reads same is in opening
  5. Lagrange interpolate using the given evaluations, same as in method 1.
  6. Compute
  7. Compute
  8. Compute
  9. Compute
  10. Return true if
1

For why this works, see the A. Optimizations