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

Method compute_response

kvac/src/bbs_sharp/hol.rs:324–337  ·  view source on GitHub ↗

Computes `r_0_i = s_i + c_0_i * sk`

(
        mut self,
        mut challenge: BlindedChallenges<G::ScalarField>,
        signer_secret_key: &SecretKey<G::ScalarField>,
    )

Source from the content-addressed store, hash-verified

322
323 /// Computes `r_0_i = s_i + c_0_i * sk`
324 pub fn compute_response(
325 mut self,
326 mut challenge: BlindedChallenges<G::ScalarField>,
327 signer_secret_key: &SecretKey<G::ScalarField>,
328 ) -> Responses<G::ScalarField> {
329 assert_eq!(self.0.len(), challenge.0.len());
330 let s = mem::take(&mut self.0);
331 let c = mem::take(&mut challenge.0);
332 let r = cfg_into_iter!(c)
333 .zip(cfg_into_iter!(s))
334 .map(|(c_i, s_i)| s_i + c_i * signer_secret_key.0)
335 .collect::<Vec<_>>();
336 Responses(r)
337 }
338}
339
340impl<G: AffineRepr> ProofOfValidity<G> {

Callers 1

checkFunction · 0.80

Calls 2

mapMethod · 0.80
ResponsesClass · 0.70

Tested by

no test coverage detected