Keys of `missing_responses` are the witness indices whose response was generated while creating this. Instead, these come from some other Schnorr protocol.
(
&self,
bases: &[G],
y: &G,
t: &G,
challenge: &G::ScalarField,
missing_responses: BTreeMap<usize, G::ScalarField>,
)
| 147 | /// Keys of `missing_responses` are the witness indices whose response was generated while creating this. Instead, |
| 148 | /// these come from some other Schnorr protocol. |
| 149 | pub fn is_valid( |
| 150 | &self, |
| 151 | bases: &[G], |
| 152 | y: &G, |
| 153 | t: &G, |
| 154 | challenge: &G::ScalarField, |
| 155 | missing_responses: BTreeMap<usize, G::ScalarField>, |
| 156 | ) -> Result<(), SchnorrError> { |
| 157 | let full_resp = self.pre_verify(bases, missing_responses)?; |
| 158 | if (G::Group::msm_unchecked(bases, &full_resp) |
| 159 | .add(y.mul_bigint((-*challenge).into_bigint()))) |
| 160 | .into_affine() |
| 161 | == *t |
| 162 | { |
| 163 | Ok(()) |
| 164 | } else { |
| 165 | Err(SchnorrError::InvalidResponse) |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | /// Same as `Self::is_valid` except it uses `RandomizedMultChecker` to combine the scalar multiplication checks into a single |
| 170 | pub fn verify_using_randomized_mult_checker( |