arkworks-rs / groth16

A Rust implementation of the Groth16 zkSNARK
https://www.arkworks.rs
Apache License 2.0
252 stars 101 forks source link

Fix a doc typo on `gamma_abc_g1` in `VerifyingKey` #13

Closed weikengchen closed 3 years ago

weikengchen commented 3 years ago

According to Groth16, gamma_abc_g1 is gamma^{-1} * (beta * a_i + alpha * b_i + c_i) * H instead of gamma^{-1} * (alpha * a_i + beta * b_i + c_i) * H.

This can also be seen from the code here:

let gamma_abc = cfg_iter!(a[..num_instance_variables])
        .zip(&b[..num_instance_variables])
        .zip(&c[..num_instance_variables])
        .map(|((a, b), c)| (beta * a + &(alpha * b) + c) * &gamma_inverse)
        .collect::<Vec<_>>();