Skip to content

Commit

Permalink
fix serialization of generic const array in coefficients_comm suggest…
Browse files Browse the repository at this point in the history
…ed by Matthew :D
  • Loading branch information
querolita committed Oct 26, 2023
1 parent e5b40c9 commit 71fe4aa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions book/src/specs/kimchi.md
Original file line number Diff line number Diff line change
Expand Up @@ -1761,8 +1761,8 @@ pub struct VerifierIndex<const W: usize, G: KimchiCurve> {
#[serde(bound = "PolyComm<G>: Serialize + DeserializeOwned")]
pub sigma_comm: [PolyComm<G>; PERMUTS],
/// coefficient commitment array
#[serde(bound = "PolyComm<G>: Serialize + DeserializeOwned")]
pub coefficients_comm: Vec<PolyComm<G>>,
#[serde_as(as = "[_; W]")]
pub coefficients_comm: [PolyComm<G>; W],
/// coefficient commitment array
#[serde(bound = "PolyComm<G>: Serialize + DeserializeOwned")]
pub generic_comm: PolyComm<G>,
Expand Down
16 changes: 8 additions & 8 deletions kimchi/src/verifier_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ pub struct VerifierIndex<const W: usize, G: KimchiCurve> {
#[serde(bound = "PolyComm<G>: Serialize + DeserializeOwned")]
pub sigma_comm: [PolyComm<G>; PERMUTS],
/// coefficient commitment array
#[serde(bound = "PolyComm<G>: Serialize + DeserializeOwned")]
pub coefficients_comm: Vec<PolyComm<G>>,
#[serde_as(as = "[_; W]")]
pub coefficients_comm: [PolyComm<G>; W],
/// coefficient commitment array
#[serde(bound = "PolyComm<G>: Serialize + DeserializeOwned")]
pub generic_comm: PolyComm<G>,
Expand Down Expand Up @@ -215,12 +215,12 @@ impl<const W: usize, G: KimchiCurve> ProverIndex<W, G> {
&self.column_evaluations.permutation_coefficients8[i],
)
}),
coefficients_comm: self
.column_evaluations
.coefficients8
.iter()
.map(|c| self.srs.commit_evaluations_non_hiding(domain, c))
.collect::<Vec<_>>(),
coefficients_comm: array::from_fn(|i| {
self.srs.commit_evaluations_non_hiding(
domain,
&self.column_evaluations.coefficients8[i],
)
}),
generic_comm: mask_fixed(
self.srs.commit_evaluations_non_hiding(
domain,
Expand Down

0 comments on commit 71fe4aa

Please sign in to comment.