(
&mut self,
rng: &mut R,
comm_key_as_slice: &'a [G],
message: G::ScalarField,
blinding: Option<G::ScalarField>,
)
| 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, |
no test coverage detected