mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-03 22:33:06 +00:00
Observe public inputs (#119)
* Observe public inputs * Observe the hash instead
This commit is contained in:
parent
1d5cd4430e
commit
6bd197e9cf
@ -78,9 +78,10 @@ pub(crate) fn prove<F: Extendable<D>, const D: usize>(
|
||||
);
|
||||
|
||||
let mut challenger = Challenger::new();
|
||||
|
||||
// Observe the instance.
|
||||
// TODO: Need to include public inputs as well.
|
||||
challenger.observe_hash(&common_data.circuit_digest);
|
||||
challenger.observe_hash(&public_inputs_hash);
|
||||
|
||||
challenger.observe_hash(&wires_commitment.merkle_tree.root);
|
||||
let betas = challenger.get_n_challenges(num_challenges);
|
||||
|
||||
@ -28,18 +28,20 @@ impl<F: Extendable<D>, const D: usize> CircuitBuilder<F, D> {
|
||||
} = proof_with_pis;
|
||||
let one = self.one_extension();
|
||||
|
||||
let public_inputs_hash = &self.hash_n_to_hash(public_inputs, true);
|
||||
|
||||
let num_challenges = inner_config.num_challenges;
|
||||
|
||||
let public_inputs_hash = &self.hash_n_to_hash(public_inputs, true);
|
||||
|
||||
let mut challenger = RecursiveChallenger::new(self);
|
||||
|
||||
let (betas, gammas, alphas, zeta) =
|
||||
context!(self, "observe proof and generates challenges", {
|
||||
// Observe the instance.
|
||||
let digest = HashTarget::from_vec(
|
||||
self.constants(&inner_common_data.circuit_digest.elements),
|
||||
);
|
||||
challenger.observe_hash(&digest);
|
||||
challenger.observe_hash(&public_inputs_hash);
|
||||
|
||||
challenger.observe_hash(&proof.wires_root);
|
||||
let betas = challenger.get_n_challenges(self, num_challenges);
|
||||
|
||||
@ -25,9 +25,10 @@ pub(crate) fn verify<F: Extendable<D>, const D: usize>(
|
||||
let public_inputs_hash = &hash_n_to_hash(public_inputs, true);
|
||||
|
||||
let mut challenger = Challenger::new();
|
||||
|
||||
// Observe the instance.
|
||||
// TODO: Need to include public inputs as well.
|
||||
challenger.observe_hash(&common_data.circuit_digest);
|
||||
challenger.observe_hash(&public_inputs_hash);
|
||||
|
||||
challenger.observe_hash(&proof.wires_root);
|
||||
let betas = challenger.get_n_challenges(num_challenges);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user