(
&mut self,
rng: &mut R,
ck_comm_ct: &'a [E::G1Affine],
ck_comm_chunks: &'a [E::G1Affine],
ck_comm_combined: &'a [E::G1Affine],
message: E::ScalarField
| 147 | } |
| 148 | |
| 149 | pub fn init_with_ciphertext_and_proof<R: RngCore>( |
| 150 | &mut self, |
| 151 | rng: &mut R, |
| 152 | ck_comm_ct: &'a [E::G1Affine], |
| 153 | ck_comm_chunks: &'a [E::G1Affine], |
| 154 | ck_comm_combined: &'a [E::G1Affine], |
| 155 | message: E::ScalarField, |
| 156 | blinding_combined_message: Option<E::ScalarField>, |
| 157 | old_randomness: E::ScalarField, |
| 158 | ciphertext: Ciphertext<E>, |
| 159 | proof: ark_groth16::Proof<E>, |
| 160 | ) -> Result<(), ProofSystemError> { |
| 161 | if self.ciphertext.is_some() { |
| 162 | return Err(ProofSystemError::SubProtocolAlreadyInitialized(self.id)); |
| 163 | }; |
| 164 | let snark_proving_key = self |
| 165 | .snark_proving_key |
| 166 | .ok_or(ProofSystemError::SaverSnarkProvingKeyNotProvided)?; |
| 167 | |
| 168 | let (ciphertext, randomness_enc, proof) = Encryption::rerandomize_ciphertext_and_proof( |
| 169 | ciphertext, |
| 170 | proof, |
| 171 | &snark_proving_key.pk.vk, |
| 172 | self.encryption_key, |
| 173 | rng, |
| 174 | )?; |
| 175 | |
| 176 | self.init_schnorr_protocols( |
| 177 | rng, |
| 178 | ck_comm_ct, |
| 179 | ck_comm_chunks, |
| 180 | ck_comm_combined, |
| 181 | message, |
| 182 | blinding_combined_message, |
| 183 | ciphertext, |
| 184 | old_randomness + randomness_enc, |
| 185 | proof, |
| 186 | ) |
| 187 | } |
| 188 | |
| 189 | pub fn challenge_contribution<W: Write>(&self, mut writer: W) -> Result<(), ProofSystemError> { |
| 190 | if self.ciphertext.is_none() { |
no test coverage detected