Skip to content

Commit

Permalink
Add public input absorption
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielbosio committed Apr 16, 2024
1 parent 727bc58 commit 15f15cb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kimchi/src/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ where
//~ and $0$ for the rest.
let public = witness[0][0..index.cs.public].to_vec();
let public_poly = -Evaluations::<G::ScalarField, D<G::ScalarField>>::from_vec_and_domain(
public,
public.clone(),
index.cs.domain.d1,
)
.interpolate();
Expand All @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions kimchi/src/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 15f15cb

Please sign in to comment.