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

Method init_schnorr_protocol

proof_system/src/sub_protocols/inequality.rs:70–95  ·  view source on GitHub ↗
(
        &mut self,
        rng: &mut R,
        comm_key: &'a [G],
        message: G::ScalarField,
        blinding: Option<G::ScalarField>,
        blinding_for_ineqality_protocol_commitment: G::S

Source from the content-addressed store, hash-verified

68 }
69
70 fn init_schnorr_protocol<R: RngCore>(
71 &mut self,
72 rng: &mut R,
73 comm_key: &'a [G],
74 message: G::ScalarField,
75 blinding: Option<G::ScalarField>,
76 blinding_for_ineqality_protocol_commitment: G::ScalarField,
77 ) -> Result<(), ProofSystemError> {
78 let blinding = if blinding.is_none() {
79 G::ScalarField::rand(rng)
80 } else {
81 blinding.unwrap()
82 };
83 let mut blindings = BTreeMap::new();
84 blindings.insert(0, blinding);
85
86 // NOTE: value of id is dummy
87 let mut sp = SchnorrProtocol::new(10000, &comm_key, self.comm.unwrap());
88 sp.init(
89 rng,
90 blindings.clone(),
91 vec![message, blinding_for_ineqality_protocol_commitment],
92 )?;
93 self.sp = Some(sp);
94 Ok(())
95 }
96
97 pub fn challenge_contribution<W: Write>(&self, mut writer: W) -> Result<(), ProofSystemError> {
98 if self.sp.is_none() {

Callers 1

initMethod · 0.45

Calls 3

randFunction · 0.85
cloneMethod · 0.80
initMethod · 0.45

Tested by

no test coverage detected