File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -204,6 +204,12 @@ where
204204 let response = self
205205 . interactive_proof
206206 . deserialize_response ( & proof[ commitment_size..] ) ?;
207+ let response_size = self . interactive_proof . serialize_response ( & response) . len ( ) ;
208+
209+ // Proof size check
210+ if proof. len ( ) != commitment_size + response_size {
211+ return Err ( Error :: VerificationFailure ) ;
212+ }
207213
208214 let mut hash_state = self . hash_state . clone ( ) ;
209215
@@ -270,6 +276,12 @@ where
270276 let response = self
271277 . interactive_proof
272278 . deserialize_response ( & proof[ challenge_size..] ) ?;
279+ let response_size = self . interactive_proof . serialize_response ( & response) . len ( ) ;
280+
281+ // Proof size check
282+ if proof. len ( ) != challenge_size + response_size {
283+ return Err ( Error :: VerificationFailure ) ;
284+ }
273285
274286 // Compute the commitments
275287 let commitment = self
You can’t perform that action at this time.
0 commit comments