| 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() { |