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

Method gen_proof_contribution

proof_system/src/sub_protocols/inequality.rs:119–144  ·  view source on GitHub ↗
(
        &mut self,
        challenge: &G::ScalarField,
    )

Source from the content-addressed store, hash-verified

117 }
118
119 pub fn gen_proof_contribution<E: Pairing<G1Affine = G>>(
120 &mut self,
121 challenge: &G::ScalarField,
122 ) -> Result<StatementProof<E>, ProofSystemError> {
123 if self.sp.is_none() {
124 return Err(ProofSystemError::SubProtocolNotReadyToGenerateProof(
125 self.id,
126 ));
127 }
128 let proof = self
129 .inequality_protocol
130 .take()
131 .unwrap()
132 .gen_proof(challenge);
133 // Don't generate response for index 0 since its response will come from proofs of one of the signatures.
134 let skip_for = BTreeSet::from([0]);
135 Ok(StatementProof::Inequality(InequalityProof {
136 proof,
137 comm: self.comm.take().unwrap(),
138 sp: self
139 .sp
140 .take()
141 .unwrap()
142 .gen_partial_proof_contribution_as_struct(challenge, &skip_for)?,
143 }))
144 }
145
146 pub fn verify_proof_contribution(
147 &self,

Callers

nothing calls this directly

Calls 2

gen_proofMethod · 0.45

Tested by

no test coverage detected