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

Method init

proof_system/src/sub_protocols/inequality.rs:44–68  ·  view source on GitHub ↗
(
        &mut self,
        rng: &mut R,
        comm_key_as_slice: &'a [G],
        message: G::ScalarField,
        blinding: Option<G::ScalarField>,
    )

Source from the content-addressed store, hash-verified

42 }
43
44 pub fn init<R: RngCore>(
45 &mut self,
46 rng: &mut R,
47 comm_key_as_slice: &'a [G],
48 message: G::ScalarField,
49 blinding: Option<G::ScalarField>,
50 ) -> Result<(), ProofSystemError> {
51 if self.sp.is_some() {
52 return Err(ProofSystemError::SubProtocolAlreadyInitialized(self.id));
53 }
54 let randomness = G::ScalarField::rand(rng);
55 let comm = self.comm_key.commit(&message, &randomness);
56 self.inequality_protocol = Some(
57 DiscreteLogInequalityProtocol::init_for_inequality_with_public_value(
58 rng,
59 message,
60 randomness,
61 &comm,
62 &self.inequal_to,
63 &self.comm_key,
64 )?,
65 );
66 self.comm = Some(comm);
67 self.init_schnorr_protocol(rng, comm_key_as_slice, message, blinding, randomness)
68 }
69
70 fn init_schnorr_protocol<R: RngCore>(
71 &mut self,

Callers 1

init_schnorr_protocolMethod · 0.45

Calls 3

randFunction · 0.85
commitMethod · 0.45
init_schnorr_protocolMethod · 0.45

Tested by

no test coverage detected