Generate a partial proof, i.e. don't generate responses for message indices in `skip_responses_for` as these will be generated by some other protocol.
(
mut self,
challenge: &E::ScalarField,
revealed_msg_ids: &BTreeSet<usize>,
skip_responses_for: &BTreeSet<usize>,
)
| 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. |
| 295 | pub fn gen_partial_proof( |
| 296 | mut self, |
| 297 | challenge: &E::ScalarField, |
| 298 | revealed_msg_ids: &BTreeSet<usize>, |
| 299 | skip_responses_for: &BTreeSet<usize>, |
| 300 | ) -> Result<PoKOfSignatureG1Proof<E>, BBSPlusError> { |
| 301 | if !skip_responses_for.is_disjoint(revealed_msg_ids) { |
| 302 | return Err(BBSPlusError::CommonIndicesFoundInRevealedAndSkip); |
| 303 | } |
| 304 | // Schnorr response for relation `A_bar - d == A'*{-e} + h_0*r2` |
| 305 | let sc_resp_1 = mem::take(&mut self.sc_comm_1).gen_proof(challenge); |
| 306 | |
| 307 | let wits = schnorr_responses_to_msg_index_map( |
| 308 | mem::take(&mut self.sc_wits_2), |
| 309 | revealed_msg_ids, |
| 310 | skip_responses_for, |
| 311 | ); |
| 312 | // 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})` |
| 313 | let sc_resp_2 = self.sc_comm_2.partial_response(wits, challenge)?; |
| 314 | |
| 315 | Ok(PoKOfSignatureG1Proof { |
| 316 | A_prime: self.A_prime, |
| 317 | A_bar: self.A_bar, |
| 318 | d: self.d, |
| 319 | sc_resp_1, |
| 320 | T2: self.sc_comm_2.t, |
| 321 | sc_resp_2: None, |
| 322 | sc_partial_resp_2: Some(sc_resp_2), |
| 323 | }) |
| 324 | } |
| 325 | |
| 326 | /// Helper that serializes state to get challenge contribution. Serialized the randomized signature, |
| 327 | /// and commitments and instances for both Schnorr protocols |
no test coverage detected