From 15f15cb1076ea195beb3f6e401a51cca989827de Mon Sep 17 00:00:00 2001 From: gabrielbosio Date: Tue, 16 Apr 2024 11:24:33 -0300 Subject: [PATCH] Add public input absorption --- kimchi/src/prover.rs | 5 ++++- kimchi/src/verifier.rs | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/kimchi/src/prover.rs b/kimchi/src/prover.rs index bedab008ff..21d1a78016 100644 --- a/kimchi/src/prover.rs +++ b/kimchi/src/prover.rs @@ -254,7 +254,7 @@ where //~ and $0$ for the rest. let public = witness[0][0..index.cs.public].to_vec(); let public_poly = -Evaluations::>::from_vec_and_domain( - public, + public.clone(), index.cs.domain.d1, ) .interpolate(); @@ -279,6 +279,9 @@ where //~ This is why we need to absorb the commitment to the public polynomial at this point. absorb_commitment(&mut fq_sponge, &public_comm); + //~ 1. (NEW) Absorb the public input. + fq_sponge.absorb_fr(&public); + //~ 1. Commit to the witness columns by creating `COLUMNS` hidding commitments. //~ //~ Note: since the witness is in evaluation form, diff --git a/kimchi/src/verifier.rs b/kimchi/src/verifier.rs index be00b5e4b7..f2815885b9 100644 --- a/kimchi/src/verifier.rs +++ b/kimchi/src/verifier.rs @@ -147,6 +147,9 @@ where //~ 1. Absorb the commitment of the public input polynomial with the Fq-Sponge. absorb_commitment(&mut fq_sponge, public_comm); + //~ 1. (NEW) Absorb the public input (TODO: remove unwrap). + fq_sponge.absorb_fr(public_input.unwrap()); + //~ 1. Absorb the commitments to the registers / witness columns with the Fq-Sponge. self.commitments .w_comm