Generate proof. Post-challenge phase of the protocol.
(
mut self,
challenge: &E::ScalarField,
)
| 271 | |
| 272 | /// Generate proof. Post-challenge phase of the protocol. |
| 273 | pub fn gen_proof( |
| 274 | mut self, |
| 275 | challenge: &E::ScalarField, |
| 276 | ) -> Result<PoKOfSignatureG1Proof<E>, BBSPlusError> { |
| 277 | // Schnorr response for relation `A_bar - d == A'*{-e} + h_0*r2` |
| 278 | let sc_resp_1 = mem::take(&mut self.sc_comm_1).gen_proof(challenge); |
| 279 | // Schnorr response for relation `g1 + \sum_{i in D}(h_i*m_i)` = `d*r3 + {h_0}*{-s'} + \sum_{j not in D}(h_j*{-m_j})` |
| 280 | let sc_resp_2 = self.sc_comm_2.response(&self.sc_wits_2, challenge)?; |
| 281 | |
| 282 | Ok(PoKOfSignatureG1Proof { |
| 283 | A_prime: self.A_prime, |
| 284 | A_bar: self.A_bar, |
| 285 | d: self.d, |
| 286 | sc_resp_1, |
| 287 | T2: self.sc_comm_2.t, |
| 288 | sc_resp_2: Some(sc_resp_2), |
| 289 | sc_partial_resp_2: None, |
| 290 | }) |
| 291 | } |
| 292 | |
| 293 | /// Generate a partial proof, i.e. don't generate responses for message indices in `skip_responses_for` as these will be |
| 294 | /// generated by some other protocol. |