MCPcopy Create free account
hub / github.com/docknetwork/crypto / gen_proof

Method gen_proof

bbs_plus/src/proof.rs:273–291  ·  view source on GitHub ↗

Generate proof. Post-challenge phase of the protocol.

(
        mut self,
        challenge: &E::ScalarField,
    )

Source from the content-addressed store, hash-verified

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.

Callers 15

pok_sig_benchmarkFunction · 0.45
pok_sig_benchmarkFunction · 0.45
pok_sig_benchmarkFunction · 0.45
pseudonymFunction · 0.45
gen_partial_proofMethod · 0.45
root_issuanceFunction · 0.45

Calls 1

responseMethod · 0.45

Tested by 1

root_issuanceFunction · 0.36