6868 /// - The prover state (random nonces and witness) used to compute the response.
6969 ///
7070 /// # Errors
71- /// -`ProofError ::ProofSizeMismatch` if the witness vector length is incorrect.
71+ /// -`Error ::ProofSizeMismatch` if the witness vector length is incorrect.
7272 fn prover_commit (
7373 & self ,
7474 witness : & Self :: Witness ,
9696 /// - A vector of scalars forming the prover's response.
9797 ///
9898 /// # Errors
99- /// - Returns `ProofError ::ProofSizeMismatch` if the prover state vectors have incorrect lengths.
99+ /// - Returns `Error ::ProofSizeMismatch` if the prover state vectors have incorrect lengths.
100100 fn prover_response (
101101 & self ,
102102 state : Self :: ProverState ,
@@ -121,13 +121,13 @@ where
121121 ///
122122 /// # Returns
123123 /// - `Ok(())` if the proof is valid.
124- /// - `Err(ProofError ::VerificationFailure)` if the proof is invalid.
125- /// - `Err(ProofError ::ProofSizeMismatch)` if the lengths of commitment or response do not match the expected counts.
124+ /// - `Err(Error ::VerificationFailure)` if the proof is invalid.
125+ /// - `Err(Error ::ProofSizeMismatch)` if the lengths of commitment or response do not match the expected counts.
126126 ///
127127 /// # Errors
128- /// -`Err(ProofError ::VerificationFailure)` if the computed relation
128+ /// -`Err(Error ::VerificationFailure)` if the computed relation
129129 /// does not hold for the provided challenge and response, indicating proof invalidity.
130- /// -`Err(ProofError ::ProofSizeMismatch)` if the commitment or response length is incorrect.
130+ /// -`Err(Error ::ProofSizeMismatch)` if the commitment or response length is incorrect.
131131 fn verifier (
132132 & self ,
133133 commitment : & Self :: Commitment ,
@@ -163,7 +163,7 @@ where
163163 /// - A byte vector representing the serialized batchable proof.
164164 ///
165165 /// # Errors
166- /// - `ProofError ::ProofSizeMismatch` if the commitment or response length is incorrect.
166+ /// - `Error ::ProofSizeMismatch` if the commitment or response length is incorrect.
167167 fn serialize_batchable (
168168 & self ,
169169 commitment : & Self :: Commitment ,
@@ -196,13 +196,13 @@ where
196196 ///
197197 /// # Returns
198198 /// - A tuple `(commitment, response)` where
199- /// * `commitment` is a vector of group elements (one per statement) , and
200- /// * `response` is a vector of scalars (one per witness) .
199+ /// * `commitment` is a vector of group elements, and
200+ /// * `response` is a vector of scalars.
201201 ///
202202 /// # Errors
203- /// - `ProofError ::ProofSizeMismatch` if the input length is not the exact number of bytes
203+ /// - `Error ::ProofSizeMismatch` if the input length is not the exact number of bytes
204204 /// expected for `commit_nb` commitments plus `response_nb` responses.
205- /// - `ProofError ::GroupSerializationFailure` if any group element or scalar fails to
205+ /// - `Error ::GroupSerializationFailure` if any group element or scalar fails to
206206 /// deserialize (propagated from `deserialize_element` or `deserialize_scalar`).
207207 fn deserialize_batchable (
208208 & self ,
@@ -260,7 +260,7 @@ where
260260 /// - A vector of group elements representing the recomputed commitment (one per linear constraint).
261261 ///
262262 /// # Errors
263- /// - `ProofError ::ProofSizeMismatch` if the response length does not match the expected number of scalars.
263+ /// - `Error ::ProofSizeMismatch` if the response length does not match the expected number of scalars.
264264 fn get_commitment (
265265 & self ,
266266 challenge : & Self :: Challenge ,
@@ -280,6 +280,17 @@ where
280280 Ok ( commitment)
281281 }
282282
283+ /// Serializes a compact transcript: challenge followed by responses.
284+ /// # Parameters
285+ /// - `_commitment`: Omitted in compact format (reconstructed during verification).
286+ /// - `challenge`: The challenge scalar.
287+ /// - `response`: The prover’s response.
288+ ///
289+ /// # Returns
290+ /// - A byte vector representing the compact proof.
291+ ///
292+ /// # Errors
293+ /// - `Error::ProofSizeMismatch` if the response length does not match the expected number of scalars.
283294 fn serialize_response ( & self , response : & Self :: Response ) -> Result < Vec < u8 > , Error > {
284295 let mut bytes = Vec :: new ( ) ;
285296 let response_nb = self . scalars_nb ( ) ;
@@ -294,6 +305,17 @@ where
294305 Ok ( bytes)
295306 }
296307
308+ /// Deserializes a compact proof into a challenge and response.
309+ ///
310+ /// # Parameters
311+ /// - `data`: A byte slice encoding the compact proof.
312+ ///
313+ /// # Returns
314+ /// - A tuple `(challenge, response)`.
315+ ///
316+ /// # Errors
317+ /// - `Error::ProofSizeMismatch` if the input data length does not match the expected size.
318+ /// - `Error::GroupSerializationFailure` if scalar deserialization fails.
297319 fn deserialize_response ( & self , data : & [ u8 ] ) -> Result < ( Self :: Response , usize ) , Error > {
298320 let response_nb = self . scalars_nb ( ) ;
299321 let response_size = <<G as Group >:: Scalar as PrimeField >:: Repr :: default ( )
@@ -326,7 +348,7 @@ where
326348 /// - A byte vector representing the compact proof.
327349 ///
328350 /// # Errors
329- /// - `ProofError ::ProofSizeMismatch` if the response length does not match the expected number of scalars.
351+ /// - `Error ::ProofSizeMismatch` if the response length does not match the expected number of scalars.
330352 fn serialize_compact (
331353 & self ,
332354 _commitment : & Self :: Commitment ,
@@ -352,8 +374,8 @@ where
352374 /// - A tuple `(challenge, response)`.
353375 ///
354376 /// # Errors
355- /// - `ProofError ::ProofSizeMismatch` if the input data length does not match the expected size.
356- /// - `ProofError ::GroupSerializationFailure` if scalar deserialization fails.
377+ /// - `Error ::ProofSizeMismatch` if the input data length does not match the expected size.
378+ /// - `Error ::GroupSerializationFailure` if scalar deserialization fails.
357379 fn deserialize_compact ( & self , data : & [ u8 ] ) -> Result < ( Self :: Challenge , Self :: Response ) , Error > {
358380 let scalar_size = <<G as Group >:: Scalar as PrimeField >:: Repr :: default ( )
359381 . as_ref ( )
0 commit comments