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
- 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
- each of the evals row by row with the utf-8 message
- Constructs by
- Reading
SCALAR_SIZE
bytes fromtranscript
with utf-8 messageopen gamma
- Intepreting the bytes as an integer in big endian modded by the modulus of the scalar field
- Reading
- Computing, for each polynomial
- Polynomial divide to get , with remainder .
- Compute
- Serialize in compressed form and transcribe with the message
open W1
. - Construct in the same way as we did , reading with message
open z
. - Compute by computing . 1
- Comupute
- Compute
- Compute
- Compute
- 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
- Transcribes the points/evals the same as in the opening
- Reads same is in the opening
- Transcribes
- Reads same is in opening
- Lagrange interpolate using the given evaluations, same as in method 1.
- Compute
- Compute
- Compute
- Compute
- Return
true
if
1
For why this works, see the A. Optimizations