Add a check of the form ` = t`. Expects `a` and `b` to be of the same length
(
&mut self,
a: impl IntoIterator<Item = G>,
b: impl IntoIterator<Item = &'a G::ScalarField>,
t: G,
)
| 77 | |
| 78 | /// Add a check of the form `<a, b> = t`. Expects `a` and `b` to be of the same length |
| 79 | pub fn add_many<'a>( |
| 80 | &mut self, |
| 81 | a: impl IntoIterator<Item = G>, |
| 82 | b: impl IntoIterator<Item = &'a G::ScalarField>, |
| 83 | t: G, |
| 84 | ) { |
| 85 | for (a_i, b_i) in a.into_iter().zip(b) { |
| 86 | self.add(a_i, self.current_random * b_i); |
| 87 | } |
| 88 | self.add(t, -self.current_random); |
| 89 | self.current_random *= self.random; |
| 90 | } |
| 91 | |
| 92 | /// Combine all the checks into a multi-scalar multiplication and return true if the result is 0. |
| 93 | pub fn verify(&self) -> bool { |