From f5a5845bc8572a73dfcf7ee7fb2d76a16d426baa Mon Sep 17 00:00:00 2001 From: Robin Salen <30937548+Nashtare@users.noreply.github.com> Date: Thu, 4 Jul 2024 06:35:06 +0900 Subject: [PATCH] Observe public inputs (#1607) --- starky/src/get_challenges.rs | 2 ++ starky/src/prover.rs | 1 + 2 files changed, 3 insertions(+) diff --git a/starky/src/get_challenges.rs b/starky/src/get_challenges.rs index 8000a9ef90..e8904ffcaf 100644 --- a/starky/src/get_challenges.rs +++ b/starky/src/get_challenges.rs @@ -157,6 +157,7 @@ where ignore_trace_cap: bool, config: &StarkConfig, ) -> StarkProofChallenges { + challenger.observe_elements(&self.public_inputs); self.proof .get_challenges(challenger, challenges, ignore_trace_cap, config) } @@ -302,6 +303,7 @@ impl StarkProofWithPublicInputsTarget { C: GenericConfig, C::Hasher: AlgebraicHasher, { + challenger.observe_elements(&self.public_inputs); self.proof .get_challenges::(builder, challenger, challenges, ignore_trace_cap, config) } diff --git a/starky/src/prover.rs b/starky/src/prover.rs index 53ec767e4d..36d544b624 100644 --- a/starky/src/prover.rs +++ b/starky/src/prover.rs @@ -71,6 +71,7 @@ where let trace_cap = trace_commitment.merkle_tree.cap.clone(); let mut challenger = Challenger::new(); + challenger.observe_elements(public_inputs); challenger.observe_cap(&trace_cap); prove_with_commitment(