Combine all the checks into a multi-scalar multiplication and return true if the result is 0.
(&self)
| 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 { |
| 94 | let mut points = Vec::with_capacity(self.len()); |
| 95 | let mut scalars = Vec::with_capacity(self.len()); |
| 96 | for (_, (s, point)) in self.args.iter() { |
| 97 | points.push(*point); |
| 98 | scalars.push(*s); |
| 99 | } |
| 100 | G::Group::msm_unchecked(&points, &scalars).is_zero() |
| 101 | } |
| 102 | |
| 103 | pub fn len(&self) -> usize { |
| 104 | self.args.len() |